fix(tui): approval flow + input ergonomics + selection perf

- tui_gateway: route approvals through gateway callback (HERMES_GATEWAY_SESSION/
  HERMES_EXEC_ASK) so dangerous commands emit approval.request instead of
  silently falling through the CLI input() path and auto-denying
- approval UX: dedicated PromptZone between transcript and composer, safer
  defaults (sel=0, numeric quick-picks, no Esc=deny), activity trail line,
  outcome footer under the cost row
- text input: Ctrl+A select-all, real forward Delete, Ctrl+W always consumed
  (fixes Ctrl+Backspace at cursor 0 inserting literal w)
- hermes-ink selection: swap synchronous onRender() for throttled
  scheduleRender() on drag, and only notify React subscribers on presence
  change — no more per-cell paint/subscribe spam
- useConfigSync: silence config.get polling failures instead of surfacing
  'error: timeout: config.get' in the transcript
This commit is contained in:
Brooklyn Nicholson 2026-04-17 10:37:48 -05:00
parent 0219da9626
commit 5b386ced71
15 changed files with 319 additions and 129 deletions

View file

@ -280,7 +280,7 @@ export function useMainApp(gw: GatewayClient) {
sys
})
useConfigSync({ rpc, setBellOnComplete, setVoiceEnabled, sid: ui.sid })
useConfigSync({ gw, setBellOnComplete, setVoiceEnabled, sid: ui.sid })
useEffect(() => {
if (!ui.sid || !stdout) {
@ -516,10 +516,10 @@ export function useMainApp(gw: GatewayClient) {
(choice: string) =>
respondWith('approval.respond', { choice, session_id: ui.sid }, () => {
patchOverlayState({ approval: null })
sys(choice === 'deny' ? 'denied' : `approved (${choice})`)
patchTurnState({ outcome: choice === 'deny' ? 'denied' : `approved (${choice})` })
patchUiState({ status: 'running…' })
}),
[respondWith, sys, ui.sid]
[respondWith, ui.sid]
)
const answerSudo = useCallback(
@ -562,6 +562,7 @@ export function useMainApp(gw: GatewayClient) {
? turn.activity.some(item => item.tone !== 'info')
: Boolean(
ui.busy ||
turn.outcome ||
turn.subagents.length ||
turn.tools.length ||
turn.turnTrail.length ||