Skip to content

Commit 0179758

Browse files
heyoubclaude
authored andcommitted
fix(web): render the breadcrumb trails app-shell.md prescribes
specs/behaviors/app-shell.md carries a table of exact breadcrumb trails, and Breadcrumbs.tsx already implements them correctly — nav[aria-label], an ordered list, aria-current on the last crumb. Nothing ever imported it, so every trail in that table was spec-only. This is code brought into conformance with a spec that has not moved. Placed as a sibling above each screen's content container rather than inside it: the component supplies its own `container mx-auto px-4`, which only lands correctly as a direct child of <main> — nesting it would double the gutter. No specs/screens/*.md mentions breadcrumbs, so app-shell.md is the sole authority and there is nothing to reconcile. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 5fc51f7 commit 0179758

5 files changed

Lines changed: 42 additions & 0 deletions

File tree

‎apps/web/src/screens/Account.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { toast } from 'sonner';
55
import { Button } from '@/components/ui/button';
66
import { Checkbox } from '@/components/ui/checkbox';
77
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
8+
import { Breadcrumbs } from '@/components/Breadcrumbs';
89
import {
910
Dialog,
1011
DialogContent,
@@ -154,6 +155,9 @@ export function Account() {
154155
const sessions = sessionsQ.data?.data ?? [];
155156

156157
return (
158+
<>
159+
{/* specs/behaviors/app-shell.md → Breadcrumbs: Settings */}
160+
<Breadcrumbs items={[{ label: 'Settings' }]} />
157161
<div className="container mx-auto px-4 py-8 max-w-3xl space-y-6">
158162
<h1 className="text-2xl font-bold">Account Settings</h1>
159163

@@ -373,5 +377,6 @@ export function Account() {
373377
</CardContent>
374378
</Card>
375379
</div>
380+
</>
376381
);
377382
}

‎apps/web/src/screens/PersonDetail.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
DialogHeader,
1313
DialogTitle,
1414
} from '@/components/ui/dialog';
15+
import { Breadcrumbs } from '@/components/Breadcrumbs';
1516
import { MarkdownView } from '@/components/MarkdownView';
1617
import { StageBadge } from '@/components/StageBadge';
1718
import { TagChip } from '@/components/TagChip';
@@ -103,6 +104,9 @@ export function PersonDetail() {
103104
});
104105

105106
return (
107+
<>
108+
{/* specs/behaviors/app-shell.md → Breadcrumbs: Members › <fullName> */}
109+
<Breadcrumbs items={[{ label: 'Members', href: '/members' }, { label: person.fullName }]} />
106110
<div className="container mx-auto px-4 py-8 grid grid-cols-1 lg:grid-cols-3 gap-8">
107111
<div className="lg:col-span-2 space-y-8">
108112
<header className="flex items-start gap-6">
@@ -338,5 +342,6 @@ export function PersonDetail() {
338342
)}
339343
</aside>
340344
</div>
345+
</>
341346
);
342347
}

‎apps/web/src/screens/ProjectDetail.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
DialogDescription,
1818
DialogFooter,
1919
} from '@/components/ui/dialog';
20+
import { Breadcrumbs } from '@/components/Breadcrumbs';
2021
import { MarkdownView } from '@/components/MarkdownView';
2122
import { StageProgressBar, StageBadge } from '@/components/StageBadge';
2223
import { StageInfoDialog } from '@/components/StageInfoDialog';
@@ -187,6 +188,9 @@ export function ProjectDetail({ anchor }: ProjectDetailProps = {}) {
187188
const allTags = [...project.tags.tech, ...project.tags.topic, ...project.tags.event];
188189

189190
return (
191+
<>
192+
{/* specs/behaviors/app-shell.md → Breadcrumbs: Projects › <title> */}
193+
<Breadcrumbs items={[{ label: 'Projects', href: '/projects' }, { label: project.title }]} />
190194
<div className="container mx-auto px-4 py-8">
191195
{/* Soft-delete banner — staff only (project-detail.md) */}
192196
{showDeletedBanner && (
@@ -678,5 +682,6 @@ export function ProjectDetail({ anchor }: ProjectDetailProps = {}) {
678682
</DialogContent>
679683
</Dialog>
680684
</div>
685+
</>
681686
);
682687
}

‎apps/web/src/screens/ProjectEdit.tsx‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
SelectValue,
1414
} from '@/components/ui/select';
1515
import { Checkbox } from '@/components/ui/checkbox';
16+
import { Breadcrumbs } from '@/components/Breadcrumbs';
1617
import { MarkdownEditor } from '@/components/MarkdownEditor';
1718
import { TagPicker } from '@/components/TagPicker';
1819
import { STAGES, type Stage } from '@/components/StageBadge';
@@ -268,6 +269,20 @@ export function ProjectEdit({ mode }: ProjectEditProps) {
268269
: '';
269270

270271
return (
272+
<>
273+
{/* specs/behaviors/app-shell.md → Breadcrumbs:
274+
create → Projects › New project; edit → Projects › <title> › Edit */}
275+
<Breadcrumbs
276+
items={
277+
mode === 'create'
278+
? [{ label: 'Projects', href: '/projects' }, { label: 'New project' }]
279+
: [
280+
{ label: 'Projects', href: '/projects' },
281+
{ label: project?.title ?? '', href: `/projects/${project?.slug ?? ''}` },
282+
{ label: 'Edit' },
283+
]
284+
}
285+
/>
271286
<div className="container mx-auto px-4 py-8 max-w-3xl">
272287
<header className="flex items-center justify-between mb-6">
273288
<h1 className="text-2xl font-bold">
@@ -503,5 +518,6 @@ export function ProjectEdit({ mode }: ProjectEditProps) {
503518
)}
504519
</form>
505520
</div>
521+
</>
506522
);
507523
}

‎apps/web/src/screens/TagDetail.tsx‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Link, useNavigate, useParams } from 'react-router';
33
import { useQuery, useQueryClient } from '@tanstack/react-query';
44
import { toast } from 'sonner';
55
import { Button } from '@/components/ui/button';
6+
import { Breadcrumbs } from '@/components/Breadcrumbs';
67
import { ProjectCard } from '@/components/ProjectCard';
78
import { PersonCard } from '@/components/PersonCard';
89
import { HelpWantedCard } from '@/components/HelpWantedCard';
@@ -102,6 +103,15 @@ export function TagDetail() {
102103
};
103104

104105
return (
106+
<>
107+
{/* specs/behaviors/app-shell.md → Breadcrumbs: Tags › <namespace> › <title> */}
108+
<Breadcrumbs
109+
items={[
110+
{ label: 'Tags', href: '/tags' },
111+
{ label: tag.namespace, href: `/tags/${tag.namespace}` },
112+
{ label: tag.title },
113+
]}
114+
/>
105115
<div className="container mx-auto px-4 py-8 space-y-10">
106116
<header className="flex items-start justify-between gap-3">
107117
<div>
@@ -224,5 +234,6 @@ export function TagDetail() {
224234
</section>
225235
)}
226236
</div>
237+
</>
227238
);
228239
}

0 commit comments

Comments
 (0)