From 71a702f375750829c634b552217c9925d549828b Mon Sep 17 00:00:00 2001 From: Anders Betts Date: Wed, 23 Sep 2026 10:58:17 +0200 Subject: tui: context menu on → / ^O; no F-keys, ^N or ^Enter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit → (where no caret uses it) and ^O (everywhere, also in table cells) open "Åtgärder": a box at the right edge with every action of the view and its key. Screens declare their actions with tui_set_actions(); choosing one feeds its key to the widget, so the menu and accelerators share one path. Function keys, Ctrl+N (now n), Ctrl+Enter and Ctrl+F are gone and no extended keyboard protocol is enabled, so the TUI works in a browser terminal; save/post/validate/preview/template/attach are menu actions. make check rejects F-keys, ^N and ^Enter in clients/. Co-Authored-By: Claude Opus 5.5 --- docs/STATE.md | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'docs/STATE.md') diff --git a/docs/STATE.md b/docs/STATE.md index 4dcbb35..77ef9a4 100644 --- a/docs/STATE.md +++ b/docs/STATE.md @@ -14,6 +14,18 @@ unit tests and the docs consistency check. ## Resume here (2026-09-23) +- **Context menu and web-safe keys (2026-09-23, branch + `eff/context-menu`)**: `→` (or `^O`, also in table cells) opens + "Åtgärder", a box at the right edge with every action of the view and + its key; every screen declares its actions (`tui_set_actions`). All + F-keys, `Ctrl+N` (now `n`), `Ctrl+Enter` and `Ctrl+F` are gone, and the + extended keyboard protocols are no longer enabled, so the TUI can run in + a browser terminal; `make check` rejects F-keys/`^N`/`^Enter` in + `clients/`. Save/post/validate/preview/template/attach in forms are menu + actions. Decision #29; spec in TUI-GUIDELINES.md "Actions and the context + menu" and "Keys and the web". Next for the web: an upload/download path + through the browser instead of the local file browser, and per-user + isolation of the TUI processes. - **Byt lösenord (2026-09-23, deployed in `v0.1.68`)**: new command `user.set_password` (own password, password session only, current password required and rate limited like logins, ≥ 10 characters, other sessions closed, audited without secrets) and a @@ -254,8 +266,8 @@ Original entries for the struck items are in `docs/DECISIONS.md`. Drive the TUI over a pty with `scripts/tui-sandbox.sh -- ./build/bokftui --socket /tmp/opencode/bokf-local/sock --org 1 --fy 1 ...` plus a small driver that feeds keys and an ANSI renderer (recreate if gone; arrows are - `ESC O B/A`, Tab `\t`, `^X` `\x18`, `^Enter` `ESC[27;5;13~`, F5 - `ESC[15~`). Never test against the live daemon. + `ESC O B/A`, Tab `\t`, `^X` `\x18`, `^O` `\x0f` for the context + menu). Never test against the live daemon. - Demo: db `~/bokf-demo/bokfd.db`, socket `~/bokf-demo/bokfd.sock`, @@ -271,18 +283,20 @@ Original entries for the struck items are in `docs/DECISIONS.md`. (schema v1, old binary) — recreate or migrate it with the current build if it is still wanted. - TUI smoke tests: drive over a pty with `script -qec`; function-key escape - sequences are timing-sensitive there (not an app bug). Arrows arrive as - application-mode sequences (`ESC O B` for Down), not `ESC [ B`, because - curses enables the keypad. `Ctrl+N/C/F` are single bytes and reliable. + sequences are timing-sensitive there (not an app bug; the TUI no longer + uses them). Arrows arrive as application-mode sequences (`ESC O B` for + Down), not `ESC [ B`, because curses enables the keypad. `^O`/`^X`/`^C` + are single bytes and reliable. Always wrap the run in `scripts/tui-sandbox.sh -- ./build/bokftui ...`: it isolates `XDG_CONFIG_HOME`/`XDG_CACHE_HOME` so a test can never overwrite the real `~/.config/bokf/tui.conf` or `~/.cache/bokf/tui.log`. ## Known caveats -- Saving with Ctrl+Enter needs a terminal that speaks xterm - `modifyOtherKeys` level 2 or the Kitty keyboard protocol; gnome-terminal/VTE - sends neither, so the hints advertise `F9`, which works everywhere. +- The TUI enables no extended keyboard protocol (no xterm + `modifyOtherKeys`, no Kitty protocol) and uses no function keys; saving + and posting are context-menu actions, which work in every terminal and + in a browser terminal. - Developer tooling: the `g_cmd_[]` tables in `src/cmd_*.c` carry declarative argument schemas (`CMD_ARGS`); `describe` emits them and the -- cgit v1.3