Skip to content

refactor(web): unify offline/error fallback across pages - #430

Open
gerardoparrajc wants to merge 2 commits into
theam:mainfrom
gerardoparrajc:refactor/unify-api-result-fallback
Open

gerardoparrajc wants to merge 2 commits into
theam:mainfrom
gerardoparrajc:refactor/unify-api-result-fallback

Conversation

@gerardoparrajc

@gerardoparrajc gerardoparrajc commented Sep 29, 2026 •

Copy link
Copy Markdown

Extracts the repeated if (!x.ok) return x.offline ? <Offline/> : <ErrorNotice/> check
into a shared resultFallback(result, prefix?) helper in components/offline.tsx, used
across the projects, project overview, settings, insights, agents, attention and stories
pages. Also routes a real 404 on project settings through notFound() instead of a
generic ErrorNotice.

Files affected:

  • apps/web/components/offline.tsx

  • apps/web/app/(app)/(org)/projects/page.tsx

  • apps/web/app/(app)/projects/[projectId]/page.tsx

  • apps/web/app/(app)/projects/[projectId]/settings/page.tsx

  • apps/web/app/(app)/projects/[projectId]/insights/page.tsx

  • apps/web/app/(app)/projects/[projectId]/agents/page.tsx

  • apps/web/app/(app)/projects/[projectId]/attention/page.tsx

  • apps/web/app/(app)/projects/[projectId]/stories/page.tsx

  • apps/web/app/(app)/projects/[projectId]/stories/[number]/page.tsx

  • Persistence/migration/compatibility: none.

  • Security/permissions: none — presentation-only, no new data exposed.

  • Cost/budget/observability/analytics/GitHub mirror: none.

  • Known risks / follow-up: apps/(app)/layout.tsx, projects/[projectId]/layout.tsx, and
    (org)/settings/page.tsx were left untouched (different existing semantics, e.g. the
    settings page doesn't currently distinguish offline from a real error); tracked as
    follow-up, not fixed here to keep this change behavior-preserving.

  • Release classification: non-breaking, not user-visible (pure refactor).

Verification:

  • pnpm exec biome check <changed files> — clean
  • pnpm --filter @facility/sdk build && pnpm --filter @facility/web build — pass

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant