46 lines
2.0 KiB
Markdown
46 lines
2.0 KiB
Markdown
---
|
|
plan: "37-02"
|
|
phase: 37
|
|
status: complete
|
|
completed: "2026-04-19"
|
|
---
|
|
|
|
# Summary: 37-02 — Client — Admin Items List, Edit Page & Sidebar
|
|
|
|
## What Was Built
|
|
|
|
Full client-side implementation of the admin global item management feature: hooks file, list page with infinite scroll, edit page with all fields and delete confirmation, and sidebar activation.
|
|
|
|
## Key Files
|
|
|
|
### Created
|
|
- `src/client/hooks/useAdminGlobalItems.ts` — `useAdminGlobalItems` (infinite query), `useAdminGlobalItem` (detail), `useUpdateAdminGlobalItem`, `useDeleteAdminGlobalItem`
|
|
- `src/client/routes/admin/items.tsx` — List page with data table, infinite scroll, search, tag filters, skeleton loading, empty state
|
|
- `src/client/routes/admin/items.$itemId.tsx` — Edit page with all fields, manufacturer dropdown, TagInput chip component, delete confirmation dialog with ownerCount
|
|
|
|
### Modified
|
|
- `src/client/routes/admin.tsx` — Replaced disabled Items div with active `<Link to="/admin/items">`
|
|
- `src/client/routeTree.gen.ts` — Auto-regenerated with `/admin/items` and `/admin/items/$itemId` routes
|
|
|
|
## Decisions & Deviations
|
|
|
|
- `useTags` hook existed and was used as-is for tag filter chips on list page
|
|
- `useFormatters()` returns `{ weight, price }` — used as `formatWeight`/`formatPrice` aliases in the list page
|
|
|
|
## Test Results
|
|
|
|
- `bun run build`: exits 0
|
|
- routeTree.gen.ts contains both new admin routes confirmed
|
|
|
|
## Self-Check: PASSED
|
|
|
|
- [x] `useAdminGlobalItems.ts` with infinite query, detail, update/delete mutations
|
|
- [x] Sidebar Items link active (Link component, no "Soon" badge, no cursor-not-allowed)
|
|
- [x] List page with table, infinite scroll, search, tag filters, skeleton, empty state
|
|
- [x] Edit page with all fields, manufacturer dropdown, TagInput, save/delete actions
|
|
- [x] Delete confirmation shows ownerCount impact message
|
|
- [x] Navigate to `/admin/items` after successful delete
|
|
- [x] routeTree.gen.ts updated with both routes
|
|
- [x] Build exits 0
|
|
- [x] ADMN-02, ADMN-03, ADMN-04 fully implemented (client side)
|