feat(web): CategoryPicker multi-column selector component #13
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The CreateItemPane currently uses a flat
<select>dropdown to pick a category code from the schema's enum values. The redesign calls for a multi-column hierarchical picker (like macOS Finder column view) that makes it easier to browse and select categories when there are many options.Current State
The schema
kindred-rdhas acategorysegment of typeenumwith values likeA001,P001, etc. These are flat key-value pairs (code → description). There is no built-in hierarchy.Approach: Schema-Derived Grouping
Rather than requiring a backend
categoriestable immediately, the picker can group existing enum values by prefix pattern or by a configurable mapping. For the initial implementation:<select>dropdown.categoriestable or hierarchical schema metadata, the picker can render multiple columns.Component:
CategoryPickerFile:
web/src/components/items/CategoryPicker.tsxProps
Flat Mode Layout (Phase 1)
--ctp-basebg,1px solid --ctp-surface1border,0.4remradius0.85remfont--ctp-surface0bgrgba(203,166,247,0.12)),--ctp-mauvetext, weight 600Multi-Column Mode (Phase 2 — future, requires #backend hierarchy)
Three side-by-side columns with sticky headers, column 1 shows groups, column 2 shows subgroups, column 3 shows leaf values. Each column scrolls independently at max 180px height.
Hook:
useCategoriesFile:
web/src/hooks/useCategories.tsFetches
GET /api/schemas/kindred-rdon mount, extracts thecategorysegment'svaluesmap. Caches in a module-level variable to avoid refetching.No Backend Changes Required (Phase 1)
Uses existing
GET /api/schemas/{name}endpoint. The category enum values already contain the data needed for flat mode.Acceptance Criteria
<select>in CreateItemPane