From 3f5388a3584171e8f25b6a73cd2dea0ff9a13aae Mon Sep 17 00:00:00 2001 From: Dorian Villet Date: Fri, 13 Nov 2026 15:16:12 +0100 Subject: [PATCH] feat(task-panel): hide the side column of the two-column task view A pill on the boundary between the terminal and the side column hides the column (task context, changed files, notes and shells) and brings it back, so the agent's terminal can take the whole task width. The pill is anchored to the column's resize handle, so it follows a drag, and shares its look with the board side panel's close tab, now the `.edge-tab` class in styles.css. The choice is global and kept across restarts. Focus moving to a pane of the hidden column, such as a new shell or a keyboard jump to the notes, shows it again, and keyboard navigation skips it while hidden. With the column hidden, task context returns to the header strip. Co-Authored-By: Claude Opus 5.5 --- src/components/BoardSidePanel.tsx | 2 +- .../TaskPanel.reasoning.client.test.tsx | 37 +++++ src/components/TaskPanel.tsx | 152 ++++++++++++------ src/components/task-board.css | 26 +-- src/store/autosave.test.ts | 11 ++ src/store/autosave.ts | 1 + src/store/core.ts | 1 + src/store/focus.test.ts | 20 +++ src/store/focus.ts | 9 ++ src/store/persistence.test.ts | 25 +++ src/store/persistence.ts | 3 + src/store/store.ts | 2 + src/store/types.ts | 3 + src/store/ui.ts | 4 + src/styles.css | 46 ++++++ 15 files changed, 266 insertions(+), 76 deletions(-) diff --git a/src/components/BoardSidePanel.tsx b/src/components/BoardSidePanel.tsx index a4024d5cb..1c1e3efe7 100644 --- a/src/components/BoardSidePanel.tsx +++ b/src/components/BoardSidePanel.tsx @@ -47,7 +47,7 @@ export function BoardSidePanelClose() { diff --git a/src/components/task-board.css b/src/components/task-board.css index a1e809bc0..21ae4f12a 100644 --- a/src/components/task-board.css +++ b/src/components/task-board.css @@ -1134,31 +1134,11 @@ main.board-panel-left > .plan-board-shell { height: auto; min-height: 0; } -/* A pill straddling the edge facing the board, centred on it and above the - resize handle it overlaps, so it reads as a tab of the boundary. */ +/* Straddles the edge facing the board, centred on it and above the resize + handle it overlaps, so it reads as a tab of the boundary. The pill itself + is `.edge-tab` in styles.css. */ .board-side-panel-close { - position: absolute; - top: 50%; left: -8px; - z-index: 3; - display: inline-flex; - align-items: center; - justify-content: center; - width: 16px; - height: 44px; - padding: 0; - translate: 0 -50%; - border: 1px solid var(--border); - border-radius: var(--radius-pill); - background: var(--bg-elevated); - box-shadow: 0 1px 4px rgb(0 0 0 / 0.25); - color: var(--fg-muted); - cursor: pointer; -} -.board-side-panel-close:hover { - border-color: var(--fg-muted); - background: var(--bg-hover); - color: var(--fg); } /* Ordered after the panel, the board would otherwise paint over the half of the tab that sticks out, and take its clicks. */ diff --git a/src/store/autosave.test.ts b/src/store/autosave.test.ts index 28ef43f41..ba2d94698 100644 --- a/src/store/autosave.test.ts +++ b/src/store/autosave.test.ts @@ -84,6 +84,17 @@ describe('autosave snapshot includes new-task-default fields', () => { setStore('defaultPropagateSkipPermissions', false); }); + it('a hidden task side column changes the snapshot', () => { + setStore('taskSideCollapsed', false); + const before = persistedSnapshot(); + setStore('taskSideCollapsed', true); + try { + expect(persistedSnapshot()).not.toBe(before); + } finally { + setStore('taskSideCollapsed', false); + } + }); + it('terminalScreenReaderMode changes the snapshot', () => { setStore('terminalScreenReaderMode', false); const before = persistedSnapshot(); diff --git a/src/store/autosave.ts b/src/store/autosave.ts index e57ab32fc..e00017ce7 100644 --- a/src/store/autosave.ts +++ b/src/store/autosave.ts @@ -47,6 +47,7 @@ function structuralSnapshot(): string { modelTaskNames: store.modelTaskNames, taskNameModel: store.taskNameModel, taskBriefs: store.taskBriefs, + taskSideCollapsed: store.taskSideCollapsed, briefBarFields: { ...store.briefBarFields }, briefModel: store.briefModel, reviewGuidance: store.reviewGuidance, diff --git a/src/store/core.ts b/src/store/core.ts index cbc7ae281..4ad08d5ad 100644 --- a/src/store/core.ts +++ b/src/store/core.ts @@ -78,6 +78,7 @@ export const [store, setStore] = createStore({ modelTaskNames: false, taskNameModel: DEFAULT_TASK_NAME_MODEL, taskBriefs: false, + taskSideCollapsed: false, briefBarFields: { ...DEFAULT_BRIEF_BAR_FIELDS }, briefModel: DEFAULT_BRIEF_MODEL, reviewGuidance: '', diff --git a/src/store/focus.test.ts b/src/store/focus.test.ts index 558254e71..bbd5b1477 100644 --- a/src/store/focus.test.ts +++ b/src/store/focus.test.ts @@ -21,6 +21,7 @@ type MockStore = { showPromptInput: boolean; sidebarVisible: boolean; taskSplitMode: Record; + taskSideCollapsed: boolean; shellLayoutOverride: 'row' | 'grid' | 'column' | null; taskShellAutoLayout: Record; pendingAction: { type: 'close' | 'finish'; taskId: string } | null; @@ -125,6 +126,7 @@ beforeEach(() => { showPromptInput: true, sidebarVisible: true, taskSplitMode: {}, + taskSideCollapsed: false, shellLayoutOverride: null, taskShellAutoLayout: {}, pendingAction: null, @@ -319,6 +321,24 @@ describe('focus navigation neighbor map', () => { expect(mockStore.focusedPanel['task-1']).toBe('changed-files'); }); + it('keeps a split task without its hidden side column to the terminal column', () => { + setTask('task-1', { + shellAgentIds: ['shell-1'], + }); + setTask('task-2'); + mockStore.taskOrder = ['task-1', 'task-2']; + mockStore.taskSplitMode['task-1'] = true; + mockStore.taskSideCollapsed = true; + mockStore.showPromptInput = false; + mockStore.focusedPanel['task-1'] = 'ai-terminal'; + + navigateRow('down'); + expect(mockStore.focusedPanel['task-1']).toBe('ai-terminal'); + + navigateColumn('right'); + expect(mockStore.activeTaskId).toBe('task-2'); + }); + it('falls back from vanished focused panels before navigating', () => { setTask('task-1'); mockStore.focusedPanel['task-1'] = 'removed-panel'; diff --git a/src/store/focus.ts b/src/store/focus.ts index b0c9cf914..75323e5e5 100644 --- a/src/store/focus.ts +++ b/src/store/focus.ts @@ -111,6 +111,11 @@ function isLeftColumnPanel(panel: string): boolean { ); } +/** Cells of the split layout's side column, which the user can hide. */ +export function isSideColumnPanel(panel: string): boolean { + return panel !== 'canvas' && !isLeftColumnPanel(panel); +} + /** Shell panel ids split into the visual rows of the task's shell layout. */ function shellRows(taskId: string, shellCount: number): string[][] { const cols = shellColumns(getTaskShellLayout(taskId), shellCount); @@ -139,6 +144,10 @@ function buildMainGrid(panelId: string): string[][] { const aiCols = aiTerminalPanels(task); if (isDocumentAgentTaskId(panelId)) return [aiCols, ['prompt']]; + if (store.taskSplitMode[panelId] && store.taskSideCollapsed) { + return [['title'], aiCols, ...(store.showPromptInput ? [['prompt']] : [])]; + } + if (store.taskSplitMode[panelId]) { const grid: string[][] = [['title']]; grid.push([...aiCols, 'changed-files']); diff --git a/src/store/persistence.test.ts b/src/store/persistence.test.ts index cecc12f20..e218d2a87 100644 --- a/src/store/persistence.test.ts +++ b/src/store/persistence.test.ts @@ -1954,6 +1954,31 @@ describe('new task defaults persistence', () => { }); }); +describe('task side column', () => { + beforeEach(() => vi.clearAllMocks()); + + async function lastSaved(): Promise> { + mockInvoke.mockResolvedValueOnce(undefined); + await saveState(); + const lastCall = mockInvoke.mock.calls[mockInvoke.mock.calls.length - 1]; + return JSON.parse(lastCall[1].json) as Record; + } + + it('keeps a hidden side column across restarts, showing it unless it was hidden', async () => { + mockInvoke.mockResolvedValueOnce(basePayload({ taskSideCollapsed: true })); + await loadState(); + expect(store.taskSideCollapsed).toBe(true); + expect((await lastSaved()).taskSideCollapsed).toBe(true); + mockInvoke.mockResolvedValueOnce(basePayload({ taskSideCollapsed: 'yes' })); + await loadState(); + expect(store.taskSideCollapsed).toBe(false); + expect((await lastSaved()).taskSideCollapsed).toBeUndefined(); + mockInvoke.mockResolvedValueOnce(basePayload()); + await loadState(); + expect(store.taskSideCollapsed).toBe(false); + }); +}); + describe('task brief settings', () => { beforeEach(() => vi.clearAllMocks()); diff --git a/src/store/persistence.ts b/src/store/persistence.ts index 61231fca6..c5601a7f5 100644 --- a/src/store/persistence.ts +++ b/src/store/persistence.ts @@ -578,6 +578,7 @@ export async function saveState(): Promise { modelTaskNames: store.modelTaskNames, taskNameModel: store.taskNameModel, taskBriefs: store.taskBriefs || undefined, + taskSideCollapsed: store.taskSideCollapsed || undefined, briefBarFields: { ...store.briefBarFields }, briefModel: store.briefModel, reviewGuidance: store.reviewGuidance.trim() || undefined, @@ -804,6 +805,7 @@ interface LegacyPersistedState { modelTaskNames?: unknown; taskNameModel?: unknown; taskBriefs?: unknown; + taskSideCollapsed?: unknown; briefBarFields?: unknown; briefModel?: unknown; reviewGuidance?: unknown; @@ -1099,6 +1101,7 @@ export async function loadState(): Promise { ? raw.taskNameModel : DEFAULT_TASK_NAME_MODEL; s.taskBriefs = raw.taskBriefs === true; + s.taskSideCollapsed = raw.taskSideCollapsed === true; s.briefBarFields = restoreBriefBarFields(raw.briefBarFields); // Briefs used to follow the naming model, with Claude upgraded to Sonnet. s.briefModel = isBriefModelId(raw.briefModel) diff --git a/src/store/store.ts b/src/store/store.ts index 68876c229..ee170dbec 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -122,6 +122,7 @@ export { unfocusSidebar, unfocusPlaceholder, focusBoardSidePanel, + isSideColumnPanel, samePanelKindIn, switchTaskKeepingPanel, navigateRow, @@ -172,6 +173,7 @@ export { setModelTaskNames, setTaskNameModel, setTaskBriefs, + setTaskSideCollapsed, setBriefBarField, setBriefModel, setReviewGuidance, diff --git a/src/store/types.ts b/src/store/types.ts index dfedb2106..5998df0bf 100644 --- a/src/store/types.ts +++ b/src/store/types.ts @@ -630,6 +630,7 @@ export interface PersistedState { modelTaskNames?: boolean; taskNameModel?: TaskNameModelId; taskBriefs?: boolean; + taskSideCollapsed?: boolean; briefBarFields?: BriefBarFields; briefModel?: BriefModelId; reviewGuidance?: string; @@ -789,6 +790,8 @@ export interface AppStore { taskNameModel: TaskNameModelId; /** Opt-in: write a task brief after each agent turn. */ taskBriefs: boolean; + /** The side column of a two-column task (changed files, notes, shells) is hidden. */ + taskSideCollapsed: boolean; briefBarFields: BriefBarFields; briefModel: BriefModelId; /** The user's own notes for the task reviewer, added to its instructions. */ diff --git a/src/store/ui.ts b/src/store/ui.ts index 846eec7f5..5eae0ba98 100644 --- a/src/store/ui.ts +++ b/src/store/ui.ts @@ -187,6 +187,10 @@ export function setTaskBriefs(enabled: boolean): void { setStore('taskBriefs', enabled); } +export function setTaskSideCollapsed(collapsed: boolean): void { + setStore('taskSideCollapsed', collapsed); +} + export function setBriefBarField(field: keyof BriefBarFields, shown: boolean): void { setStore('briefBarFields', field, shown); } diff --git a/src/styles.css b/src/styles.css index 7c830ce5e..adec5576c 100644 --- a/src/styles.css +++ b/src/styles.css @@ -2171,6 +2171,52 @@ html:not( color: var(--fg); } +/* A pill on a boundary between two panes, which collapses or closes one of + them; the user of the class places it. */ +.edge-tab { + position: absolute; + top: 50%; + z-index: 3; + display: inline-flex; + align-items: center; + justify-content: center; + width: 16px; + height: 44px; + padding: 0; + translate: 0 -50%; + border: 1px solid var(--border); + border-radius: var(--radius-pill); + background: var(--bg-elevated); + box-shadow: 0 1px 4px rgb(0 0 0 / 0.25); + color: var(--fg-muted); + cursor: pointer; +} +.edge-tab:hover { + border-color: var(--fg-muted); + background: var(--bg-hover); + color: var(--fg); +} + +/* The side column's toggle straddles the column boundary, anchored to its + resize handle so it follows a drag. The wrapper scopes the anchor name to + its own task. Hidden, the column leaves the toggle at the body's right edge. */ +.task-main-body { + position: relative; + anchor-scope: --task-side-edge; +} +.task-split-cols > .resize-handle-h { + anchor-name: --task-side-edge; +} +.task-main-body > .task-side-toggle { + left: anchor(--task-side-edge center); + translate: -50% -50%; +} +.task-main-body > .task-side-toggle.collapsed { + left: auto; + right: 2px; + translate: 0 -50%; +} + /* The focused pane's ring already marks the active task; a column glow too would double the signal. Shadowed looks keep their resting shadow. */ html:not([data-look^='obsidian'], [data-look^='islands-'], [data-look='workbench'])