Skip to content

Commit 359f611

Browse files
big-guyclaude
andcommitted
refactor(shell): address review feedback on background-shell wording
- Replace hardcoded `italic` tab styling with a semantic `tab-unviewed` Tailwind utility (styles.css) so the intent — an unviewed tab — is named. - Reword the auto-close prompt buttons: "Keep open" -> "Do not close", "Close when done" -> "Close if successful" (and matching comments). - Tighten the create_shell MCP `background` and `close_delay` arg descriptions in mcp-bridge.js. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent bf7bbd5 commit 359f611

4 files changed

Lines changed: 15 additions & 8 deletions

File tree

resources/mcp-bridge.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,12 +372,12 @@ const TOOLS = [
372372
background: {
373373
type: 'boolean',
374374
description:
375-
'When true, the tab is created without switching the UI to it, and its title renders italic until selected. Use for commands you want to run without interrupting the user. Defaults to false.'
375+
'When true, the tab is created in the background. Use for commands you want to run without interrupting the user. Defaults to false.'
376376
},
377377
close_delay: {
378378
type: 'number',
379379
description:
380-
'Seconds (integer >= 0) to wait after the command finishes successfully before auto-closing the tab. 0 closes immediately on success. Failed commands never auto-close, and a tab the user is actively viewing will not close. Defaults to 30.'
380+
'Seconds (integer >= 0) to wait after the command finishes successfully before closing the tab. 0 closes immediately on success. Defaults to 30.'
381381
}
382382
}
383383
}

src/renderer/components/TerminalPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ function SortableTab({ tab, isActive, status, shellActivity, showClose, onSelect
314314
aria-label="Rename tab"
315315
/>
316316
) : (
317-
<span className={tab.background ? 'italic' : undefined}>{displayLabel}</span>
317+
<span className={tab.background ? 'tab-unviewed' : undefined}>{displayLabel}</span>
318318
)}
319319
<TabProgressBar terminalId={tab.id} />
320320
{showClose && (

src/renderer/components/XTerminal.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ interface XTerminalProps {
254254
/** Shell tabs only: auto-close delay in seconds, or undefined when not
255255
* armed. When set, an overlay banner offers to keep the tab open. */
256256
shellCloseDelay?: number
257-
/** Disarm the shell tab's auto-close (the "Keep open" action). */
257+
/** Disarm the shell tab's auto-close (the "Do not close" action). */
258258
onKeepOpen?: () => void
259259
onRestartAgent?: () => void
260260
/** When provided AND this is a Claude agent tab, an overlay chip in
@@ -270,8 +270,9 @@ export function XTerminal({ terminalId, cwd, type, agentKind, visible, sessionNa
270270
const backend = useBackend()
271271
const chatPromotionDismissed = useSettings().chatPromotionDismissed
272272
const [exited, setExited] = useState(false)
273-
// Local-only: hides the auto-close prompt after "Close when done" without
274-
// disarming the behavior. "Keep open" instead clears closeDelay in state.
273+
// Local-only: hides the auto-close prompt after "Close if successful"
274+
// without disarming the behavior. "Do not close" instead clears closeDelay
275+
// in state.
275276
const [closePromptDismissed, setClosePromptDismissed] = useState(false)
276277
const containerRef = useRef<HTMLDivElement>(null)
277278
const terminalRef = useRef<Terminal | null>(null)
@@ -914,14 +915,14 @@ export function XTerminal({ terminalId, cwd, type, agentKind, visible, sessionNa
914915
onClick={() => { onKeepOpen(); setClosePromptDismissed(true) }}
915916
className="flex items-center gap-1.5 px-2 py-1 rounded-md text-xs bg-panel/90 border border-border text-fg-bright hover:bg-border transition-colors"
916917
>
917-
<span>Keep open</span>
918+
<span>Do not close</span>
918919
</button>
919920
</Tooltip>
920921
<button
921922
onClick={() => setClosePromptDismissed(true)}
922923
className="px-2 py-1 rounded-md text-xs bg-panel/90 border border-border text-dim hover:text-fg-bright transition-colors"
923924
>
924-
Close when done
925+
Close if successful
925926
</button>
926927
</div>
927928
)}

src/renderer/styles.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,12 @@
284284
height: 2rem;
285285
}
286286

287+
/* Tab whose contents haven't been viewed yet (e.g. a background shell
288+
spawned via the MCP create_shell with background:true, until selected). */
289+
@utility tab-unviewed {
290+
font-style: italic;
291+
}
292+
287293
@layer base {
288294
* {
289295
margin: 0;

0 commit comments

Comments
 (0)