Design system / Molecules
Molecule / Navigation
RoundListItem
RoundListItem renders one round's destination, current-page state, status and reviewer count. Editing reveals a sortable handle. The surrounding collection owns sensors, reorder commands, persistence and errors.
Live example
Current component with fictional data. Example changes are not persisted.
Enable reordering to reveal the actual drag handles, then use dragging or Space and arrow keys. Order stays in memory; links return to this documentation. The product also starts in read-only navigation mode.
Responsibility
Round identity, status and destination form one row contract. Management enables the sortable handle; the collection supplies pointer/keyboard sensors and persistence. RoundNavigation coordinates that collection and creation workflow as an organism.
Public contract
The table describes supported inputs, exported parts and caller responsibilities. A callback supplies a command, such as saving a draft. These notes are maintained manually; check current source types before integration.
| Prop / part | Type | Requirement | Responsibility |
|---|---|---|---|
| round | RoundData | Required | Provides id, name, status and reviewers for rendering and sortable identity. |
| href | string | Required | Consumer supplies route destination. |
| isActive | boolean | Required | Active styling and aria-current=page. |
| editing | boolean | Required | Shows the drag handle and enables the row's sortable behavior. False keeps ordinary navigation available without reordering. |
| compact / number | boolean / number | Optional | Compact links can show their number with an accessible full name. The workspace uses RoundTabs for ordinary left-side navigation at every viewport; full-name management rows remain secondary. |
API notes are curated documentation, not generated types. The source linked above is the current implementation; update these notes alongside API changes.
State and behavior
Identify which values the caller controls and which behavior the component or underlying primitive owns. A local example does not supply persistence, authorization or a complete product lifecycle.
Uses SortableRoundItem’s handle with disabled={!editing}. RoundNavigation owns local management mode, initially false, and receives state/commands directly from the workspace. The list supplies pointer/keyboard sensors in a vertical arrangement on every viewport. The row does not persist order or authorize navigation.
Dependencies
- SortableRoundItem and dnd-kit sortable Context
- Next Link
- Lucide GripVertical
- RoundData
- cn()
Token and styling contract
These notes identify theme roles, utilities and direct style values used by the source. Direct colors or timings are implementation exceptions, not recommendations to bypass the theme.
border-primary/50 / bg-primary/5- Active row styling.
bg-primary/10 / text-primary- Semantic active-round treatment; other status uses muted roles.
text-label / text-supporting / text-eyebrow- Fluid semantic title, count and status typography.
Boundaries and limitations
- Requires the surrounding sortable setup for meaningful drag behavior.
- No disabled, onReorder, saving or error props on RoundListItem. The underlying sortable abstractions have separate disabled props.
- Compact navigation requires a supplied number. Names remain available through accessible labels and titles; this is not a permission or unlock control.
Where to make a change
Change row anatomy here, collection sensors in sortableRoundList.tsx and persistence in the owning behavior hook. Do not copy the sidebar or create a feature Context to reuse one row.
Selected real uses
RoundNavigation
Uses numbered RoundTabs to the left of the review card at every viewport. Full accessible names retain round identity. The compact management cog sits at the rail's bottom and retains the accessible name Manage Review Rounds. It reveals a separate full-width management area with Add and drag handles. It supplies editing to rows and disables SortableRoundList when closed. Closing keeps creation drafts mounted; creation and collection errors stay outside the row.
Repository path: src/app/(tenants)/console/[tenantCode]/admin/programs/[programCode]/editions/[editionCode]/review-rounds/components/roundNavigation.tsx
These traces describe selected uses, not every dependency. Repository-only paths are shown as references; only approved files have public source views.
Usage contract
import { SortableRoundList } from "@/components/review-rounds/sortableRoundList";
import { RoundListItem } from "./roundListItem";
// The caller owns editing; compact numbered links retain full accessible names.
<SortableRoundList ids={rounds.map(r => r.id)} onReorder={handleReorder} disabled={!editing}>
{rounds.map((round, index) => <RoundListItem key={round.id} round={round}
href={roundHref(round)} number={index + 1} compact={compact}
isActive={round.id === activeId} editing={editing} />)}
</SortableRoundList>Illustrative consumer bindings, not a self-contained product workflow. Live examples supply only local state or explicit fictional props.