feat(registers): deep‑linkable search via ?q=; docs: add docs/ and update README

- Register Explorer:
  - Sync search input with URL query param `q` for shareable deep links
  - Initialize search from `q` on load; update URL on input; remove `q` when cleared
  - Implemented with Next.js `useSearchParams`, `useRouter`, `usePathname`
  - File: src/app/registers/RegisterBrowser.tsx

- Documentation:
  - Add docs/ hub and initial guides
    - docs/index.md (docs index)
    - docs/getting-started.md (install/dev/build/start/lint/deploy)
    - docs/architecture.md (structure, theming, styling, key paths, scripts)
    - docs/registers.md (Register Explorer overview, search, deep links, implementation notes)
  - Rewrite README.md with project overview, features, quick start, scripts, and links to docs

Notes:
- Dev server uses port 4000 (Turbopack) via package.json
- Example deep link: /registers?q=vram

Date: 2025-12-11 13:11 (Junie@lucy.xalior.com)
This commit is contained in:
2025-12-11 13:11:56 +00:00
parent ea90d72252
commit 417fd997a7
5 changed files with 119 additions and 30 deletions

20
docs/registers.md Normal file
View File

@@ -0,0 +1,20 @@
Register Explorer
Overview
The Register Explorer lets you browse and search Spectrum Next registers parsed from `data/nextreg.txt`. Each register page shows address, access details, bit tables, and notes.
Searching
- Use the search input to filter registers in real time.
- The query is caseinsensitive and matches a combined `search` field per register (name, address, and keywords).
Deep links (query string)
- The search box syncs with the `q` query parameter so searches are shareable.
- Example: `/registers?q=vram`
- When you open this URL, the search box is prefilled with `vram` and the list is filtered immediately.
- Clearing the search removes `q` from the URL.
Implementation notes
- Component: `src/app/registers/RegisterBrowser.tsx`
- Uses Next.js navigation hooks: `useSearchParams`, `useRouter`, `usePathname`.
- On mount and when the URL changes, the component reads `q` and updates local state.
- On input change, the component updates state and calls `router.replace()` to keep the URL in sync without scrolling.