docs: backlog — unit ID rename, descriptions/tooltips, sort order, drag reorder, unsaved-form guard

This commit is contained in:
Falkan
2026-03-17 19:04:52 -04:00
parent 3ff98dff9c
commit b14ae55432

View File

@@ -22,12 +22,42 @@ When creating a unit or group, allow the user to optionally supply their own ID.
- If the user types into the ID field, stop auto-generating and use what they typed.
- Validate: IDs must be unique and slug-safe.
### Admin: allow renaming group IDs
The group edit form currently does not expose the `id` field. Since storage is a flat
JSON file, renaming a group ID is straightforward: update `groups[].id` and rewrite
every `units[].group` reference in the same atomic save. Should also validate the new
ID is unique and kebab-safe before committing.
### Admin: allow renaming unit and group IDs
The edit forms do not currently expose the `id` field for existing units or groups.
- **Units:** straightforward — update `units[].id` and save.
- **Groups:** update `groups[].id` and rewrite every `units[].group` reference in the
same atomic `saveData()` call.
Validate that the new ID is unique and kebab-safe before committing in both cases.
### Admin: tooltips / descriptions for units
Allow users to attach an optional `description` string to each unit. On the front end,
show it as a tooltip when hovering over the unit name or symbol. A single `description`
field is sufficient — no need to distinguish between tooltip text and description text.
Data shape change: add optional `description?: string` to the `Unit` type.
### Admin: group sort order (alphabetical vs. defined)
Per-group setting controlling whether units are displayed on the front end in:
- **Defined order** — the order they appear in `units.json` (current implicit behaviour)
- **Alphabetical order** — sorted by label at render time
Data shape change: add optional `sortOrder?: 'defined' | 'alpha'` to the `Group` type
(default: `'defined'`).
### Admin: drag-to-reorder units within a group
Allow units to be reordered within their group via drag-and-drop in the left panel.
Order is persisted to `units.json`. Only meaningful when the group's `sortOrder` is
`'defined'`.
### Admin: unsaved-form guard on "Add Unit" / "Add Group"
If the user is in the middle of filling out a create/edit form and clicks "+ Add Unit"
or "+ Add Group", the current form should be auto-saved before opening the new one.
If the save fails (e.g. missing required field), highlight the erroring field and block
navigation until it is resolved — don't silently discard the in-progress work.
### Admin: "Delete" action in the bulk actions menu
Add a "Delete" option to the bulk action dropdown so multiple units can be deleted at
once. Should show a confirmation dialog listing the units to be deleted before
committing. Related to the immediate fix below (ungrouped bulk actions).
committing.