Skip to content

Commit f67c273

Browse files
jasonczcclaude
andcommitted
refactor(web): split workbench toggle out of session action menu
The "Hide/Show workbench" item belonged in a drawer control, not a dropdown. Header now exposes two separate controls: - ⋯ More actions button: opens dropdown (Rename / New (same config) / Duplicate / Save checkpoint / Archive|Delete) - Panel icon button: directly toggles workbench drawer SessionActionMenu drops onToggleWorkbench / workbenchOpen props and the Hide/Show workbench menu item. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent bdff241 commit f67c273

2 files changed

Lines changed: 23 additions & 33 deletions

File tree

web/src/components/SessionActionMenu.tsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ type SessionActionMenuProps = {
1717
onSpawnSameConfig?: () => void
1818
onDuplicate?: () => void
1919
onSaveCheckpoint?: () => void
20-
onToggleWorkbench?: () => void
21-
workbenchOpen?: boolean
2220
onArchive: () => void
2321
onDelete: () => void
2422
anchorPoint: { x: number; y: number }
@@ -42,8 +40,6 @@ export function SessionActionMenu(props: SessionActionMenuProps) {
4240
onSpawnSameConfig,
4341
onDuplicate,
4442
onSaveCheckpoint,
45-
onToggleWorkbench,
46-
workbenchOpen,
4743
onArchive,
4844
onDelete,
4945
anchorPoint,
@@ -83,12 +79,6 @@ export function SessionActionMenu(props: SessionActionMenuProps) {
8379
onSaveCheckpoint()
8480
}
8581

86-
const handleToggleWorkbench = () => {
87-
if (!onToggleWorkbench) return
88-
onClose()
89-
onToggleWorkbench()
90-
}
91-
9282
const handleDelete = () => {
9383
onClose()
9484
onDelete()
@@ -215,12 +205,6 @@ export function SessionActionMenu(props: SessionActionMenuProps) {
215205
</button>
216206
) : null}
217207

218-
{onToggleWorkbench ? (
219-
<button type="button" role="menuitem" className="menu-action" onClick={handleToggleWorkbench}>
220-
{workbenchOpen ? 'Hide workbench' : 'Show workbench'}
221-
</button>
222-
) : null}
223-
224208
<div className="menu-divider" role="separator" aria-hidden="true" />
225209

226210
{sessionActive ? (

web/src/components/SessionHeader.tsx

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -255,29 +255,37 @@ export function SessionHeader(props: {
255255
<button
256256
ref={menuAnchorRef}
257257
type="button"
258-
className="icon-action-btn"
258+
className="icon-action-btn header-more-btn"
259259
onClick={handleMenuToggle}
260260
onPointerDown={(e) => e.stopPropagation()}
261261
aria-haspopup="menu"
262262
aria-expanded={menuOpen}
263263
aria-controls={menuOpen ? menuId : undefined}
264264
title={t('session.more')}
265-
style={{ padding: '2px 4px', gap: '4px' }}
266265
>
267-
<span style={{ fontFamily: 'monospace', fontWeight: 'bold', fontSize: '11px', marginRight: '4px' }}>&gt;_</span>
268-
<span
269-
style={{
270-
display: 'flex',
271-
alignItems: 'center',
272-
background: 'var(--cursor-bg-soft, #EFEFEF)',
273-
padding: '1px 3px',
274-
borderRadius: '4px',
275-
}}
276-
>
277-
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="3" x2="16" y2="21"/></svg>
278-
<svg width="9" height="9" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" style={{ marginLeft: '2px' }}><polyline points="6 9 12 15 18 9"/></svg>
279-
</span>
266+
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
267+
<circle cx="5" cy="12" r="1.6" />
268+
<circle cx="12" cy="12" r="1.6" />
269+
<circle cx="19" cy="12" r="1.6" />
270+
</svg>
280271
</button>
272+
273+
{props.onToggleWorkbench ? (
274+
<button
275+
type="button"
276+
className="icon-action-btn header-workbench-toggle"
277+
onClick={props.onToggleWorkbench}
278+
onPointerDown={(e) => e.stopPropagation()}
279+
aria-pressed={Boolean(props.workbenchOpen)}
280+
title={props.workbenchOpen ? 'Hide workbench' : 'Show workbench'}
281+
aria-label={props.workbenchOpen ? 'Hide workbench' : 'Show workbench'}
282+
>
283+
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
284+
<rect x="3" y="3" width="18" height="18" rx="2" ry="2" />
285+
<line x1="15" y1="3" x2="15" y2="21" />
286+
</svg>
287+
</button>
288+
) : null}
281289
</div>
282290
</header>
283291

@@ -289,8 +297,6 @@ export function SessionHeader(props: {
289297
onSpawnSameConfig={handleSpawnSameConfig}
290298
onDuplicate={handleDuplicate}
291299
onSaveCheckpoint={session.metadata?.containerId ? () => setCheckpointDialogOpen(true) : undefined}
292-
onToggleWorkbench={props.onToggleWorkbench}
293-
workbenchOpen={props.workbenchOpen}
294300
onArchive={handleArchive}
295301
onDelete={() => setDeleteOpen(true)}
296302
anchorPoint={menuAnchorPoint}

0 commit comments

Comments
 (0)