Skip to content

Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.

fix(web): route loading and error states, real 404s and shared page frames (#3306)

Raghav Chamadiyaca435b3b373c
diff --git a/packages/ui/src/dashboard/active-job-banner.tsx b/packages/ui/src/dashboard/active-job-banner.tsx
index 35d911be6..522909a31 100644
--- a/packages/ui/src/dashboard/active-job-banner.tsx
+++ b/packages/ui/src/dashboard/active-job-banner.tsx
@@ -45,9 +45,9 @@ export function ActiveJobBanner({ job, detailsHref }: ActiveJobBannerProps) {
const phaseLabel = PHASE_LABELS[job.current_level ?? 0] ?? "Processing";
return (
- <div className="px-4 py-2 border-b border-[var(--color-border-default)] bg-[var(--color-bg-inset)]">
- <div className="flex items-center gap-3">
- {isRunning && <Spinner size="sm" className="text-[var(--color-accent-primary)]" />}
+ <div className="border-b border-[var(--color-border-default)] bg-[var(--color-bg-surface)] px-3 py-1.5 sm:px-[var(--page-pad)]">
+ <div className="flex flex-wrap items-center gap-x-3 gap-y-1">
+ {isRunning && <Spinner size="sm" className="text-[var(--color-text-tertiary)]" />}
{isDone && <CheckCircle className="h-3.5 w-3.5 text-[var(--color-success)] shrink-0" />}
{isFailed && <XCircle className="h-3.5 w-3.5 text-[var(--color-error)] shrink-0" />}
@@ -58,7 +58,7 @@ export function ActiveJobBanner({ job, detailsHref }: ActiveJobBannerProps) {
</span>
{isRunning && (
- <div className="flex-1 max-w-[200px]">
+ <div className="w-24 sm:w-48">
<Progress value={progress} className="h-1.5" />
</div>
)}
diff --git a/packages/ui/src/overview/overview-body.tsx b/packages/ui/src/overview/overview-body.tsx
index f8e9056a1..d8482d76c 100644
--- a/packages/ui/src/overview/overview-body.tsx
+++ b/packages/ui/src/overview/overview-body.tsx
@@ -3,6 +3,7 @@ import type { OverviewSummaryResponse } from "@repowise-dev/types/overview";
import { getDefaultHref } from "../dashboard/attention-href";
import { formatNumber } from "../lib/format";
import { fileEntityPath } from "../shared/entity";
+import { PageFrame } from "../shared/page-shell";
import { StatRibbon } from "../stats/stat-ribbon";
import { AttentionAreas } from "./attention-areas";
import { AttentionRows } from "./attention-rows";
@@ -145,7 +146,7 @@ export function OverviewBody({
);
return (
- <div className="mx-auto flex w-full max-w-[1280px] flex-col gap-6 p-[var(--page-pad)] sm:gap-8">
+ <PageFrame>
{slots.header}
<ChangeLine since={previousSnapshotAt(summary)} stats={changeStats} />
@@ -257,6 +258,6 @@ export function OverviewBody({
<OverviewSection title="Explore this codebase">
<ExploreList entries={explore} LinkComponent={LinkComponent} />
</OverviewSection>
- </div>
+ </PageFrame>
);
}
diff --git a/packages/web/messages/en.json b/packages/web/messages/en.json
index 2e8380f83..5e84bf3d3 100644
--- a/packages/web/messages/en.json
+++ b/packages/web/messages/en.json
@@ -84,6 +84,7 @@
"loading": "Loading Repowise"
},
"reindexHint": {
+ "label": "Reindex",
"body": "This index was built by an older repowise. It still works, but a reindex is recommended to pick up the latest format."
},
"whatsNewModal": {
@@ -146,6 +147,10 @@
"files": "Files"
},
"errors": {
+ "workspaceErrorTitle": "Failed to load the workspace",
+ "workspaceErrorFallback": "Could not load workspace data. The backend may be unavailable.",
+ "settingsErrorTitle": "Failed to load settings",
+ "settingsErrorFallback": "Could not load settings. The backend may be unavailable.",
"notFoundTitle": "Page not found",
"notFoundBody": "The page you requested doesn't exist. It may have been moved or never existed.",
"backToDashboard": "Back to dashboard",
@@ -218,10 +223,12 @@
"description": "The things about this codebase you can't see anywhere else: how big it got, when it started, when the work happens, and the records it holds."
},
"commits": {
+ "emptyTitle": "No scored commits yet",
+ "emptyAction": "Go to overview",
"title": "Commits",
"description": "Every commit scored for change-risk against this repo's own history, so 'elevated' means elevated here rather than on some global curve.",
"emptyDescription": "Every commit scored for change-risk against this repo's own history.",
- "emptyHint": "Per-commit change-risk is captured on the next full index. Run a sync and the review queue fills in behind it.",
+ "emptyHint": "Per-commit change risk is captured on the next full index. Run a sync from the overview and the review queue fills in behind it.",
"reviewQueueTitle": "Review queue",
"reviewQueueDescription": "Newest first by default. Priority is a tercile of this repo's own distribution, so sorting by it shows only the top third — the filters narrow the whole repository, not the page.",
"scoreBehaviourTitle": "How the score behaves here",
@@ -231,7 +238,6 @@
"evolutionDescription": "Commit categories over time, read off the subject line. Fixes carry the accent because that is the series this chart exists to show."
},
"architecture": {
- "couplingTitle": "Change coupling",
"tabs": {
"map": "Map",
"coupling": "Coupling",
@@ -321,6 +327,8 @@
"unknownName": "unknown"
},
"costs": {
+ "spendEmptyTitle": "No model calls recorded yet",
+ "spendEmptyDescription": "Nothing has been spent on this repository. Model spend appears here once Repowise generates docs or answers with a model.",
"title": "Usage & savings",
"description": "What agents avoided, what Repowise cost, and how we know.",
"savingsErrorTitle": "Couldn't load agent savings",
@@ -368,6 +376,7 @@
"footer": "Sync schedule, exclude patterns and deletion are per repository, on <link>the repository page</link>."
},
"workspace": {
+ "emptyAction": "Read the quickstart",
"title": "Workspace",
"description": "Every repository registered in this workspace, and what connects them.",
"emptyTitle": "No repositories discovered yet",
@@ -425,6 +434,8 @@
}
},
"docsFreshness": {
+ "loadErrorTitle": "Couldn't load documentation pages",
+ "loadErrorBody": "The backend did not return this repository's pages. Reload to try again.",
"title": "Doc freshness",
"header": "Freshness across {count} pages",
"freshPct": "{pct}% of pages are fresh",
@@ -1140,6 +1151,12 @@
}
},
"loading": {
+ "workspace": "Loading workspace",
+ "settings": "Loading settings",
+ "docs": "Loading documentation",
+ "overview": "Loading overview",
+ "file": "Loading file",
+ "symbol": "Loading symbol",
"page": "Loading page",
"repo": "Loading",
"architecture": "Loading architecture",
diff --git a/packages/web/messages/zh-CN.json b/packages/web/messages/zh-CN.json
index 8a0677513..135cd258e 100644
--- a/packages/web/messages/zh-CN.json
+++ b/packages/web/messages/zh-CN.json
@@ -84,6 +84,7 @@
"loading": "正在加载 Repowise"
},
"reindexHint": {
+ "label": "重新索引",
"body": "这个索引是由旧版 repowise 构建的。它仍然可用,但建议重新索引,以采用最新的存储格式。"
},
"whatsNewModal": {
@@ -146,6 +147,10 @@
"files": "文件"
},
"errors": {
+ "workspaceErrorTitle": "无法加载工作区",
+ "workspaceErrorFallback": "无法加载工作区数据,后端可能不可用。",
+ "settingsErrorTitle": "无法加载设置",
+ "settingsErrorFallback": "无法加载设置,后端可能不可用。",
"notFoundTitle": "页面不存在",
"notFoundBody": "你请求的页面不存在,可能已被移动,或从未存在。",
"backToDashboard": "返回仪表盘",
@@ -218,10 +223,12 @@
"description": "这些是这个代码库在其他地方看不到的信息:它有多大、从何时开始、工作发生在什么时间,以及它保持的纪录。"
},
"commits": {
+ "emptyTitle": "尚无已评分的提交",
+ "emptyAction": "前往概览",
"title": "提交",
"description": "每个提交都针对该仓库自身的历史评定了变更风险,因此「偏高」是相对本仓库偏高,而不是套用某条全局曲线。",
"emptyDescription": "每个提交都针对该仓库自身的历史评定了变更风险。",
- "emptyHint": "每次完整索引时会采集逐提交的变更风险。跑一次同步,评审队列随后就会填充。",
+ "emptyHint": "每次提交的变更风险会在下一次完整索引时记录。在概览页运行一次同步,审查队列就会随之填充。",
"reviewQueueTitle": "评审队列",
"reviewQueueDescription": "默认按最新排序。优先级取自本仓库自身分布的三分位,因此按它排序只会显示前三分之一——筛选条件收窄的是整个仓库,而不是当前这一页。",
"scoreBehaviourTitle": "分数在这个仓库里的表现",
@@ -231,7 +238,6 @@
"evolutionDescription": "按提交标题归类出的各类提交随时间的变化。修复类高亮显示,因为这张图存在的意义就是展示这一条序列。"
},
"architecture": {
- "couplingTitle": "变更耦合",
"tabs": {
"map": "地图",
"coupling": "耦合",
@@ -321,6 +327,8 @@
"unknownName": "未知"
},
"costs": {
+ "spendEmptyTitle": "尚无模型调用记录",
+ "spendEmptyDescription": "此仓库还没有产生任何花费。Repowise 使用模型生成文档或回答问题后,花费会显示在这里。",
"title": "用量与节省",
"description": "智能体避开了什么、Repowise 花了多少,以及我们凭什么这么说。",
"savingsErrorTitle": "无法加载智能体节省数据",
@@ -368,6 +376,7 @@
"footer": "同步计划、排除规则与删除按代码仓库分别设置,见<link>代码仓库页面</link>。"
},
"workspace": {
+ "emptyAction": "阅读快速入门",
"title": "工作区",
"description": "这个工作区中注册的全部代码仓库,以及它们之间的关联。",
"emptyTitle": "尚未发现任何代码仓库",
@@ -425,6 +434,8 @@
}
},
"docsFreshness": {
+ "loadErrorTitle": "无法加载文档页面",
+ "loadErrorBody": "后端没有返回此仓库的页面,请刷新后重试。",
"title": "文档新鲜度",
"header": "{count} 页文档的新鲜度",
"freshPct": "{pct}% 的页面是新鲜的",
@@ -1140,6 +1151,12 @@
}
},
"loading": {
+ "workspace": "正在加载工作区",
+ "settings": "正在加载设置",
+ "docs": "正在加载文档",
+ "overview": "正在加载概览",
+ "file": "正在加载文件",
+ "symbol": "正在加载符号",
"page": "正在加载页面",
"repo": "正在加载",
"architecture": "正在加载架构",
diff --git a/packages/web/src/app/repos/[id]/architecture/loading.tsx b/packages/web/src/app/repos/[id]/architecture/loading.tsx
index 5c1618a7d..e8391927f 100644
--- a/packages/web/src/app/repos/[id]/architecture/loading.tsx
+++ b/packages/web/src/app/repos/[id]/architecture/loading.tsx
@@ -14,10 +14,10 @@ export default async function ArchitectureLoading() {
className="flex h-full flex-col"
label={t("architecture")}
>
- <div className="shrink-0 px-4 pt-3 sm:px-6">
+ <div className="shrink-0 px-[var(--page-pad)] pt-3">
<Skeleton className="h-9 w-80 max-w-full rounded-lg" />
</div>
- <div className="min-h-0 flex-1 p-4 sm:p-6">
+ <div className="min-h-0 flex-1 p-[var(--page-pad)]">
<Skeleton className="h-full w-full rounded-lg" />
</div>
</SkeletonRegion>
diff --git a/packages/web/src/app/repos/[id]/architecture/page.tsx b/packages/web/src/app/repos/[id]/architecture/page.tsx
index 34b5604d2..50c8cbb36 100644
--- a/packages/web/src/app/repos/[id]/architecture/page.tsx
+++ b/packages/web/src/app/repos/[id]/architecture/page.tsx
@@ -46,7 +46,7 @@ import { use, useCallback, useEffect } from "react";
import { useRouter } from "next/navigation";
import { useTranslations } from "next-intl";
import { useQueryState, parseAsStringLiteral } from "nuqs";
-import { Code2 } from "lucide-react";
+import { PageFrame } from "@repowise-dev/ui/shared/page-shell";
import { ViewTabs } from "@repowise-dev/ui/shared/view-tabs";
import { ErrorBoundary } from "@repowise-dev/ui/shared";
import { GraphView } from "@/components/architecture/graph-view";
@@ -202,7 +202,7 @@ export default function ArchitecturePage({
return (
<div className="flex h-full flex-col">
- <div className="shrink-0 px-4 pt-3 sm:px-6">
+ <div className="shrink-0 px-[var(--page-pad)] pt-3">
<ViewTabs
tabs={tabs}
value={activeTab}
@@ -229,30 +229,24 @@ export default function ArchitecturePage({
)}
{activeTab === "packages" && <DependenciesView repoId={repoId} />}
{activeTab === "symbols" && (
- <div className="max-w-[1600px] space-y-6 p-4 sm:p-6">
+ <PageFrame maxWidth="wide">
<SymbolIndexHeader />
<SymbolTable repoId={repoId} />
- </div>
+ </PageFrame>
)}
{activeTab === "coupling" && (
- <div className="mx-auto max-w-[1500px] p-4 sm:p-6">
- {/* Wider than the other tabs: the pairs table carries a sentence
- per row plus both modules. The ring keeps its own 820px cap. */}
- <div className="mb-2">
- <h1 className="mb-1 flex items-center gap-2 text-xl font-semibold text-[var(--color-text-primary)]">
- <Code2 className="h-5 w-5 text-[var(--color-accent-primary)]" />
- {t("couplingTitle")}
- </h1>
- <p className="text-sm text-[var(--color-text-secondary)]">
- {COUPLING_DISCLAIMER}
- </p>
- </div>
+ <PageFrame maxWidth="wide">
+ {/* The tab is already named Coupling, so the page carries the
+ disclaimer alone rather than a second page title. */}
+ <p className="max-w-[68ch] text-sm text-[var(--color-text-secondary)]">
+ {COUPLING_DISCLAIMER}
+ </p>
{/* Contain a render throw to the tab instead of letting it reach
the route boundary and blank the page. */}
<ErrorBoundary title={tCoupling("loadFailed")}>
<CouplingTab repoId={repoId} />
</ErrorBoundary>
- </div>
+ </PageFrame>
)}
</div>
</div>
diff --git a/packages/web/src/app/repos/[id]/commits/page.tsx b/packages/web/src/app/repos/[id]/commits/page.tsx
index 63e6440b4..2fafaa20f 100644
--- a/packages/web/src/app/repos/[id]/commits/page.tsx
+++ b/packages/web/src/app/repos/[id]/commits/page.tsx
@@ -2,6 +2,7 @@ import type { Metadata } from "next";
import Link from "next/link";
import { GitCommitHorizontal } from "lucide-react";
import { PageShell } from "@repowise-dev/ui/shared/page-shell";
+import { EmptyState } from "@repowise-dev/ui/shared/empty-state";
import { OverviewSection, SectionLink } from "@repowise-dev/ui/overview";
import { CommitsLede } from "@repowise-dev/ui/commits/commits-lede";
import { CodeEvolutionChart } from "@repowise-dev/ui/commits/code-evolution-chart";
@@ -77,9 +78,11 @@ export default async function CommitsPage({
title={t("title")}
description={t("emptyDescription")}
>
- <p className="max-w-[62ch] text-sm text-[var(--color-text-secondary)]">
- {t("emptyHint")}
- </p>
+ <EmptyState
+ title={t("emptyTitle")}
+ description={t("emptyHint")}
+ action={{ label: t("emptyAction"), href: `${base}/overview` }}
+ />
</PageShell>
);
}
diff --git a/packages/web/src/app/repos/[id]/costs/page.tsx b/packages/web/src/app/repos/[id]/costs/page.tsx
index 1b9b77a50..59405a77c 100644
--- a/packages/web/src/app/repos/[id]/costs/page.tsx
+++ b/packages/web/src/app/repos/[id]/costs/page.tsx
@@ -117,7 +117,16 @@ export default function CostsPage() {
{spendError ? (
<ApiError title={t("spendErrorTitle")} onRetry={() => void retrySpend()} />
) : spend === undefined ? (
- <p className="text-sm text-[var(--color-text-tertiary)]">{t("loadingSpend")}</p>
+ <SkeletonRegion label={t("loadingSpend")} className="flex flex-col gap-3">
+ <Skeleton className="h-5 w-48" />
+ <Skeleton className="h-14 w-full" />
+ </SkeletonRegion>
+ ) : spend.total_calls === 0 ? (
+ <EmptyState
+ size="compact"
+ title={t("spendEmptyTitle")}
+ description={t("spendEmptyDescription")}
+ />
) : (
<SpendSummary spend={spend} />
)}
@@ -209,11 +218,7 @@ function SavingsSections({ data }: { data: SavingsView }) {
total={data.saved_input_tokens}
nameHeader={t("surfaceHeader")}
caption={t("surfaceCaption")}
- empty={
- <p className="text-sm text-[var(--color-text-secondary)]">
- {t("surfaceEmpty")}
- </p>
- }
+ empty={<EmptyState size="compact" title={t("surfaceEmpty")} />}
/>
</OverviewSection>
diff --git a/packages/web/src/app/repos/[id]/docs/coverage/loading.tsx b/packages/web/src/app/repos/[id]/docs/coverage/loading.tsx
index 3b37c714a..939a75732 100644
--- a/packages/web/src/app/repos/[id]/docs/coverage/loading.tsx
+++ b/packages/web/src/app/repos/[id]/docs/coverage/loading.tsx
@@ -1,5 +1,6 @@
import { getTranslations } from "next-intl/server";
import { StatGridSkeleton } from "@repowise-dev/ui/shared/loading-skeletons";
+import { PageFrame } from "@repowise-dev/ui/shared/page-shell";
import { SkeletonRegion, Skeleton } from "@repowise-dev/ui/ui/skeleton";
/**
@@ -15,7 +16,7 @@ export default async function DocsCoverageLoading() {
<div className="shrink-0 border-b border-[var(--color-border-default)] px-4 py-3 sm:px-6">
<Skeleton className="h-6 w-56 max-w-full" />
</div>
- <div className="max-w-[1600px] flex-1 space-y-6 p-4 sm:p-6">
+ <PageFrame maxWidth="wide" className="flex-1">
<div className="flex flex-col gap-6 lg:flex-row lg:items-start">
<div className="flex shrink-0 flex-col items-center gap-4 lg:w-56">
<Skeleton className="h-40 w-40 rounded-full" />
@@ -24,7 +25,7 @@ export default async function DocsCoverageLoading() {
<StatGridSkeleton count={3} className="flex-1" />
</div>
<Skeleton className="h-72 w-full rounded-xl" />
- </div>
+ </PageFrame>
</SkeletonRegion>
);
}
diff --git a/packages/web/src/app/repos/[id]/docs/coverage/page.tsx b/packages/web/src/app/repos/[id]/docs/coverage/page.tsx
index 425d2ff55..ba7c381cc 100644
--- a/packages/web/src/app/repos/[id]/docs/coverage/page.tsx
+++ b/packages/web/src/app/repos/[id]/docs/coverage/page.tsx
@@ -10,6 +10,8 @@ import { listAllPages } from "@/lib/api/pages";
import { formatNumber } from "@repowise-dev/ui/lib/format";
import { getTranslations } from "next-intl/server";
import { HostedNudgeSlot } from "@/components/hosted/hosted-nudge-slot";
+import { ApiError } from "@repowise-dev/ui/shared/api-error";
+import { PageFrame } from "@repowise-dev/ui/shared/page-shell";
export const metadata: Metadata = { title: "Doc freshness" };
@@ -22,13 +24,14 @@ export default async function CoveragePage({
const t = await getTranslations("views.docsFreshness");
let pages: Awaited<ReturnType<typeof listAllPages>> = [];
+ let failed = false;
try {
// Auto-paginate past the 500-item API cap so the counts, donut, and the
// freshness table see every page, not just the first page of results.
pages = await listAllPages(id);
} catch {
- // API unavailable
+ failed = true;
}
const total = pages.length;
@@ -44,12 +47,20 @@ export default async function CoveragePage({
return (
<div className="flex flex-col h-full">
<DocsHeader>
- <span className="text-xs text-[var(--color-text-tertiary)]">
- {t("header", { count: formatNumber(total) })}
- </span>
+ {!failed && (
+ <span className="text-xs text-[var(--color-text-tertiary)]">
+ {t("header", { count: formatNumber(total) })}
+ </span>
+ )}
</DocsHeader>
- <div className="flex-1 overflow-y-auto p-4 sm:p-6 space-y-6 max-w-[1600px]">
+ <div className="min-h-0 flex-1 overflow-y-auto">
+ {failed ? (
+ <PageFrame maxWidth="wide">
+ <ApiError title={t("loadErrorTitle")} message={t("loadErrorBody")} />
+ </PageFrame>
+ ) : (
+ <PageFrame maxWidth="wide">
<div className="flex flex-col gap-6 lg:flex-row lg:items-start">
{/* Donut */}
<div className="flex flex-col items-center gap-4 lg:w-56 shrink-0">
@@ -112,6 +123,8 @@ export default async function CoveragePage({
)}
<FreshnessTableWithRegenerate pages={pages} repoId={id} />
+ </PageFrame>
+ )}
</div>
</div>
);
diff --git a/packages/web/src/app/repos/[id]/docs/loading.tsx b/packages/web/src/app/repos/[id]/docs/loading.tsx
new file mode 100644
index 000000000..d82109d6a
--- /dev/null
+++ b/packages/web/src/app/repos/[id]/docs/loading.tsx
@@ -0,0 +1,29 @@
+import { getTranslations } from "next-intl/server";
+import { SkeletonRegion, Skeleton } from "@repowise-dev/ui/ui/skeleton";
+import { DOCS_READER_SHELL_CLASS } from "./docs-reader-shell";
+
+/** Reader-shaped: the docs header band, the page tree, then the article. */
+export default async function DocsLoading() {
+ const t = await getTranslations("loading");
+ return (
+ <SkeletonRegion className={DOCS_READER_SHELL_CLASS} label={t("docs")}>
+ <div className="shrink-0 border-b border-[var(--color-border-default)] px-4 py-3 sm:px-6">
+ <Skeleton className="h-6 w-56 max-w-full" />
+ </div>
+ <div className="flex min-h-0 flex-1">
+ <div className="hidden w-64 shrink-0 space-y-2 border-r border-[var(--color-border-default)] p-4 md:block">
+ {Array.from({ length: 9 }).map((_, i) => (
+ <Skeleton key={i} className="h-4 w-full" />
+ ))}
+ </div>
+ <div className="min-w-0 flex-1 space-y-4 p-4 sm:p-6">
+ <Skeleton className="h-8 w-2/3 max-w-lg" />
+ <Skeleton className="h-4 w-full max-w-[68ch]" />
+ <Skeleton className="h-4 w-5/6 max-w-[68ch]" />
+ <Skeleton className="h-4 w-3/4 max-w-[68ch]" />
+ <Skeleton className="h-48 w-full max-w-[68ch]" />
+ </div>
+ </div>
+ </SkeletonRegion>
+ );
+}
diff --git a/packages/web/src/app/repos/[id]/files/[...path]/loading.tsx b/packages/web/src/app/repos/[id]/files/[...path]/loading.tsx
index 7464e1a65..9459183ee 100644
--- a/packages/web/src/app/repos/[id]/files/[...path]/loading.tsx
+++ b/packages/web/src/app/repos/[id]/files/[...path]/loading.tsx
@@ -1,4 +1,6 @@
-import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
+import { getTranslations } from "next-intl/server";
+import { PageFrame } from "@repowise-dev/ui/shared/page-shell";
+import { Skeleton, SkeletonRegion } from "@repowise-dev/ui/ui/skeleton";
/**
* Shapes match the real header: eyebrow, path, the lede's 44px figure beside
@@ -7,9 +9,11 @@ import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
* all, so content landing reflowed everything — which reads as slower than
* showing nothing.
*/
-export default function FilePageLoading() {
+export default async function FilePageLoading() {
+ const t = await getTranslations("loading");
return (
- <div className="mx-auto flex w-full max-w-[1280px] flex-col p-[var(--page-pad)]">
+ <SkeletonRegion label={t("file")}>
+ <PageFrame>
<div className="flex flex-col gap-8">
<div className="flex flex-col gap-6">
<div>
@@ -32,6 +36,7 @@ export default function FilePageLoading() {
<Skeleton className="h-9 w-full max-w-lg" />
<Skeleton className="h-96 w-full" />
</div>
- </div>
+ </PageFrame>
+ </SkeletonRegion>
);
}
diff --git a/packages/web/src/app/repos/[id]/files/[...path]/page.tsx b/packages/web/src/app/repos/[id]/files/[...path]/page.tsx
index f7d36b0eb..1e52c0879 100644
--- a/packages/web/src/app/repos/[id]/files/[...path]/page.tsx
+++ b/packages/web/src/app/repos/[id]/files/[...path]/page.tsx
@@ -3,6 +3,7 @@ import { notFound } from "next/navigation";
import Link from "next/link";
import { bundledLanguages, getSingletonHighlighter, type BundledLanguage } from "shiki";
import { getFileContent, getFileDetail } from "@/lib/api/files";
+import { ApiClientError } from "@/lib/api/client";
import { WikiMarkdown } from "@repowise-dev/ui/wiki/wiki-markdown";
import {
docsPagePath,
@@ -17,6 +18,7 @@ import {
resolveFileTab,
type FilePageTab,
} from "@repowise-dev/ui/files";
+import { PageFrame } from "@repowise-dev/ui/shared/page-shell";
import { FilePageHost } from "@/components/files/file-page-host";
import { FileTestsPanel } from "@/components/files/file-tests-panel";
import { FileHealthPanel } from "@/components/files/file-health-panel";
@@ -133,8 +135,9 @@ export default async function FileEntityPage({ params, searchParams }: Props) {
? getFileContent(id, filePath).catch(() => undefined)
: Promise.resolve(undefined),
]);
- } catch {
- notFound();
+ } catch (err) {
+ if (err instanceof ApiClientError && err.status === 404) notFound();
+ throw err;
}
const coverageCodeHtml = await renderCoverageCode(source, detail);
@@ -200,10 +203,7 @@ export default async function FileEntityPage({ params, searchParams }: Props) {
});
return (
- // The Overview's wrapper verbatim: centred, `--page-pad`, 1280. The page
- // was `max-w-[1200px] p-4 sm:p-6` and left-anchored, so at 2048 it left a
- // 770px hole down the right while every ported sibling centred.
- <div className="mx-auto flex w-full max-w-[1280px] flex-col p-[var(--page-pad)]">
+ <PageFrame>
<FilePageHost
// Keyed on the path so a soft navigation between two file pages
// remounts the shell. Without it React preserves the tab state at the
@@ -223,6 +223,6 @@ export default async function FileEntityPage({ params, searchParams }: Props) {
initialTab={initialTab}
refetchTabs={refetchTabs}
/>
- </div>
+ </PageFrame>
);
}
diff --git a/packages/web/src/app/repos/[id]/overview/loading.tsx b/packages/web/src/app/repos/[id]/overview/loading.tsx
index c84f3eb8b..9b58dea25 100644
--- a/packages/web/src/app/repos/[id]/overview/loading.tsx
+++ b/packages/web/src/app/repos/[id]/overview/loading.tsx
@@ -1,4 +1,6 @@
-import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
+import { getTranslations } from "next-intl/server";
+import { PageFrame } from "@repowise-dev/ui/shared/page-shell";
+import { Skeleton, SkeletonRegion } from "@repowise-dev/ui/ui/skeleton";
/**
* Skeleton mirroring the Overview layout — identity header, change line,
@@ -8,9 +10,11 @@ import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
* match causes a visible reflow the moment content lands, which reads as
* slower than showing nothing. (The owl stays reserved for brand moments.)
*/
-export default function OverviewLoading() {
+export default async function OverviewLoading() {
+ const t = await getTranslations("loading");
return (
- <div className="mx-auto flex w-full max-w-[1280px] flex-col gap-6 p-[var(--page-pad)] sm:gap-8">
+ <SkeletonRegion label={t("overview")}>
+ <PageFrame>
{/* Identity header: mark, title, description, meta row */}
<div className="flex gap-4">
<Skeleton className="h-10 w-10 rounded-xl" />
@@ -47,6 +51,7 @@ export default function OverviewLoading() {
<Skeleton className="h-48" />
<Skeleton className="h-40" />
- </div>
+ </PageFrame>
+ </SkeletonRegion>
);
}
diff --git a/packages/web/src/app/repos/[id]/overview/page.tsx b/packages/web/src/app/repos/[id]/overview/page.tsx
index d3ca09f42..e144e4890 100644
--- a/packages/web/src/app/repos/[id]/overview/page.tsx
+++ b/packages/web/src/app/repos/[id]/overview/page.tsx
@@ -2,6 +2,8 @@ import type { Metadata } from "next";
import { notFound } from "next/navigation";
import Link from "next/link";
import { getOverviewSummary } from "@/lib/api/overview";
+import { ApiClientError } from "@/lib/api/client";
+import { PageFrame } from "@repowise-dev/ui/shared/page-shell";
import { getActions } from "@/lib/api/actions";
import { getProviders } from "@/lib/api/providers";
import { getCommitsPage } from "@/lib/api/git";
@@ -59,7 +61,12 @@ export default async function OverviewPage({ params }: Props) {
// only buy a slower first paint and worse indexability. The commits call
// replaces a client-side SWR fetch that used to waterfall in after paint.
const [summary, providers, commitsPage, actions] = await Promise.all([
- safeFetch(() => getOverviewSummary(id)),
+ // Only a 404 means the repo is gone; any other failure reaches the route
+ // error boundary instead of reading as "not found".
+ getOverviewSummary(id).catch((err: unknown) => {
+ if (err instanceof ApiClientError && err.status === 404) return null;
+ throw err;
+ }),
safeFetch(() => getProviders()),
safeFetch(() => getCommitsPage(id, { sort: "date", limit: COMMIT_LIMIT })),
safeFetch(() => getActions(id)),
@@ -121,10 +128,10 @@ export default async function OverviewPage({ params }: Props) {
if (isFresh) {
return (
- <div className="mx-auto flex w-full max-w-[1280px] flex-col gap-8 p-[var(--page-pad)]">
+ <PageFrame>
{header}
<FirstIndexExperience repoId={id} repoName={repo.name} />
- </div>
+ </PageFrame>
);
}
diff --git a/packages/web/src/app/repos/[id]/settings/page.tsx b/packages/web/src/app/repos/[id]/settings/page.tsx
index c949fdaea..48ed7fc94 100644
--- a/packages/web/src/app/repos/[id]/settings/page.tsx
+++ b/packages/web/src/app/repos/[id]/settings/page.tsx
@@ -58,7 +58,7 @@ export default async function RepoSettingsPage({ params }: Props) {
<PageShell
title={t("title")}
description={t("description", { repo: repo.name })}
- className="max-w-3xl"
+ maxWidth="narrow"
>
<OverviewSection
title={t("generalTitle")}
diff --git a/packages/web/src/app/repos/[id]/stats/page.tsx b/packages/web/src/app/repos/[id]/stats/page.tsx
index 671eb6412..65f40769b 100644
--- a/packages/web/src/app/repos/[id]/stats/page.tsx
+++ b/packages/web/src/app/repos/[id]/stats/page.tsx
@@ -3,6 +3,7 @@ import { notFound } from "next/navigation";
import { getTranslations } from "next-intl/server";
import { BarChart3 } from "lucide-react";
import { getStatsHighlights } from "@/lib/api/stats";
+import { ApiClientError } from "@/lib/api/client";
import { PageShell } from "@repowise-dev/ui/shared";
import { StatsView } from "@/components/stats/stats-view";
@@ -22,8 +23,9 @@ export default async function StatsPage({ params }: Props) {
let data;
try {
data = await getStatsHighlights(id);
- } catch {
- notFound();
+ } catch (err) {
+ if (err instanceof ApiClientError && err.status === 404) notFound();
+ throw err;
}
return (
diff --git a/packages/web/src/app/repos/[id]/symbols/[symbolId]/loading.tsx b/packages/web/src/app/repos/[id]/symbols/[symbolId]/loading.tsx
index f48c0fc25..28004c770 100644
--- a/packages/web/src/app/repos/[id]/symbols/[symbolId]/loading.tsx
+++ b/packages/web/src/app/repos/[id]/symbols/[symbolId]/loading.tsx
@@ -1,20 +1,25 @@
-import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
+import { getTranslations } from "next-intl/server";
+import { PageFrame } from "@repowise-dev/ui/shared/page-shell";
+import { Skeleton, SkeletonRegion } from "@repowise-dev/ui/ui/skeleton";
-export default function SymbolPageLoading() {
+export default async function SymbolPageLoading() {
+ const t = await getTranslations("loading");
return (
- <div className="p-4 sm:p-6 max-w-[1100px] space-y-4">
- <Skeleton className="h-6 w-1/2" />
- <Skeleton className="h-4 w-1/3" />
- <Skeleton className="h-20 w-full" />
- <div className="grid grid-cols-2 gap-3 sm:grid-cols-6">
- {Array.from({ length: 6 }).map((_, i) => (
- <Skeleton key={i} className="h-16" />
- ))}
- </div>
- <div className="grid grid-cols-1 gap-4 lg:grid-cols-2">
- <Skeleton className="h-48" />
- <Skeleton className="h-48" />
- </div>
- </div>
+ <SkeletonRegion label={t("symbol")}>
+ <PageFrame>
+ <Skeleton className="h-6 w-1/2" />
+ <Skeleton className="h-4 w-1/3" />
+ <Skeleton className="h-20 w-full" />
+ <div className="grid grid-cols-2 gap-3 sm:grid-cols-6">
+ {Array.from({ length: 6 }).map((_, i) => (
+ <Skeleton key={i} className="h-16" />
+ ))}
+ </div>
+ <div className="grid grid-cols-1 gap-4 lg:grid-cols-2">
+ <Skeleton className="h-48" />
+ <Skeleton className="h-48" />
+ </div>
+ </PageFrame>
+ </SkeletonRegion>
);
}
diff --git a/packages/web/src/app/repos/[id]/symbols/[symbolId]/page.tsx b/packages/web/src/app/repos/[id]/symbols/[symbolId]/page.tsx
index 5b31229eb..fc5bac395 100644
--- a/packages/web/src/app/repos/[id]/symbols/[symbolId]/page.tsx
+++ b/packages/web/src/app/repos/[id]/symbols/[symbolId]/page.tsx
@@ -2,6 +2,8 @@ import type { Metadata } from "next";
import Link from "next/link";
import { notFound } from "next/navigation";
import { getSymbolDetail } from "@/lib/api/symbols";
+import { ApiClientError } from "@/lib/api/client";
+import { PageFrame } from "@repowise-dev/ui/shared/page-shell";
import { SymbolPage } from "@repowise-dev/ui/symbols";
import { fileEntityPath } from "@repowise-dev/ui/shared/entity";
import type { SymbolDetailResponse } from "@repowise-dev/types/symbols";
@@ -23,14 +25,15 @@ export default async function SymbolEntityPage({ params }: Props) {
let detail: SymbolDetailResponse;
try {
detail = await getSymbolDetail(id, decoded);
- } catch {
- notFound();
+ } catch (err) {
+ if (err instanceof ApiClientError && err.status === 404) notFound();
+ throw err;
}
const filePath = detail.symbol.file_path;
return (
- <div className="mx-auto w-full max-w-[1100px] p-4 sm:p-6">
+ <PageFrame>
<SymbolPage
data={detail}
repoId={id}
@@ -40,6 +43,6 @@ export default async function SymbolEntityPage({ params }: Props) {
{ label: detail.symbol.name },
]}
/>
- </div>
+ </PageFrame>
);
}
diff --git a/packages/web/src/app/settings/error.tsx b/packages/web/src/app/settings/error.tsx
new file mode 100644
index 000000000..373abecdb
--- /dev/null
+++ b/packages/web/src/app/settings/error.tsx
@@ -0,0 +1,38 @@
+"use client";
+
+import { useEffect } from "react";
+import Link from "next/link";
+import { useTranslations } from "next-intl";
+import { ArrowLeft } from "lucide-react";
+import { RouteError } from "@repowise-dev/ui/shared/route-states";
+
+export default function SettingsError({
+ error,
+ reset,
+}: {
+ error: Error & { digest?: string };
+ reset: () => void;
+}) {
+ const t = useTranslations("errors");
+
+ useEffect(() => {
+ console.error(error);
+ }, [error]);
+
+ return (
+ <RouteError
+ title={t("settingsErrorTitle")}
+ message={t("settingsErrorFallback")}
+ digest={error.digest}
+ digestLabel={t("digest")}
+ onRetry={reset}
+ retryLabel={t("retry")}
+ back={
+ <Link href="/">
+ <ArrowLeft className="h-3.5 w-3.5" aria-hidden />
+ {t("dashboard")}
+ </Link>
+ }
+ />
+ );
+}
diff --git a/packages/web/src/app/settings/loading.tsx b/packages/web/src/app/settings/loading.tsx
new file mode 100644
index 000000000..eb32234f7
--- /dev/null
+++ b/packages/web/src/app/settings/loading.tsx
@@ -0,0 +1,14 @@
+import { getTranslations } from "next-intl/server";
+import { PageSkeleton } from "@repowise-dev/ui/shared/loading-skeletons";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
+
+export default async function SettingsLoading() {
+ const t = await getTranslations("loading");
+ return (
+ <PageSkeleton maxWidth="narrow" actions={false} label={t("settings")}>
+ <Skeleton className="h-40 w-full" />
+ <Skeleton className="h-40 w-full" />
+ <Skeleton className="h-40 w-full" />
+ </PageSkeleton>
+ );
+}
diff --git a/packages/web/src/app/settings/page.tsx b/packages/web/src/app/settings/page.tsx
index a02b21c58..f72363e6c 100644
--- a/packages/web/src/app/settings/page.tsx
+++ b/packages/web/src/app/settings/page.tsx
@@ -20,7 +20,7 @@ export const metadata: Metadata = { title: "Settings" };
* systems, two heading scales for the same role. Both run `PageShell` and
* `OverviewSection` now, and everything on the page autosaves.
*
- * `max-w-3xl` rather than the default 1280: this is a form, and a control that
+ * `narrow` rather than the default 1280: this is a form, and a control that
* stretches to 1280 loses the relationship between its label and itself.
*/
export default async function SettingsPage() {
@@ -30,7 +30,7 @@ export default async function SettingsPage() {
<PageShell
title={t("title")}
description={t("description")}
- className="max-w-3xl"
+ maxWidth="narrow"
>
<ConnectionSection />
<ProviderSection />
diff --git a/packages/web/src/app/workspace/error.tsx b/packages/web/src/app/workspace/error.tsx
new file mode 100644
index 000000000..3f3af3a85
--- /dev/null
+++ b/packages/web/src/app/workspace/error.tsx
@@ -0,0 +1,38 @@
+"use client";
+
+import { useEffect } from "react";
+import Link from "next/link";
+import { useTranslations } from "next-intl";
+import { ArrowLeft } from "lucide-react";
+import { RouteError } from "@repowise-dev/ui/shared/route-states";
+
+export default function WorkspaceError({
+ error,
+ reset,
+}: {
+ error: Error & { digest?: string };
+ reset: () => void;
+}) {
+ const t = useTranslations("errors");
+
+ useEffect(() => {
+ console.error(error);
+ }, [error]);
+
+ return (
+ <RouteError
+ title={t("workspaceErrorTitle")}
+ message={t("workspaceErrorFallback")}
+ digest={error.digest}
+ digestLabel={t("digest")}
+ onRetry={reset}
+ retryLabel={t("retry")}
+ back={
+ <Link href="/">
+ <ArrowLeft className="h-3.5 w-3.5" aria-hidden />
+ {t("dashboard")}
+ </Link>
+ }
+ />
+ );
+}
diff --git a/packages/web/src/app/workspace/loading.tsx b/packages/web/src/app/workspace/loading.tsx
new file mode 100644
index 000000000..9d76ed63e
--- /dev/null
+++ b/packages/web/src/app/workspace/loading.tsx
@@ -0,0 +1,14 @@
+import { getTranslations } from "next-intl/server";
+import { PageSkeleton, StatGridSkeleton } from "@repowise-dev/ui/shared/loading-skeletons";
+import { Skeleton } from "@repowise-dev/ui/ui/skeleton";
+
+/** Workspace overview: header, a stat ribbon, then the repository list. */
+export default async function WorkspaceLoading() {
+ const t = await getTranslations("loading");
+ return (
+ <PageSkeleton label={t("workspace")}>
+ <StatGridSkeleton count={4} />
+ <Skeleton className="h-64 w-full" />
+ </PageSkeleton>
+ );
+}
diff --git a/packages/web/src/app/workspace/page.tsx b/packages/web/src/app/workspace/page.tsx
index 27331c8e3..71f846763 100644
--- a/packages/web/src/app/workspace/page.tsx
+++ b/packages/web/src/app/workspace/page.tsx
@@ -25,6 +25,9 @@ import { RemoveWorkspaceRepoButton, SyncButton } from "./sync-buttons";
import { getTranslations } from "next-intl/server";
import { WorkspaceNextActionsPanel } from "./workspace-next-actions-panel";
+const WORKSPACE_DOCS_HREF =
+ "https://github.com/repowise-dev/repowise/blob/main/docs/start/QUICKSTART.md";
+
export async function generateMetadata(): Promise<Metadata> {
const t = await getTranslations("views.workspace");
return { title: t("title") };
@@ -86,7 +89,8 @@ export default async function WorkspaceDashboardPage() {
<EmptyState
title={t("emptyTitle")}
description={t("emptyDescription")}
- icon={<Layers className="h-8 w-8" />}
+ icon={<Layers />}
+ action={{ label: t("emptyAction"), href: WORKSPACE_DOCS_HREF }}
/>
</PageShell>
);
diff --git a/packages/web/src/components/layout/reindex-hint-banner.tsx b/packages/web/src/components/layout/reindex-hint-banner.tsx
index ced1cc430..b54ab79e4 100644
--- a/packages/web/src/components/layout/reindex-hint-banner.tsx
+++ b/packages/web/src/components/layout/reindex-hint-banner.tsx
@@ -1,7 +1,8 @@
"use client";
import { useEffect, useState } from "react";
-import { AlertTriangle, X } from "lucide-react";
+import { X } from "lucide-react";
+import { Callout } from "@repowise-dev/ui/shared/callout";
import useSWR from "swr";
import { getMetaVersion } from "@/lib/api/meta";
import { useTranslations } from "next-intl";
@@ -52,15 +53,22 @@ export function ReindexHintBanner({ repoId }: ReindexHintBannerProps) {
};
return (
- <div
- role="status"
- className="flex items-start gap-3 border-b border-[var(--color-border-default)] bg-[var(--color-accent-muted)] px-4 py-2 text-sm"
- >
- <AlertTriangle
- className="mt-0.5 h-4 w-4 shrink-0 text-[var(--color-accent-primary)]"
- aria-hidden="true"
- />
- <div className="flex-1 text-[var(--color-text-primary)]">
+ <div className="px-3 pt-2 sm:px-[var(--page-pad)]">
+ <Callout
+ tone="warning"
+ label={t("reindexHint.label")}
+ className="py-1.5"
+ action={
+ <button
+ type="button"
+ onClick={dismiss}
+ aria-label={tc("dismiss")}
+ className="rounded p-1.5 text-[var(--color-text-tertiary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)]"
+ >
+ <X className="h-4 w-4" />
+ </button>
+ }
+ >
{t("reindexHint.body")}
{command && (
<>
@@ -70,15 +78,7 @@ export function ReindexHintBanner({ repoId }: ReindexHintBannerProps) {
</code>
</>
)}
- </div>
- <button
- type="button"
- onClick={dismiss}
- aria-label={tc("dismiss")}
- className="rounded p-1 text-[var(--color-text-tertiary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)]"
- >
- <X className="h-4 w-4" />
- </button>
+ </Callout>
</div>
);
}
diff --git a/packages/web/src/components/layout/upgrade-banner.tsx b/packages/web/src/components/layout/upgrade-banner.tsx
index 51f8b4745..305dd611c 100644
--- a/packages/web/src/components/layout/upgrade-banner.tsx
+++ b/packages/web/src/components/layout/upgrade-banner.tsx
@@ -1,7 +1,8 @@
"use client";
import { useEffect, useState } from "react";
-import { ArrowUpCircle, X } from "lucide-react";
+import { X } from "lucide-react";
+import { Callout } from "@repowise-dev/ui/shared/callout";
import { useTranslations } from "next-intl";
import { useMetaVersion } from "@/lib/hooks/use-meta-version";
import { WhatsNewModal } from "./whats-new-modal";
@@ -45,21 +46,28 @@ export function UpgradeBanner() {
return (
<>
- <div
- role="status"
- className="flex items-center gap-3 border-b border-[var(--color-border-default)] bg-[var(--color-accent-muted)] px-4 py-2 text-sm"
- >
- <ArrowUpCircle
- className="h-4 w-4 shrink-0 text-[var(--color-accent-primary)]"
- aria-hidden="true"
- />
- <p className="flex-1 text-[var(--color-text-primary)]">
+ <div className="px-3 pt-2 sm:px-[var(--page-pad)]">
+ <Callout
+ tone="info"
+ label={t("updateAvailable")}
+ className="py-1.5"
+ action={
+ <button
+ type="button"
+ onClick={dismiss}
+ aria-label={tc("dismiss")}
+ className="rounded p-1.5 text-[var(--color-text-tertiary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)]"
+ >
+ <X className="h-4 w-4" />
+ </button>
+ }
+ >
{t.rich("updateBanner", {
latest,
b: (chunks) => <span className="font-medium">{chunks}</span>,
})}
{meta?.server_version ? (
- <span className="text-[var(--color-text-tertiary)]">
+ <span className="hidden text-[var(--color-text-tertiary)] sm:inline">
{t("updateBannerCurrent", { current: meta.server_version })}
</span>
) : null}
@@ -69,7 +77,7 @@ export function UpgradeBanner() {
{t.rich("updateBannerCommand", {
command: meta.upgrade_command,
code: (chunks) => (
- <code className="rounded bg-[var(--color-bg-elevated)] px-1.5 py-0.5 text-xs">
+ <code className="rounded bg-[var(--color-bg-elevated)] px-1.5 py-0.5 text-xs [overflow-wrap:anywhere]">
{chunks}
</code>
),
@@ -79,19 +87,11 @@ export function UpgradeBanner() {
<button
type="button"
onClick={() => setShowWhatsNew(true)}
- className="text-[var(--color-accent-primary)] underline underline-offset-2 hover:opacity-80"
+ className="text-[var(--color-text-primary)] underline underline-offset-2 hover:opacity-80"
>
{t("whatsNew")}
</button>
- </p>
- <button
- type="button"
- onClick={dismiss}
- aria-label={tc("dismiss")}
- className="rounded p-1 text-[var(--color-text-tertiary)] hover:bg-[var(--color-bg-elevated)] hover:text-[var(--color-text-primary)]"
- >
- <X className="h-4 w-4" />
- </button>
+ </Callout>
</div>
<WhatsNewModal open={showWhatsNew} onOpenChange={setShowWhatsNew} />
</>