You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the book editor, Category is currently a plain free-text input (frontend/src/components/system/BookEditor.jsx, the category field ~line 142). Users have to remember/retype the exact category slug, which is error-prone and makes it easy to create accidental one-off categories via typos.
Request
Turn Category into a combobox / editable dropdown:
Offer the built-in categories as selectable options: core, starter-set, supplement, adventure, handout, character-sheet, map, homebrew (see CATEGORY_ORDER / CATEGORY_LABELS in frontend/src/constants.js), rendered with their friendly labels.
Also include any user-defined categories already in use in the library (e.g. custom category slugs produced by subfolder structure via guess_category / agnostic_category, or previously entered by hand), so the same category can be reused consistently.
Still allow entering a custom category name that is not in the list (free-text), so the current flexibility is preserved.
Source of "existing categories": the frontend can derive the distinct set from the systems books already loaded in SystemDetailView, and/or a small backend endpoint could return distinct Book.category values. Prefer deriving client-side first to avoid a new endpoint unless a global list is needed.
Display friendly labels (CATEGORY_LABELS) but persist the slug; custom entries should be slugified consistently with the backend (slugify in backend/indexer.py) so they match on save.
Keep the free-text affordance obvious (editable/combobox, not a locked <select>).
In the book editor, Category is currently a plain free-text input (
frontend/src/components/system/BookEditor.jsx, thecategoryfield ~line 142). Users have to remember/retype the exact category slug, which is error-prone and makes it easy to create accidental one-off categories via typos.Request
Turn Category into a combobox / editable dropdown:
core,starter-set,supplement,adventure,handout,character-sheet,map,homebrew(seeCATEGORY_ORDER/CATEGORY_LABELSinfrontend/src/constants.js), rendered with their friendly labels.guess_category/agnostic_category, or previously entered by hand), so the same category can be reused consistently.Notes / open questions
SystemDetailView, and/or a small backend endpoint could return distinctBook.categoryvalues. Prefer deriving client-side first to avoid a new endpoint unless a global list is needed.CATEGORY_LABELS) but persist the slug; custom entries should be slugified consistently with the backend (slugifyinbackend/indexer.py) so they match on save.<select>).Affected code
frontend/src/components/system/BookEditor.jsx(category field)frontend/src/constants.js(category list/labels — reuse, do not duplicate)frontend/src/views/SystemDetailView.jsxto pass the set of existing categories down as a prop.Add/extend
BookEditortests for: selecting a default, selecting an existing custom category, and typing a brand-new custom category.