diff options
Diffstat (limited to 'docs/TUI-GUIDELINES.md')
| -rw-r--r-- | docs/TUI-GUIDELINES.md | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/docs/TUI-GUIDELINES.md b/docs/TUI-GUIDELINES.md index fbd3b75..1c201aa 100644 --- a/docs/TUI-GUIDELINES.md +++ b/docs/TUI-GUIDELINES.md @@ -5,9 +5,10 @@ copy the behaviour of the voucher list / voucher form; they are the reference implementations. Inspired by Midnight Commander, htop, mutt and calcurse. The **Interaction model** section is the agreed target (settled 2026-09-22, -`DECISIONS.md` #28) and has not been implemented yet. The sections after it -describe today's widget behaviour and stay authoritative until the widget -layer and the screens are migrated; the interaction model wins where they +`DECISIONS.md` #28). The **Kunder** pilot is implemented: drafts in +`$XDG_CACHE_HOME/bokf/drafts.json`, `<UTKAST>` marking, the explicit `Spara` +row, the `F2` action menu and draft deletion work there. Every other screen +still follows the sections below; the interaction model wins where they conflict as each screen moves over. ## Interaction model (target, 2026-09-22) @@ -105,21 +106,21 @@ struct tui_action { commit key (`Ctrl+Enter` is dropped) and `F2` only — no `§` binding (it is not reliably encodable across terminals). -### Deltas to implement +### Implementation status -1. `struct tui_action` + `tui_action_menu()` in `clients/tui.[ch]` - (`tui_form_action` is generalized); the pure ordering/dimming/hint logic - is unit-tested in `tests/test_tui.c`. -2. Action lists on `tui_select_list` and `tui_rt`, replacing the per-screen - key branches; hints and dispatch read the same list. -3. `clients/drafts.[ch]`: JSON store, atomic write, dirty tracking, - temporary ids, `<UTKAST>` marking and the delete action. -4. Registers get the draft/`Spara` model first — pilot on **Kunder** — then - the other register screens; settings drop their per-field autosave and - get a `Spara` row. -5. pty scenarios: a new empty entity is a visible `<UTKAST>`; fill + `Spara` - commits and clears it; delete from the list and from the editor; a draft - survives `Ctrl+R`. +1. Done: `struct tui_action`, `tui_action_menu()` and `tui_action_hint()` in + `clients/tui.[ch]`, unit-tested in `tests/test_tui.c`. +2. Partly done: the Kunder list builds its `F2` actions in a key hook and + appends `F2 = åtgärder` to the footer via `tui_list_hint_extra()`; other + lists have no actions yet, and `tui_rt` still uses its own key branches. +3. Done for Kunder: `clients/drafts.[ch]` (JSON store, atomic 0600 write, + temporary ids, `<UTKAST>` marking, delete action), unit-tested. +4. Done for Kunder: draft/`Spara` model with the `Spara` action row, + `F2` menu and draft deletion from both the list and the editor. The + other register screens and the settings forms (explicit `Spara`, no + per-field autosave) are next. +5. Done for Kunder: pty scenarios `customer-draft` and + `customer-draft-save` cover create, edit, `<UTKAST>`, delete and save. ## Session start |
