A person's page, their profile beside their work
The record's profile option
The profile option of docs/screen-record.md, for a record that is a person (a teammate, a client, a patient): not in place of the record's page, a page of its own beside it (src/screens/person.tsx, its route /people, a person's /people/<id>, the same frame). It draws RecordPage arrangement="profile"; the chooser (agent/layout-chooser.md) names the others, the same slots. By hand: copy the file below whole, then add the two lines of the app block to App.tsx (its import beside the screens', its route after the last) and the frame block's row to the frame's NAVIGATION (docs/screen-frame.md), before Settings. node goop/agent/start.mjs record:profile does all three.
profile: the person in a panel at the start, their work beside it
The profile panel at the page's start holds the person: their avatar (titleMedia), their name as the heading and their facts as read-only Properties rows (role, team, email, time zone, since when), each with its icon. Beside it, their work in an outline Card whose CardList holds an Item a record, its status mark first (the mark alone, named by its status's words) and the whole row a link to that record's page (ItemOverlay), and their teammates in a second card, each row a link to that person's page. The person shown is the route's (/people/<id>, read with useRoute), the first one at /people; a teammate's row moves to theirs and the back button returns. On a phone the panel stands over the work; light, dark, phone and desktop are the parts' own: add no class for them. Swap the sample people and work for yours, read from your store.
`tsx profile // src/screens/person.tsx: a person's page, their profile at the start and their work beside it import { RecordPage } from '@/components/goop/patterns/record-page'; import { pageRoles } from '@/components/goop/patterns/page-body'; import { Avatar, AvatarFallback } from '@/components/ui/goop/avatar'; import { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbList } from '@/components/ui/goop/breadcrumb'; import { Card, CardHeader, CardTitle } from '@/components/ui/goop/card'; import { CardList } from '@/components/ui/goop/card-list'; import { Item, ItemContent, ItemDescription, ItemMedia, ItemOverlay, ItemTitle, } from '@/components/ui/goop/item'; import { Properties, PropertyRow } from '@/components/ui/goop/properties'; import { type StatusKind, StatusMark } from '@/components/ui/goop/status-mark'; import { ScreenFrame, ScreenTopBar } from './frame'; import { hrefOf, useRoute } from './router';
// ---- the sample data: swap it for yours type Status = Extract<StatusKind, 'todo' | 'in-progress' | 'in-review' | 'done'>; interface Person { id: string; name: string; initials: string; role: string; team: string; email: string; timeZone: string; since: string; } const PEOPLE: Person[] = [ { id: 'teodora', name: 'Teodora Valk', initials: 'TV', role: 'Design lead', team: 'Research', email: 'teodora.valk@fieldwork.test', timeZone: 'Amsterdam', since: 'March 2024', }, { id: 'bilal', name: 'Bilal Rashed', initials: 'BR', role: 'Engineer', team: 'Platform', email: 'bilal.rashed@fieldwork.test', timeZone: 'Lisbon', since: 'June 2024', }, { id: 'dagny', name: 'Dagny Holm', initials: 'DH', role: 'Researcher', team: 'Research', email: 'dagny.holm@fieldwork.test', timeZone: 'Oslo', since: 'January 2025', }, ]; const WORK: { id: string; title: string; status: Status; person: string }[] = [ { id: 'FW-110', title: 'Help page on tags', status: 'in-progress', person: 'teodora' }, { id: 'FW-104', title: 'Interview notes template', status: 'in-review', person: 'teodora' }, { id: 'FW-098', title: 'Study cards on the board', status: 'done', person: 'teodora' }, { id: 'FW-121', title: 'Tags vanish on sync', status: 'in-review', person: 'bilal' }, { id: 'FW-115', title: 'Faster transcript search', status: 'todo', person: 'bilal' }, { id: 'FW-117', title: 'Recruit 8 participants', status: 'todo', person: 'dagny' }, ];
// ---- the page export default function PersonScreen() { // the person in the route (/people/<id>); the first at /people const id = useRoute().split('/')[2]; const person = PEOPLE.find((one) => one.id === id) ?? (PEOPLE[0] as Person); const theirs = WORK.filter((one) => one.person === person.id); const open = theirs.filter((one) => one.status !== 'done').length; return ( <ScreenFrame> <RecordPage arrangement="profile" header={<ScreenTopBar title={person.name} />} trail={ <Breadcrumb> <BreadcrumbList> <BreadcrumbItem> <BreadcrumbLink href={hrefOf('/people')}>Team</BreadcrumbLink> </BreadcrumbItem> </BreadcrumbList> </Breadcrumb> } titleMedia={ <Avatar variant="solid" size="lg" name={person.name} aria-hidden="true"> <AvatarFallback>{person.initials}</AvatarFallback> </Avatar> } title={person.name} properties={ <Properties aria-label="About them"> <PropertyRow label="Role" icon="user"> {person.role} </PropertyRow> <PropertyRow label="Team" icon="users"> {person.team} </PropertyRow> <PropertyRow label="Email" icon="mail"> {person.email} </PropertyRow> <PropertyRow label="Time zone" icon="clock"> {person.timeZone} </PropertyRow> <PropertyRow label="Since" icon="calendar"> {person.since} </PropertyRow> </Properties> } body={ <div className={flex flex-col ${pageRoles.block}}> <Card variant="outline"> <CardHeader> <CardTitle asChild> <h2>{Their work, ${open} open}</h2> </CardTitle> </CardHeader> <CardList aria-label="Their work" empty={{ title: 'Nothing assigned yet' }}> {theirs.map((one) => ( <Item key={one.id} asChild> <li> <ItemOverlay asChild> <a href={hrefOf(/issues/${one.id})} aria-labelledby={${one.id}-work} /> </ItemOverlay> <ItemMedia> <StatusMark status={one.status} /> </ItemMedia> <ItemContent> <ItemTitle id={${one.id}-work}>{one.title}</ItemTitle> <ItemDescription>{one.id}</ItemDescription> </ItemContent> </li> </Item> ))} </CardList> </Card> <Card variant="outline"> <CardHeader> <CardTitle asChild> <h2>Teammates</h2> </CardTitle> </CardHeader> <CardList aria-label="Teammates"> {PEOPLE.filter((one) => one.id !== person.id).map((one) => ( <Item key={one.id} asChild> <li> <ItemOverlay asChild> <a href={hrefOf(/people/${one.id})} aria-labelledby={${one.id}-person} /> </ItemOverlay> <ItemMedia> <Avatar variant="solid" size="3xs" name={one.name} aria-hidden="true"> <AvatarFallback>{one.initials}</AvatarFallback> </Avatar> </ItemMedia> <ItemContent> <ItemTitle id={${one.id}-person}>{one.name}</ItemTitle> <ItemDescription>{${one.role}, ${one.team}}</ItemDescription> </ItemContent> </li> </Item> ))} </CardList> </Card> </div> } /> </ScreenFrame> ); }
```tsx app
import PersonScreen from './screens/person';
if (page === 'people') return <PersonScreen />;`tsx frame { words: 'Team', path: '/people', icon: 'users' },