summaryrefslogtreecommitdiff
path: root/docs/TUI-GUIDELINES.md
diff options
context:
space:
mode:
authorAnders Betts <anders.betts@gmail.com>2026-09-22 12:43:52 +0200
committerAnders Betts <anders.betts@gmail.com>2026-09-22 12:43:52 +0200
commit07f5b140922d13519ad7a0d1dad67a9b403be9f1 (patch)
treeb6dde2ed6adb90c6423a5e585b693b908637e5ee /docs/TUI-GUIDELINES.md
parent760cb25bd220718e37d8b95016f30cdf8ef6acdc (diff)
downloadbokf-07f5b140922d13519ad7a0d1dad67a9b403be9f1.tar.gz
bokf-07f5b140922d13519ad7a0d1dad67a9b403be9f1.zip
tui: kundutkast, <UTKAST>, explicit Spara och F2-åtgärder
Diffstat (limited to 'docs/TUI-GUIDELINES.md')
-rw-r--r--docs/TUI-GUIDELINES.md35
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