The list page with rows in groups
The list's grouped option
The grouped option of docs/screen-list.md: copy the file below whole in place of that recipe's file (same path, same frame). It is written short: it keeps the search and the row's menu, and leaves out the status filter, the stepper and the peek — put back any of them exactly as docs/screen-list.md writes them. It draws ListPage arrangement="filtered"; the chooser (agent/layout-chooser.md) names the others, the same slots.
grouped: rows under a band per status
One TableGroup per status in the TableBody, in the statuses' own order, its rows inside it: the band names the group (title, with its StatusMark as mark) and counts its rows (count); a click on the band or its caret, or Enter or Space on the caret, folds the rows away. The table keeps each group's fold by its value while it stays on the page, so a search that empties a group and is cleared again finds it folded as it was. A status with no row draws no group.
`tsx grouped // src/screens/issues.tsx: the list page, rows under a band per status import { useState } from 'react'; import { ListPage } from '@/components/goop/patterns/list-page'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '@/components/ui/goop/dropdown-menu'; import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from '@/components/ui/goop/empty'; import { IconButton, IconButtonIcon } from '@/components/ui/goop/icon-button'; import { PageHeader, PageHeaderTitle } from '@/components/ui/goop/page-header'; import { PriorityMark } from '@/components/ui/goop/priority-mark'; import { SearchInput } from '@/components/ui/goop/search-input'; import { StatusMark } from '@/components/ui/goop/status-mark'; import { Table, TableBody, TableGroup, TableHead, TableHeader, TableRow } from '@/components/ui/goop/table'; import { TableCell, TableCellLabel, TableCellPerson } from '@/components/ui/goop/table-cell'; import { ScreenFrame, ScreenTopBar } from './frame';
// ---- the sample data: swap it for yours type Status = 'todo' | 'in-progress' | 'in-review' | 'done'; const STATUS_WORDS: Record<Status, string> = { todo: 'To do', 'in-progress': 'In progress', 'in-review': 'In review', done: 'Done', }; const STATUSES = Object.keys(STATUS_WORDS) as Status[]; interface Issue { id: string; title: string; status: Status; priority: 'urgent' | 'high' | 'medium' | 'low'; assignee: string; /** Points; null for not estimated. */ estimate: number | null; } const ME = 'Teodora Valk'; const ISSUES: Issue[] = [ { id: 'FW-121', title: 'Tags vanish on sync', status: 'in-review', priority: 'urgent', assignee: 'Bilal Rashed', estimate: 3, }, { id: 'FW-117', title: 'Recruit 8 participants', status: 'todo', priority: 'high', assignee: 'Dagny Holm', estimate: 5, }, { id: 'FW-110', title: 'Help page on tags', status: 'in-progress', priority: 'low', assignee: 'Teodora Valk', estimate: 1, }, { id: 'FW-108', title: 'Waveform stutters', status: 'done', priority: 'medium', assignee: 'Ngozi Ilori', estimate: 2, }, ];
export default function IssuesScreen() { const [issues, setIssues] = useState(ISSUES); const [query, setQuery] = useState(''); const found = issues.filter((issue) => ${issue.id} ${issue.title}.toLowerCase().includes(query.trim().toLowerCase()), ); const change = (id: string, next: Partial<Issue>) => setIssues((all) => all.map((issue) => (issue.id === id ? { ...issue, ...next } : issue))); return ( <ScreenFrame current="/issues"> <ListPage arrangement="filtered" header={<ScreenTopBar title="Issues" />} heading={ <PageHeader> <PageHeaderTitle asChild> <h1>Issues</h1> </PageHeaderTitle> </PageHeader> } filters={ <SearchInput label="Search issues" placeholder="Search issues" value={query} onChange={(event) => setQuery(event.currentTarget.value)} /> } collection={ found.length === 0 ? ( <Empty variant="outline"> <EmptyHeader> <EmptyTitle>No issue matches the search.</EmptyTitle> <EmptyDescription>Try other words.</EmptyDescription> </EmptyHeader> </Empty> ) : ( <Table aria-label="Issues" gutter="page" columns={[ 'minmax(160px, 1fr)', { track: '96px', hide: 'narrow' }, { track: '176px', hide: 'narrow' }, '96px', '40px', ]} > <TableHeader> <TableRow> <TableHead> <TableCellLabel>Issue</TableCellLabel> </TableHead> <TableHead> <TableCellLabel>Priority</TableCellLabel> </TableHead> <TableHead> <TableCellLabel>Assignee</TableCellLabel> </TableHead> <TableHead numeric> <TableCellLabel>Estimate</TableCellLabel> </TableHead> <TableHead align="end" aria-label="Actions" /> </TableRow> </TableHeader> <TableBody> {STATUSES.map((status) => { const rows = found.filter((issue) => issue.status === status); if (rows.length === 0) return null; return ( <TableGroup key={status} value={status} title={STATUS_WORDS[status]} count={rows.length} mark={<StatusMark status={status} />} > {rows.map((issue) => ( <TableRow key={issue.id}> <TableCell> <TableCellLabel primary>{issue.title}</TableCellLabel> </TableCell> <TableCell> <PriorityMark priority={issue.priority} label /> </TableCell> <TableCell> <TableCellPerson name={issue.assignee} /> </TableCell> <TableCell numeric> <TableCellLabel>{issue.estimate ?? '–'}</TableCellLabel> </TableCell> <TableCell align="end"> <DropdownMenu> <DropdownMenuTrigger asChild> <IconButton variant="ghost" size="sm" aria-label={Actions for ${issue.id}}> <IconButtonIcon icon="dots" /> </IconButton> </DropdownMenuTrigger> <DropdownMenuContent align="end" aria-label={Actions for ${issue.id}}> <DropdownMenuItem disabled={issue.assignee === ME} onSelect={() => change(issue.id, { assignee: ME })} > Assign to me </DropdownMenuItem> <DropdownMenuItem disabled={issue.status === 'done'} onSelect={() => change(issue.id, { status: 'done' })} > Mark as done </DropdownMenuItem> </DropdownMenuContent> </DropdownMenu> </TableCell> </TableRow> ))} </TableGroup> ); })} </TableBody> </Table> ) } /> </ScreenFrame> ); }