From 53071bb69f5d21b35b8a61c2b1dd18832ce781d4 Mon Sep 17 00:00:00 2001 From: Anders Betts Date: Wed, 23 Sep 2026 09:13:17 +0200 Subject: tui: aligned voucher detail, up/down between vouchers, list sorting The detail pads every column by display width, blanks zero amounts and shows row texts and a Summa line. Up/Down step to the previous/next voucher in the list order; 's' cycles the list sort (number or date, ascending or descending, saved in tui.conf). The list fetches all pages of voucher.list instead of stopping at 200. Co-Authored-By: Claude Opus 5.5 --- docs/TUI-GUIDELINES.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'docs/TUI-GUIDELINES.md') diff --git a/docs/TUI-GUIDELINES.md b/docs/TUI-GUIDELINES.md index c791f25..4895c9f 100644 --- a/docs/TUI-GUIDELINES.md +++ b/docs/TUI-GUIDELINES.md @@ -147,6 +147,8 @@ there. | `a` | Add/upload (Underlag) | | `c` | Correct (voucher detail) | | `d` | Delete/arkivera the selected row (only where the action exists; asks for confirmation) | +| `s` | Verifikat list: cycle the sort order — nummer stigande/fallande, datum stigande/fallande (ties by series and number). The title shows the current order; it is saved as `voucher_sort` in `tui.conf` | +| up/down (voucher detail) | Previous/next voucher in the list's current order; the title shows `(n av N)`. The detail scrolls with PgUp/PgDn/Home/End (`TUI_PAGER_NO_ARROWS`). A voucher posted from the detail (`^N`) is shown without stepping until the list is reopened | | `f` | Voucher detail: list the voucher's underlag — Enter opens Granska (text in a pager, PDFs/images in the desktop viewer) or Ladda ned…, `d` removes the link (asks first). Underlag: Enter does the same | | `u` / `b` | Faktura detail: `u` duplicates the invoice into a new draft (same rows, dates reset to today), `b` (unpaid invoices) prefills and posts the payment voucher, then marks the invoice paid | | `Ctrl+F` | Attach a file via the file browser (voucher form and voucher detail) | @@ -367,7 +369,9 @@ only place that touches ncurses. Rules: static storage. `TUI_NAV_NONE`, `TUI_FORM_BACK/REFRESH/SUBMIT` and the `TUI_HOOK_*` codes are all distinct. - `tui_pager_hook` takes `TUI_PAGER_SAVE` to enable the `s` save action; the - `extra_hint` is shown in the footer. Plain `tui_pager` keeps `s` on when a + `extra_hint` is shown in the footer. `TUI_PAGER_NO_ARROWS` leaves Up/Down + to the key hook (record stepping) and the footer says + `PgUp/PgDn/Home/End rullar` instead. Plain `tui_pager` keeps `s` on when a save hint is passed. Pager lines go through `tui_markup` (see below). - Styles come from `tui_style`/`tui_style_attrs`; report markup and menu sections from `tui_markup`/`TUI_MARK_HEADING`. Their fallbacks and the -- cgit v1.3