diff --git a/AGENTS.md b/AGENTS.md index bd2fc0b..fc7433b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -67,7 +67,7 @@ next-explorer/ - `RegisterDetail.tsx`: Client Component that renders a single register’s details, including modes, notes, and source modal. - `[hex]/page.tsx`: Dynamic route that renders details for a specific register by hex address. - `src/app/zxdb/`: ZXDB Explorer routes and client components. - - `page.tsx` + `ZxdbExplorer.tsx`: Search + filters with server-rendered initial content and ISR. + - `page.tsx`: ZXDB hub page linking to entries, releases, labels, etc. - `entries/[id]/page.tsx` + `EntryDetail.tsx`: Entry details (SSR initial data). - `releases/page.tsx` + `ReleasesExplorer.tsx`: Releases search + filters. - `labels/page.tsx`, `labels/[id]/page.tsx` + client: Labels search and detail. @@ -108,6 +108,25 @@ Comment what the code does, not what the agent has done. The documentation's pur - Use `type` for interfaces. - No `enum`. +### UI / Bootstrap Patterns + +The project uses the **Bootswatch Pulse** theme (purple primary) with `react-bootstrap` and `react-bootstrap-icons`. + +- **Always use react-bootstrap components** over raw HTML+className for Bootstrap elements: + - `Card`, `Table`, `Badge`, `Button`, `Alert`, `Form.Control`, `Form.Select`, `Form.Check`, `InputGroup`, `Spinner`, `Collapse` etc. + - Icons from `react-bootstrap-icons` (e.g. `Search`, `ChevronDown`, `Download`, `BoxArrowUpRight`). +- **Match existing patterns** — see `RegisterBrowser.tsx` and `Navbar.tsx` for canonical react-bootstrap usage. +- **Shared explorer components** in `src/components/explorer/`: + - `ExplorerLayout` — two-column layout (sidebar + content). + - `FilterSidebar` — `Card` wrapper with optional "Reset all filters" button. + - `FilterSection` — collapsible filter group with label, badge, and `Collapse` animation. + - `MultiSelectChips` — chip-toggle selector with optional collapsed summary mode. + - `Pagination` — prev/next with page counter and loading spinner. +- **Stale-while-revalidate pattern** — show previous results at reduced opacity during loading (`className={loading ? "opacity-50" : ""}`), never blank the screen. +- **Empty states** — only show a section/card if it has data. Do not render empty cards with "No X recorded" placeholders; omit them entirely. +- **Tables** — use react-bootstrap `
| ID | -Title | -Machine | -Language | -
|---|---|---|---|
| {it.id} | -- {it.title} - | -- {it.machinetypeId != null ? ( - it.machinetypeName ? ( - {it.machinetypeName} - ) : ( - {it.machinetypeId} - ) - ) : ( - - - )} - | -- {it.languageId ? ( - it.languageName ? ( - {it.languageName} - ) : ( - {it.languageId} - ) - ) : ( - - - )} - | -