Add keybindings for cycling TUI permission modes (#39873)

## What changed

- Add unbound `previous_permission_mode` and `next_permission_mode` actions to
  `tui.keymap.chat` so users can configure shortcuts that cycle through the
  available built-in permission modes.
- Apply shortcut selections only to the active session, without writing them
  to `config.toml`, and report update failures in the transcript.
- Exclude modes disallowed by managed requirements or platform safety checks,
  reject printable-key bindings, and ignore these bindings in project config.

## Testing

- Cover mode cycling, unavailable modes, session-only updates, server errors,
  stale threads, keymap validation, and project-config sanitization.

GitOrigin-RevId: c3cfdf1e732b7b7bfe8f53fcac19a37e593bbfab
This commit is contained in:
Eric Traut authored and copyberry committed 2026-08-21 06:19:23 +00:00
1 parent 44e95c857f
commit 2aaefa32b0
32 files changed
+708 -47

No files matched your search

@@ -0,0 +1,6 @@
---
source: tui/src/app/tests/permission_shortcuts_tests.rs
assertion_line: 63
expression: "lines_to_single_string(&cell.display_lines(120)).replace(&missing_thread.to_string(),\n\"<THREAD_ID>\")"
---
■ Failed to update permissions: thread/settings/update failed in TUI: thread/settings/update failed: thread not found: <THREAD_ID> (code -32600)
@@ -0,0 +1,6 @@
---
source: tui/src/app/tests/permission_shortcuts_tests.rs
assertion_line: 33
expression: lines_to_single_string(&cell.display_lines(120))
---
■ Failed to update permissions: this app server does not support confirmed permission changes; use /permissions