From 83efea661f83519921556fc9945388118f04a154 Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Wed, 22 Apr 2026 16:48:03 -0500 Subject: [PATCH] fix(tui): address copilot round 3 on #14145 - appLayout.tsx: restore the 1-row placeholder when `showStickyPrompt` is false. Dropping it saved a row but the composer height shifted by one as the prompt appeared/disappeared, jumping the input vertically on scroll. - useInputHandlers: gateway.rpc (from useMainApp) already catches errors with its own sys() message and resolves to null. The previous `.catch` was dead code and on RPC failures the user saw both 'error: ...' (from rpc) and 'failed to toggle yolo'. Drop the catch and gate 'failed to toggle yolo' on a non-null response so null (= rpc already spoke) stays silent. --- ui-tui/src/app/useInputHandlers.ts | 19 +++++++++++++++---- ui-tui/src/components/appLayout.tsx | 4 +++- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ui-tui/src/app/useInputHandlers.ts b/ui-tui/src/app/useInputHandlers.ts index 211eb8396..72cd5b9e5 100644 --- a/ui-tui/src/app/useInputHandlers.ts +++ b/ui-tui/src/app/useInputHandlers.ts @@ -384,10 +384,21 @@ export function useInputHandlers(ctx: InputHandlerContext): InputHandlerResult { return void actions.sys('yolo needs an active session') } - return void gateway - .rpc('config.set', { key: 'yolo', session_id: live.sid }) - .then(r => actions.sys(r?.value === '1' ? 'yolo on' : r?.value === '0' ? 'yolo off' : 'failed to toggle yolo')) - .catch(() => actions.sys('failed to toggle yolo')) + // gateway.rpc swallows errors with its own sys() message and resolves to null, + // so we only speak when it came back with a real shape. null = rpc already spoke. + return void gateway.rpc('config.set', { key: 'yolo', session_id: live.sid }).then(r => { + if (r?.value === '1') { + return actions.sys('yolo on') + } + + if (r?.value === '0') { + return actions.sys('yolo off') + } + + if (r) { + actions.sys('failed to toggle yolo') + } + }) } if (key.tab && cState.completions.length) { diff --git a/ui-tui/src/components/appLayout.tsx b/ui-tui/src/components/appLayout.tsx index c96960ac8..cdac992d3 100644 --- a/ui-tui/src/components/appLayout.tsx +++ b/ui-tui/src/components/appLayout.tsx @@ -173,12 +173,14 @@ const ComposerPane = memo(function ComposerPane({ )} - {status.showStickyPrompt && ( + {status.showStickyPrompt ? ( {status.stickyPrompt} + ) : ( + )}