Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

PRD-7840 Add movable right terminal panel (#3349)

serafin-garciaaa2a53e6af25
diff --git a/.changeset/terminal-right-panel.md b/.changeset/terminal-right-panel.md
new file mode 100644
index 000000000..913d6d90a
--- /dev/null
+++ b/.changeset/terminal-right-panel.md
@@ -0,0 +1,9 @@
+---
+"@inkeep/open-knowledge": minor
+---
+
+Move the live Terminal workspace between its bottom dock and a dedicated right panel without interrupting running shells, losing scrollback, or changing terminal tabs. Open Knowledge remembers the Terminal placement and right-panel width across desktop restarts, keeps narrow layouts usable by resolving agent-panel conflicts in place, and exposes the move through accessible Terminal controls, the command palette, and the native desktop menu.
+
+The right-docked Terminal opens wide enough to read an agent transcript without wrapping, and can now be narrowed well below that when you want the space back — previously it could not be made any narrower than it opened.
+
+Every right-hand panel now resizes against the editor rather than against its neighbour, so dragging one panel no longer squeezes another, and repeatedly resizing or opening and closing panels no longer leaves the layout stuck with handles that will not move. The Terminal header offers the same one-click placement control on both edges and keeps its controls clear of the collapsed agents-panel reveal tab.
diff --git a/docs/content/features/editor.mdx b/docs/content/features/editor.mdx
index 6dabbe116..26b173d1b 100644
--- a/docs/content/features/editor.mdx
+++ b/docs/content/features/editor.mdx
@@ -106,12 +106,16 @@ Hovering a code block reveals a toolbar above it with its own **Ask AI** button
## Terminal
-The desktop app has a built-in terminal: real login shells, docked in the editor window. Toggle it with `Cmd+J` or `` Ctrl+` `` (which also works from inside a focused terminal), **View ▸ Show / Hide Bottom Dock**, or the edge **Show terminal** tab that sits where you last closed it. It opens as the bottom dock; the collapse button in its tab strip hides it again, and sessions keep running while it is hidden.
+The desktop app has a built-in terminal with real login shells inside the editor window. Toggle it with `Cmd+J` or `` Ctrl+` `` (which also works from inside a focused terminal), or with **View ▸ Show / Hide Terminal**. It opens at the placement saved for this installation (the bottom dock by default). Right-click a bottom-dock tab and choose **Move to right panel**, use the matching command in the command palette or **Terminal** menu, or use the right-panel header button to move it back to the bottom. Moving or hiding the Terminal keeps its live shells, tabs, and scrollback intact.
-The terminal is also the editor's AI-chat surface: the **Show terminal** tab starts your default CLI when no session is open, and the tab strip's **New chat** split button opens another CLI tab — its dropdown switches CLI (the pick sticks, shared with the Ask AI composer) or opens a plain shell tab. With text selected in the editor, `Cmd+J` and `` Ctrl+` `` both stage the passage into the active CLI's input (or open a new CLI tab when none is running) instead of toggling — they share one handler — and `Cmd+Shift+J` always stages it into a new CLI tab — the passage sits in the input for you to add to, and nothing is submitted until you press Enter. **Terminal ▸ New Terminal Window** (see [Terminal menu](#terminal-menu)) opens a dedicated window with the same multi-session tabs, `Cmd+<number>` tab switching, and shells starting at the project root.
+The terminal is also the editor's AI-chat surface: opening it starts your default CLI when no session is open, and the tab strip's **New chat** split button opens another CLI tab — its dropdown switches CLI (the pick sticks, shared with the Ask AI composer) or opens a plain shell tab. With text selected in the editor, `Cmd+J` and `` Ctrl+` `` both stage the passage into the active CLI's input (or open a new CLI tab when none is running) instead of toggling — they share one handler — and `Cmd+Shift+J` always stages it into a new CLI tab — the passage sits in the input for you to add to, and nothing is submitted until you press Enter. **Terminal ▸ New Terminal Window** (see [Terminal menu](#terminal-menu)) opens a dedicated window with the same multi-session tabs, `Cmd+<number>` tab switching, and shells starting at the project root.
Rename a tab by double-clicking it or pressing `F2`; the name you set pins over whatever title the running program reports, and clearing it falls back to that title. Reorder tabs by dragging, or move the active tab with `Cmd+Shift+←` / `Cmd+Shift+→` — untitled tabs keep a number that stays with their session as the strip is rearranged.
+The desktop app restores the Terminal's placement, right-panel width, tab order, active tab, and tab names after a full app restart. A full quit ends the shell processes and discards their scrollback; the restored tabs start new shells. This differs from moving, hiding, or reloading the editor window, which keeps the existing live sessions.
+
+On a narrow window, the right-side Terminal and Agents panel cannot remain open together. Opening either one closes the other and shows an in-app notice; closing the visible panel does not reopen the one that was displaced.
+
The shells run at full user privilege. To turn the terminal off for a project on this machine, use **Settings ▸ Terminal** or set `terminal.enabled: false` in `.ok/local/config.yml` (see the [configuration reference](../reference/configuration.mdx)); the setting is project-local, never shared via git or sync, and not agent-settable — only a human can flip it.
## Properties
@@ -246,8 +250,8 @@ Keyboard shortcuts (use `Ctrl` on Windows / Linux in place of `Cmd`, unless the
| `Cmd+Option+B` | Show / Hide the document panel (right). Matches VS Code's Secondary Side Bar accelerator. |
| `Cmd+Option+M` | Toggle between the visual and source editors, keeping your place. |
| `Cmd+Option+E` | **View in source** — jump from the visual editor to the Markdown for the block at the cursor, centered and highlighted (visual editor only). |
-| `Cmd+J` | Show / Hide the docked terminal (desktop app). With text selected, stages the passage into the AI CLI's input instead — nothing runs until you press Enter. |
-| `` Ctrl+` `` | Show / Hide the docked terminal too — the VS Code / Zed chord, literal `Ctrl` on every platform. Works even while a terminal holds focus. With text selected it stages the passage like `Cmd+J` instead of toggling. |
+| `Cmd+J` | Show / Hide the Terminal in its current placement (desktop app). With text selected, stages the passage into the AI CLI's input instead — nothing runs until you press Enter. |
+| `` Ctrl+` `` | Show / Hide the Terminal too — the VS Code / Zed chord, literal `Ctrl` on every platform. Works even while a terminal holds focus. With text selected it stages the passage like `Cmd+J` instead of toggling. |
| `Cmd+Shift+J` | Open an additional terminal tab (desktop app). With text selected, stages the passage into the new tab's AI CLI input. |
| `Cmd+P` | Open the [command palette](#command-palette) from anywhere — unlike `Cmd+K`, it opens the palette even while text is selected in the visual editor. |
| `Cmd+L` | Open and focus the [Ask AI](#ask-ai) composer (desktop app). |
@@ -295,7 +299,7 @@ Before the existing Zoom and Toggle Fullscreen items, the View menu gets:
| --- | --- | --- |
| **Show / Hide Sidebar** | `Cmd+Option+S` | Toggles the file sidebar (left). Label flips between Show and Hide based on current state, matching Finder. |
| **Show / Hide Document Panel** | `Cmd+Option+B` | Toggles the document panel (right). |
-| **Show / Hide Bottom Dock** | `Cmd+J` | Toggles the docked terminal. With editor text selected, stages the selection into the AI CLI's input instead of toggling. (`` Ctrl+` `` toggles it too, though that chord has no menu accelerator.) |
+| **Show / Hide Terminal** | `Cmd+J` | Toggles the Terminal in its current placement. With editor text selected, stages the selection into the AI CLI's input instead of toggling. (`` Ctrl+` `` toggles it too, though that chord has no menu accelerator.) |
| **Show Hidden Files** | `Cmd+Shift+.` | `appearance.sidebar.showHiddenFiles`; same toggle as the sidebar's right-click menu. |
| **Expand All** | (none) | Expands every folder in the tree. Hidden when nothing is collapsed. |
| **Collapse All** | (none) | Collapses every folder in the tree. Hidden when nothing is expanded. |
@@ -306,8 +310,9 @@ Toggling the menu checkboxes flips the underlying config field, which propagates
| Item | Accelerator | Behavior |
| --- | --- | --- |
-| **New Terminal** | (none) | Opens a new terminal tab, revealing the dock if it's hidden. |
+| **New Terminal** | (none) | Opens a new terminal tab, revealing the Terminal in its current placement if it's hidden. |
| **New Terminal Window** | (none) | Opens a terminal in its own window — the same multi-session tabs, switched with `Cmd+<number>`, shells starting at the project root. |
+| **Move Terminal to right / bottom** | (none) | Moves the live Terminal workspace to the opposite placement. The label names the destination. |
| **Kill Terminal** | (none) | Closes the active terminal tab and kills its shell. |
## Real-time collaboration
diff --git a/packages/app/src/components/CommandPalette.dom.test.tsx b/packages/app/src/components/CommandPalette.dom.test.tsx
index f98d904f5..374d6851d 100644
--- a/packages/app/src/components/CommandPalette.dom.test.tsx
+++ b/packages/app/src/components/CommandPalette.dom.test.tsx
@@ -234,12 +234,20 @@ function recent(name: string, path = `/projects/${name.toLowerCase()}`) {
return { name, path: path.replaceAll(' ', '-') };
}
-function createBridge() {
+function createBridge({
+ ptyAvailable = true,
+ terminalAvailable = true,
+}: {
+ ptyAvailable?: boolean;
+ terminalAvailable?: boolean;
+} = {}) {
return {
config: {
projectName: 'Current Project',
projectPath: '/projects/current',
+ ptyAvailable,
},
+ terminal: terminalAvailable ? {} : undefined,
project: {
listRecent: vi.fn(() =>
Promise.resolve([
@@ -975,6 +983,7 @@ describe('Cmd+K menu-parity backfill', () => {
sidebarVisible: true,
docPanelVisible: true,
terminalVisible: true,
+ terminalPlacement: 'bottom',
terminalLive: true,
});
busActions = [];
@@ -1001,6 +1010,7 @@ describe('Cmd+K menu-parity backfill', () => {
{ testid: 'command-palette-toggle-sidebar', query: 'sidebar', id: 'toggle-sidebar' },
{ testid: 'command-palette-toggle-doc-panel', query: 'document panel', id: 'toggle-doc-panel' },
{ testid: 'command-palette-toggle-terminal', query: 'hide terminal', id: 'toggle-terminal' },
+ { testid: 'command-palette-move-terminal', query: 'move terminal', id: 'move-terminal' },
{
testid: 'command-palette-toggle-agent-panel',
query: 'agents',
@@ -1215,7 +1225,7 @@ describe('Cmd+K menu-parity backfill', () => {
);
await setQuery('hide terminal');
expect(screen.getByTestId('command-palette-toggle-terminal').textContent).toContain(
- 'Hide Bottom Dock',
+ 'Hide Terminal',
);
cleanup();
@@ -1227,22 +1237,36 @@ describe('Cmd+K menu-parity backfill', () => {
);
await setQuery('show terminal');
expect(screen.getByTestId('command-palette-toggle-terminal').textContent).toContain(
- 'Show Bottom Dock',
+ 'Show Terminal',
+ );
+ });
+
+ test('terminal placement label and action invert with the current home', async () => {
+ setViewMenuState({ terminalPlacement: 'bottom' });
+ await renderPalette({ bridge: createBridge() });
+ await setQuery('move terminal');
+ const moveRight = screen.getByTestId('command-palette-move-terminal');
+ expect(moveRight.textContent).toContain('Move Terminal to right');
+ fireEvent.click(moveRight);
+ expect(busActions).toContain('move-terminal');
+
+ cleanup();
+ setViewMenuState({ terminalPlacement: 'right' });
+ await renderPalette({ bridge: createBridge() });
+ await setQuery('move terminal');
+ expect(screen.getByTestId('command-palette-move-terminal').textContent).toContain(
+ 'Move Terminal to bottom',
);
});
- // The row's label ("Bottom Dock") doesn't contain the words users actually
- // search for, so those live in the command's keywords instead.
- // `matchesCommandQuery` joins label+keywords and substring-matches, so a
- // multi-word query only resolves against a contiguous run — these are the
- // queries that must keep finding the dock command.
- test('AC5: the bottom-dock toggle stays reachable by its terminal-era queries', async () => {
+ test('AC5: the Terminal toggle stays reachable by its established queries', async () => {
setViewMenuState({ terminalVisible: false });
await renderPalette({ bridge: createBridge() });
for (const query of [
'terminal',
'show terminal',
'hide terminal',
+ 'toggle terminal',
'bottom dock',
'toggle bottom dock',
'shell',
@@ -1250,11 +1274,34 @@ describe('Cmd+K menu-parity backfill', () => {
await setQuery(query);
expect(
screen.queryByTestId('command-palette-toggle-terminal'),
- `query "${query}" should surface the bottom-dock toggle`,
+ `query "${query}" should surface the Terminal toggle`,
).not.toBeNull();
}
});
+ test('off-mac and incomplete desktop bridges hide every PTY-backed palette command', async () => {
+ const terminalCommands = [
+ ['show terminal', 'toggle-terminal'],
+ ['new terminal', 'new-terminal'],
+ ['move terminal', 'move-terminal'],
+ ['kill terminal', 'kill-terminal'],
+ ] as const;
+
+ setViewMenuState({ terminalLive: true });
+ await renderPalette({ bridge: createBridge({ ptyAvailable: false }) });
+ for (const [query, id] of terminalCommands) {
+ await setQuery(query);
+ expect(screen.queryByTestId(`command-palette-${id}`)).toBeNull();
+ }
+
+ cleanup();
+ await renderPalette({ bridge: createBridge({ terminalAvailable: false }) });
+ for (const [query, id] of terminalCommands) {
+ await setQuery(query);
+ expect(screen.queryByTestId(`command-palette-${id}`)).toBeNull();
+ }
+ });
+
test('AC5: kill-terminal is search-visible only when a terminal is live', async () => {
setViewMenuState({ terminalLive: true });
await renderPalette({ bridge: createBridge() });
diff --git a/packages/app/src/components/EditorArea.dom.test.tsx b/packages/app/src/components/EditorArea.dom.test.tsx
index bc868aca0..eb08fbe8d 100644
--- a/packages/app/src/components/EditorArea.dom.test.tsx
+++ b/packages/app/src/components/EditorArea.dom.test.tsx
@@ -10,6 +10,20 @@ type SettingsDialogShellProps = {
let settingsRouteOpen = false;
let closeSettingsRouteMock = vi.fn(() => {});
let shellProps: SettingsDialogShellProps[] = [];
+let toastInfoMessages: string[] = [];
+
+vi.doMock('sonner', async (importOriginal) => {
+ const actual = await importOriginal<typeof import('sonner')>();
+ return {
+ ...actual,
+ toast: {
+ ...actual.toast,
+ info: (message: string) => {
+ toastInfoMessages.push(message);
+ },
+ },
+ };
+});
vi.doMock('@/lib/perf', () => ({
mark: () => {},
@@ -69,6 +83,11 @@ const ASSET_DOC_CTX = {
// branch, so a later provider-null render counts as a mid-session navigation
// rather than a cold start.
const FOLDER_LIVE_CTX = { ...FOLDER_DOC_CTX, activeProvider: {} as never };
+const DOC_LIVE_CTX = {
+ ...FOLDER_LIVE_CTX,
+ activeDocName: 'docs/notes',
+ activeTarget: { kind: 'doc', target: 'docs/notes', docName: 'docs/notes' },
+};
// A doc target whose provider has gone transiently null — the close→neighbor
// gap (the neighbor activates async via hashchange) or a switch to a cold tab.
// Reaches the hash-load skeleton branch (not large-file/folder/asset, and
@@ -85,6 +104,7 @@ const DOC_COLD_CTX = {
let docCtx:
| typeof FOLDER_DOC_CTX
| typeof FOLDER_LIVE_CTX
+ | typeof DOC_LIVE_CTX
| typeof EMPTY_DOC_CTX
| typeof LARGE_FILE_DOC_CTX
| typeof ASSET_DOC_CTX
@@ -124,12 +144,24 @@ vi.doMock('@/components/EditorSkeleton', () => ({
}));
vi.doMock('./TerminalDock', () => ({
- TerminalDock: ({ children, visible }: { children: ReactNode; visible?: boolean }) => {
+ TerminalDock: ({
+ children,
+ placement,
+ visible,
+ }: {
+ children: ReactNode;
+ placement?: string;
+ visible?: boolean;
+ }) => {
useEffect(() => {
terminalDockMounts += 1;
}, []);
return (
- <div data-testid="terminal-dock" data-visible={String(visible)}>
+ <div
+ data-testid="terminal-dock"
+ data-placement={placement ?? 'bottom'}
+ data-visible={String(visible)}
+ >
{children}
</div>
);
@@ -168,12 +200,13 @@ vi.doMock('./EditorWorkspace', () => ({
let groupLayout: Record<string, number> = {};
let groupSetLayoutCalls: Array<Record<string, number>> = [];
let panelIsCollapsed = false;
+let mockGroupPx = 1360;
vi.doMock('react-resizable-panels', () => ({
usePanelRef: () => ({
current: {
collapse: () => {},
expand: () => {},
- getSize: () => ({ asPercentage: 25, inPixels: 340 }),
+ getSize: () => ({ asPercentage: 25, inPixels: mockGroupPx / 4 }),
isCollapsed: () => panelIsCollapsed,
},
}),
@@ -195,7 +228,21 @@ vi.doMock('@/components/ui/resizable', () => ({
ResizablePanelGroup: ({ children }: { children: ReactNode }) => (
<div data-testid="resizable-group">{children}</div>
),
- ResizablePanel: ({ children }: { children: ReactNode }) => <div>{children}</div>,
+ ResizablePanel: ({
+ children,
+ id,
+ minSize,
+ maxSize,
+ }: {
+ children: ReactNode;
+ id?: string;
+ minSize?: string | number;
+ maxSize?: string | number;
+ }) => (
+ <div id={id} data-min-size={minSize} data-max-size={maxSize}>
+ {children}
+ </div>
+ ),
// Forward onPointerDown so drag-lifecycle behavior (the terminal handle's
// drag-to-close pointerup check) is exercisable; drop non-DOM props.
ResizableHandle: ({ onPointerDown }: { onPointerDown?: (e: unknown) => void }) => (
@@ -248,6 +295,10 @@ vi.doMock('@/components/LargeFileEditorState', () => ({
),
}));
+vi.doMock('./EditorFooter', () => ({
+ EditorFooter: () => <div data-testid="editor-footer" />,
+}));
+
vi.doMock('@/components/settings/SettingsDialogShell', () => ({
SettingsDialogShell: (props: SettingsDialogShellProps) => {
shellProps.push(props);
@@ -264,6 +315,7 @@ vi.doMock('@/lib/use-settings-route', () => ({
const { EditorArea } = await import('./EditorArea');
const { TooltipProvider } = await import('@/components/ui/tooltip');
+const { emitLocalMenuAction } = await import('@/lib/local-menu-action-bus');
function renderEditorArea() {
return render(
@@ -375,7 +427,7 @@ describe('EditorArea empty-state terminal host', () => {
});
});
-describe('EditorArea right-rail layout assert on agents-column mount/unmount', () => {
+describe('EditorArea right-rail layout assert on column mount/unmount', () => {
// react-resizable-panels caches layouts per panel-ID set and restores the
// cached layout whenever the set changes — so before the corrective assert,
// hiding the right column resurrected a doc panel the user had closed while it
@@ -403,13 +455,274 @@ describe('EditorArea right-rail layout assert on agents-column mount/unmount', (
// px→% conversion basis fixed by the panel mock: 340px at 25% → 1360px.
const MOCK_GROUP_PX = 1360;
const pctOf = (px: number) => (px / MOCK_GROUP_PX) * 100;
+ const getAgentsHandle = () => {
+ const handle = screen.getAllByTestId('resizable-handle').at(-1);
+ if (handle == null) throw new Error('agents resize handle not found');
+ return handle;
+ };
beforeEach(() => {
cleanup();
+ localStorage.clear();
docCtx = EMPTY_DOC_CTX;
groupLayout = {};
groupSetLayoutCalls = [];
panelIsCollapsed = false;
+ mockGroupPx = 1360;
+ toastInfoMessages = [];
+ });
+
+ test('moving the terminal right at a narrow width closes agents without moving focus', async () => {
+ setViewportWidth(650);
+ mockGroupPx = 650;
+ const agentsChanges: boolean[] = [];
+ const focusTarget = document.createElement('button');
+ document.body.append(focusTarget);
+ focusTarget.focus();
+ const view = render(
+ <EditorArea
+ {...baseProps}
+ agentsVisible
+ terminalVisible
+ terminalPlacement="bottom"
+ onAgentsVisibleChange={(visible: boolean) => {
+ agentsChanges.push(visible);
+ }}
+ onTerminalVisibleChange={() => {}}
+ />,
+ );
+ groupLayout = { 'editor-main': 52, 'terminal-column': 30, 'agents-column': 18 };
+
+ view.rerender(
+ <EditorArea
+ {...baseProps}
+ agentsVisible
+ terminalVisible
+ terminalPlacement="right"
+ onAgentsVisibleChange={(visible: boolean) => {
+ agentsChanges.push(visible);
+ }}
+ onTerminalVisibleChange={() => {}}
+ />,
+ );
+ await act(async () => {});
+
+ expect(agentsChanges).toEqual([false]);
+ expect(toastInfoMessages).toEqual(['Agent panel closed to keep Terminal readable.']);
+ expect(document.activeElement).toBe(focusTarget);
+ });
+
+ test('a narrow restored layout keeps the right terminal and closes agents', async () => {
+ setViewportWidth(650);
+ mockGroupPx = 650;
+ const agentsChanges: boolean[] = [];
+ const terminalChanges: boolean[] = [];
+ render(
+ <EditorArea
+ {...baseProps}
+ agentsVisible
+ terminalVisible
+ terminalPlacement="right"
+ onAgentsVisibleChange={(visible: boolean) => {
+ agentsChanges.push(visible);
+ }}
+ onTerminalVisibleChange={(visible: boolean) => {
+ terminalChanges.push(visible);
+ }}
+ />,
+ );
+ groupLayout = { 'editor-main': 52, 'terminal-column': 30, 'agents-column': 18 };
+ await act(async () => {});
+
+ expect(agentsChanges).toEqual([false]);
+ expect(terminalChanges).toHaveLength(0);
+ expect(toastInfoMessages).toEqual(['Agent panel closed to keep Terminal readable.']);
+ });
+
+ test('opening agents at a narrow width closes the existing right terminal', async () => {
+ setViewportWidth(650);
+ mockGroupPx = 650;
+ const terminalChanges: boolean[] = [];
+ const view = render(
+ <EditorArea
+ {...baseProps}
+ agentsVisible={false}
+ terminalVisible
+ terminalPlacement="right"
+ onTerminalVisibleChange={(visible: boolean) => {
+ terminalChanges.push(visible);
+ }}
+ />,
+ );
+ groupLayout = { 'editor-main': 52, 'terminal-column': 30, 'agents-column': 18 };
+
+ view.rerender(
+ <EditorArea
+ {...baseProps}
+ agentsVisible
+ terminalVisible
+ terminalPlacement="right"
+ onTerminalVisibleChange={(visible: boolean) => {
+ terminalChanges.push(visible);
+ }}
+ />,
+ );
+ await act(async () => {});
+
+ expect(terminalChanges).toEqual([false]);
+ expect(toastInfoMessages).toEqual(['Terminal closed to make room for the agent panel.']);
+ });
+
+ test('a wide workspace keeps both rails and their independent size constraints', async () => {
+ setViewportWidth(2000);
+ mockGroupPx = 2000;
+ groupLayout = { 'editor-main': 47, 'terminal-column': 37, 'agents-column': 16 };
+ const agentsChanges: boolean[] = [];
+ const terminalChanges: boolean[] = [];
+ render(
+ <EditorArea
+ {...baseProps}
+ agentsVisible
+ terminalVisible
+ terminalPlacement="right"
+ onAgentsVisibleChange={(visible: boolean) => {
+ agentsChanges.push(visible);
+ }}
+ onTerminalVisibleChange={(visible: boolean) => {
+ terminalChanges.push(visible);
+ }}
+ />,
+ );
+ await act(async () => {});
+
+ const terminalPanel = document.getElementById('terminal-column');
+ const agentsPanel = document.getElementById('agents-column');
+ expect(terminalPanel?.getAttribute('data-min-size')).toBe('325px');
+ expect(terminalPanel?.hasAttribute('data-max-size')).toBe(false);
+ expect(agentsPanel?.getAttribute('data-min-size')).toBe('320px');
+ expect(agentsPanel?.getAttribute('data-max-size')).toBe('95%');
+ expect(agentsChanges).toHaveLength(0);
+ expect(terminalChanges).toHaveLength(0);
+ });
+
+ test('repeated resize events below the boundary close agents once and keep Terminal open', async () => {
+ const originalResizeObserver = globalThis.ResizeObserver;
+ const observations: Array<{
+ callback: ResizeObserverCallback;
+ observer: ResizeObserver;
+ target: Element;
+ }> = [];
+ class TestResizeObserver implements ResizeObserver {
+ readonly callback: ResizeObserverCallback;
+
+ constructor(callback: ResizeObserverCallback) {
+ this.callback = callback;
+ }
+
+ observe(target: Element) {
+ observations.push({ callback: this.callback, observer: this, target });
+ }
+
+ unobserve() {}
+
+ disconnect() {}
+ }
+ Object.defineProperty(globalThis, 'ResizeObserver', {
+ value: TestResizeObserver,
+ configurable: true,
+ writable: true,
+ });
+
+ try {
+ setViewportWidth(2000);
+ mockGroupPx = 2000;
+ groupLayout = { 'editor-main': 47, 'terminal-column': 37, 'agents-column': 16 };
+ const agentsChanges: boolean[] = [];
+ const terminalChanges: boolean[] = [];
+ render(
+ <EditorArea
+ {...baseProps}
+ agentsVisible
+ terminalVisible
+ terminalPlacement="right"
+ onAgentsVisibleChange={(visible: boolean) => {
+ agentsChanges.push(visible);
+ }}
+ onTerminalVisibleChange={(visible: boolean) => {
+ terminalChanges.push(visible);
+ }}
+ />,
+ );
+ await act(async () => {});
+ expect(agentsChanges).toHaveLength(0);
+
+ mockGroupPx = 650;
+ const panels = document.querySelector('[data-editor-area-panels]');
+ const panelObservation = observations.find(({ target }) => target === panels);
+ expect(panelObservation).toBeDefined();
+ act(() => {
+ panelObservation?.callback([], panelObservation.observer);
+ panelObservation?.callback([], panelObservation.observer);
+ });
+
+ expect(agentsChanges).toEqual([false]);
+ expect(terminalChanges).toHaveLength(0);
+ expect(toastInfoMessages).toEqual(['Agent panel closed to keep Terminal readable.']);
+ } finally {
+ Object.defineProperty(globalThis, 'ResizeObserver', {
+ value: originalResizeObserver,
+ configurable: true,
+ writable: true,
+ });
+ }
+ });
+
+ test('revealing the right terminal pins its width and routes the remainder to the editor', async () => {
+ setViewportWidth(1400);
+ const view = render(
+ <EditorArea
+ {...baseProps}
+ terminalVisible
+ terminalPlacement="bottom"
+ onTerminalVisibleChange={() => {}}
+ />,
+ );
+ groupLayout = { 'editor-main': 65, 'terminal-column': 35 };
+
+ view.rerender(
+ <EditorArea
+ {...baseProps}
+ terminalVisible
+ terminalPlacement="right"
+ onTerminalVisibleChange={() => {}}
+ />,
+ );
+ await act(async () => {});
+
+ const corrected = groupSetLayoutCalls.at(-1);
+ expect(corrected?.['terminal-column']).toBeCloseTo(pctOf(740), 3);
+ expect(corrected?.['editor-main']).toBeCloseTo(100 - pctOf(740), 3);
+ });
+
+ test('opens the collapsed doc panel while both permanent rail columns are hidden', () => {
+ setViewportWidth(1024);
+ docCtx = DOC_LIVE_CTX;
+ render(<EditorArea {...baseProps} />);
+ groupLayout = {
+ 'editor-main': 100,
+ 'doc-panel': 0,
+ 'terminal-column': 0,
+ 'agents-column': 0,
+ };
+ groupSetLayoutCalls = [];
+
+ act(() => emitLocalMenuAction('toggle-doc-panel'));
+
+ const corrected = groupSetLayoutCalls.at(-1);
+ expect(corrected?.['doc-panel']).toBeCloseTo(pctOf(320), 3);
+ expect(corrected?.['terminal-column']).toBe(0);
+ expect(corrected?.['agents-column']).toBe(0);
+ expect(corrected?.['editor-main']).toBeCloseTo(100 - pctOf(320), 3);
});
test('hiding the agents panel re-asserts the collapsed doc panel over the stale panel-set restore', async () => {
@@ -464,8 +777,7 @@ describe('EditorArea right-rail layout assert on agents-column mount/unmount', (
}}
/>,
);
- // The empty view renders no doc panel, so the only handle is the column's.
- const handle = screen.getByTestId('resizable-handle');
+ const handle = getAgentsHandle();
act(() => {
fireEvent.pointerDown(handle);
});
@@ -488,7 +800,7 @@ describe('EditorArea right-rail layout assert on agents-column mount/unmount', (
}}
/>,
);
- const handle = screen.getByTestId('resizable-handle');
+ const handle = getAgentsHandle();
act(() => {
fireEvent.pointerDown(handle);
});
@@ -509,7 +821,7 @@ describe('EditorArea right-rail layout assert on agents-column mount/unmount', (
test('a pointercancel-terminated drag still clears the flag that gates the layout assert', async () => {
setViewportWidth(1400);
const view = render(<EditorArea {...baseProps} agentsVisible />);
- const handle = screen.getByTestId('resizable-handle');
+ const handle = getAgentsHandle();
act(() => {
fireEvent.pointerDown(handle);
});
@@ -541,7 +853,7 @@ describe('EditorArea right-rail layout assert on agents-column mount/unmount', (
// What the group holds mid-drag: the editor plus the column the drag has
// been shrinking. The assert needs a live panel-ID set to correct against.
groupLayout = { 'editor-main': 70, 'agents-column': 30 };
- const handle = screen.getByTestId('resizable-handle');
+ const handle = getAgentsHandle();
act(() => {
fireEvent.pointerDown(handle);
});
@@ -575,7 +887,7 @@ describe('EditorArea right-rail layout assert on agents-column mount/unmount', (
}}
/>,
);
- const handle = screen.getByTestId('resizable-handle');
+ const handle = getAgentsHandle();
act(() => {
fireEvent.pointerDown(handle, { pointerId: 1 });
});
@@ -598,7 +910,7 @@ describe('EditorArea right-rail layout assert on agents-column mount/unmount', (
test('a different pointer cancelling does not end an in-flight drag', async () => {
setViewportWidth(1400);
const view = render(<EditorArea {...baseProps} agentsVisible />);
- const handle = screen.getByTestId('resizable-handle');
+ const handle = getAgentsHandle();
act(() => {
fireEvent.pointerDown(handle, { pointerId: 1 });
});
@@ -684,6 +996,50 @@ describe('EditorArea session-panel edge reveal tabs', () => {
});
});
+describe('EditorArea terminal placement', () => {
+ beforeEach(() => {
+ cleanup();
+ docCtx = DOC_LIVE_CTX;
+ });
+
+ test('places a visible right terminal between the document and agents rails', () => {
+ const placements: unknown[] = [];
+ render(
+ <EditorArea
+ editorMode="wysiwyg"
+ onModeChange={() => {}}
+ activeTab="timeline"
+ onActiveTabChange={() => {}}
+ terminalBridge={{} as never}
+ terminalVisible
+ terminalPlacement="right"
+ agentsVisible
+ onTerminalVisibleChange={() => {}}
+ onSessionPlacements={(value) => placements.push(value)}
+ />,
+ );
+
+ const documentPanel = document.getElementById('doc-panel');
+ const terminalPanel = document.getElementById('terminal-column');
+ const agentsPanel = document.getElementById('agents-column');
+ expect(terminalPanel).not.toBeNull();
+ expect(
+ documentPanel?.compareDocumentPosition(terminalPanel as Node) &
+ Node.DOCUMENT_POSITION_FOLLOWING,
+ ).toBeTruthy();
+ expect(
+ terminalPanel?.compareDocumentPosition(agentsPanel as Node) &
+ Node.DOCUMENT_POSITION_FOLLOWING,
+ ).toBeTruthy();
+ expect(screen.getByTestId('terminal-dock').getAttribute('data-placement')).toBe('right');
+ const latest = placements.at(-1) as {
+ terminal?: { container?: Element; isShowing?: boolean };
+ };
+ expect(latest.terminal?.container).toBe(document.querySelector('[data-terminal-panel-mount]'));
+ expect(latest.terminal?.isShowing).toBe(true);
+ });
+});
+
describe('EditorArea folder-view terminal host', () => {
beforeEach(() => {
cleanup();
diff --git a/packages/app/src/components/EditorArea.tsx b/packages/app/src/components/EditorArea.tsx
index fb7a8bb51..e0d29a68b 100644
--- a/packages/app/src/components/EditorArea.tsx
+++ b/packages/app/src/components/EditorArea.tsx
@@ -5,7 +5,9 @@ import {
detectEmbeddedHostFromBrowser,
isFrontmatterSchemaAsset,
isMarkdownlintJsonConfig,
+ PREFERRED_TERMINAL_RIGHT_WIDTH,
parseExternalSkillDocName,
+ type TerminalPlacement,
} from '@inkeep/open-knowledge-core';
import { Trans, useLingui } from '@lingui/react/macro';
import {
@@ -21,6 +23,7 @@ import {
} from 'react';
import { createPortal } from 'react-dom';
import { useGroupRef, usePanelRef } from 'react-resizable-panels';
+import { toast } from 'sonner';
import { AssetPreview } from '@/components/AssetPreview';
import { DocPanel, type PanelTab } from '@/components/DocPanel';
import {
@@ -90,7 +93,19 @@ import {
type EditorWorkspacePaneRenderContext,
} from './EditorWorkspace';
import { shouldPaintOverlay } from './editor-area-overlay';
+import {
+ AGENT_PANEL_ID,
+ AGENTS_COLUMN_ID,
+ accountRailLayout,
+ DOC_PANEL_ID,
+ findResidualPanelId,
+ TERMINAL_COLUMN_ID,
+} from './editor-area-rail-registry';
import { computeStickyRepinLayout } from './editor-area-sticky-repin';
+import {
+ RIGHT_TERMINAL_PANEL_MIN_WIDTH_PX,
+ resolveRightRailAdmission,
+} from './right-rail-admission';
import { isSlidesHost } from './slides-host-gate';
import { TerminalDock } from './TerminalDock';
import { TerminalRevealTab } from './TerminalRevealTab';
@@ -100,6 +115,18 @@ const LazyActivityModeContent = lazy(async () => {
return { default: mod.ActivityModeContent };
});
+const PANEL_GROUP_UNAVAILABLE_MESSAGE = /^Could not find Group with id "/;
+
+function reportUnexpectedPanelGroupFailure(event: string, error: unknown) {
+ if (error instanceof Error && PANEL_GROUP_UNAVAILABLE_MESSAGE.test(error.message)) return;
+ console.warn(
+ JSON.stringify({
+ event,
+ error: error instanceof Error ? error.message : String(error),
+ }),
+ );
+}
+
// The edit-in-place banner only mounts for a detected-skill buffer, so keep it
// (and the Manage-adopt flow it pulls in) out of the eager editor bundle.
const SkillEditBanner = lazy(async () => ({
@@ -203,18 +230,13 @@ const LazyAgentDiffPane = lazy(async () => {
return { default: mod.AgentDiffPane };
});
-// Shared doc-panel sizing — referenced by both the live `id="doc-panel"` and the
+// Shared doc-panel sizing — referenced by both the live doc panel and the
// hash-load placeholder that mirrors it, so the two stay structurally linked and
// their min/max can't drift apart.
-const DOC_PANEL_MIN_SIZE = '300px';
+const DOC_PANEL_MIN_WIDTH_PX = 300;
+const DOC_PANEL_MIN_SIZE = `${DOC_PANEL_MIN_WIDTH_PX}px`;
const DOC_PANEL_MAX_SIZE = '600px';
-// The right-side panels the horizontal group can render. The editor column is the
-// residual absorber and intentionally has no id (an explicit id on it changes how
-// the library redistributes an imperative resize), so the right-rail layout assert
-// finds it as the one live panel id that is not one of these.
-const RIGHT_PANEL_IDS = new Set(['doc-panel', 'agents-column', 'agent-panel']);
-
/**
* Where + whether ONE session panel should attach right now. EditorArea computes
* this (it knows the view kind and the mount containers) and reports it UP to
@@ -254,7 +276,10 @@ interface EditorAreaProps {
*/
terminalBridge?: OkDesktopBridge | null;
terminalVisible?: boolean;
+ terminalPlacement?: TerminalPlacement;
+ terminalRightWidth?: number;
onTerminalVisibleChange?: (visible: boolean) => void;
+ onTerminalRightWidthChange?: (width: number) => void;
/** Agents-panel visibility. Its own resizable column to the right of the
* doc/agent panel. Independent of the terminal. */
agentsVisible?: boolean;
@@ -326,7 +351,10 @@ function EditorAreaInner({
onActiveTabChange,
terminalBridge,
terminalVisible = false,
+ terminalPlacement = 'bottom',
+ terminalRightWidth,
onTerminalVisibleChange,
+ onTerminalRightWidthChange,
agentsVisible = false,
onAgentsVisibleChange,
onSessionPlacements,
@@ -355,7 +383,7 @@ function EditorAreaInner({
// genuine cold start (group never mounted, no docked terminal alive yet) from
// a mid-session navigation whose provider is transiently null — closing a tab
// or switching to a not-yet-ready doc. Only the latter must keep the
- // persistent left column mounted so the docked terminal PTY survives.
+ // persistent workspace column mounted so the docked terminal PTY survives.
const [everHadProvider, setEverHadProvider] = useState(false);
useEffect(() => {
if (activeProvider != null && !everHadProvider) setEverHadProvider(true);
@@ -456,9 +484,10 @@ function EditorAreaInner({
}, [rightPartition]);
const panelRef = usePanelRef();
// Independent ref for the agents column (MD | PANE | AGENTS). Bound only while
- // that column is mounted (agents panel visible); the sticky-width RO pins it
+ // each resizable rail column is mounted; the sticky-width correction pins them
// the same way it pins the doc panel.
const agentsColumnPanelRef = usePanelRef();
+ const terminalColumnPanelRef = usePanelRef();
const [initialRightCollapsed] = useState(() => {
const pins = readPins();
return resolveEffectiveState('right', rightPartition, pins) === 'collapsed';
@@ -469,9 +498,10 @@ function EditorAreaInner({
const isCollapsedRef = useRef(isCollapsed);
// The agents panel's mount point — a dedicated column to the right of the doc
- // panels (MD | PANE | AGENTS), present across EVERY view kind (the column just
- // has no doc panel beside it on asset / large-file / empty views).
+ // panels (MD | PANE | TERMINAL | AGENTS), present across EVERY view kind (the
+ // columns just have no doc panel beside them on asset / large-file / empty views).
const [agentsContainer, setAgentsContainer] = useState<HTMLDivElement | null>(null);
+ const [rightTerminalContainer, setRightTerminalContainer] = useState<HTMLDivElement | null>(null);
// The global editor header sits above the complete horizontal workspace so
// every right-side panel begins below it. EditorWorkspace owns the tab DnD
// context, so it portals the rendered header into this mount instead of
@@ -497,6 +527,8 @@ function EditorAreaInner({
// Keyed off visibility rather than has-tabs so the panel's feedback is
// immediate during the seconds-long agent spawn.
const agentsColumnPresent = agentsVisible;
+ const terminalColumnPresent = terminalVisible && terminalPlacement === 'right';
+ const resizableRailColumnPresent = terminalColumnPresent || agentsColumnPresent;
// The agents panel is the one surface with a persistent edge affordance: it is
// discoverable in a way a chord is not, and an agent conversation is the thing a
// user is most likely to want back. Ungated on having conversations — an empty
@@ -506,20 +538,22 @@ function EditorAreaInner({
// the View menu), and a second permanent tab hovering over the editor footer's
// bottom-right was clutter competing with the Ask AI composer for that corner.
const rightRevealTabPresent = !agentsVisible && onRevealAgents != null;
- const terminalShowing = terminalVisible && bottomTerminalContainer != null;
+ const terminalContainer =
+ terminalPlacement === 'right' ? rightTerminalContainer : bottomTerminalContainer;
+ const terminalShowing = terminalVisible && terminalContainer != null;
const agentsShowing = agentsVisible && agentsContainer != null;
// Report the attach points up to EditorPane (which owns the long-lived session
// hosts). EditorArea only says where to attach — the VS Code / Zed pattern of
// owning the terminal above the layout that changes.
useEffect(() => {
onSessionPlacements?.({
- terminal: { container: bottomTerminalContainer, isShowing: terminalShowing },
+ terminal: { container: terminalContainer, isShowing: terminalShowing },
agents: { container: agentsContainer, isShowing: agentsShowing },
editorRegion: terminalEditorRegion,
});
}, [
onSessionPlacements,
- bottomTerminalContainer,
+ terminalContainer,
terminalShowing,
agentsContainer,
agentsShowing,
@@ -573,10 +607,33 @@ function EditorAreaInner({
}, 100);
}
+ const [initialTerminalWidthPx] = useState(() =>
+ Math.max(
+ terminalRightWidth ?? PREFERRED_TERMINAL_RIGHT_WIDTH,
+ RIGHT_TERMINAL_PANEL_MIN_WIDTH_PX,
+ ),
+ );
+ const terminalDefaultWidthPx = Math.max(
+ terminalRightWidth ?? initialTerminalWidthPx,
+ RIGHT_TERMINAL_PANEL_MIN_WIDTH_PX,
+ );
+ const terminalWidthPxRef = useRef(initialTerminalWidthPx);
+ const [isDraggingTerminalHandle, setIsDraggingTerminalHandle] = useState(false);
+ const isDraggingTerminalHandleRef = useRef(false);
+ const terminalWriteTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
+ function debouncedWriteTerminalWidth(px: number) {
+ if (terminalWriteTimerRef.current != null) clearTimeout(terminalWriteTimerRef.current);
+ terminalWriteTimerRef.current = setTimeout(() => {
+ onTerminalRightWidthChange?.(px);
+ terminalWriteTimerRef.current = null;
+ }, 100);
+ }
+
useEffect(
() => () => {
if (writeTimerRef.current != null) clearTimeout(writeTimerRef.current);
if (agentsWriteTimerRef.current != null) clearTimeout(agentsWriteTimerRef.current);
+ if (terminalWriteTimerRef.current != null) clearTimeout(terminalWriteTimerRef.current);
},
[],
);
@@ -620,18 +677,12 @@ function EditorAreaInner({
// panel. Only a full-layout write can route deltas to the editor. The layout
// math lives in `computeStickyRepinLayout` (unit-tested).
const groupRef = useGroupRef();
- // Live mirror of `agentsColumnPresent` for subscribers with narrow deps.
- const agentsColumnPresentRef = useRef(agentsColumnPresent);
- useEffect(() => {
- agentsColumnPresentRef.current = agentsColumnPresent;
- }, [agentsColumnPresent]);
-
// Pixel basis for px→% conversion in `assertRightRailLayout`. Layout
// percentages are relative to the group's panel space; derive the basis from
// a panel whose percentage and pixel width are both known (immune to the
// separator widths the container includes), falling back to the container.
function resolveGroupPxWidth(): number | null {
- for (const ref of [panelRef, agentsColumnPanelRef]) {
+ for (const ref of [panelRef, terminalColumnPanelRef, agentsColumnPanelRef]) {
const size = ref.current?.getSize();
// The `> 1` floor excludes collapsed/near-zero panels: px / ~0% diverges
// (Infinity at exactly 0), which would corrupt every layout assertion
@@ -644,55 +695,274 @@ function EditorAreaInner({
return el != null && el.offsetWidth > 0 ? el.offsetWidth : null;
}
- // Write the intended right-rail layout in one `setLayout` call: the doc
- // panel at its persisted width (or pinned shut at 0 when collapsed), the
- // agents column at its persisted width, other rail panels (agent-panel)
- // untouched, and the EDITOR absorbing the remainder. This is the single
- // correction primitive for every path where the library would otherwise
- // misroute space.
- function assertRightRailLayout(docCollapsed: boolean) {
- if (isDraggingDocHandleRef.current || isDraggingAgentsHandleRef.current) return;
+ function resolveAdmissionMetrics(): {
+ workspaceWidthPx: number;
+ otherRailWidthPx: number;
+ } | null {
+ const group = groupRef.current;
+ if (group == null) return null;
+ try {
+ const workspaceWidthPx = resolveGroupPxWidth();
+ if (workspaceWidthPx == null) return null;
+ const layout = group.getLayout();
+ const otherRailPresent = DOC_PANEL_ID in layout || AGENT_PANEL_ID in layout;
+ if (!otherRailPresent) {
+ return { workspaceWidthPx, otherRailWidthPx: 0 };
+ }
+ // A collapsed document pane still counts, at its floor. It measures zero
+ // right now, but the user can reopen it at any moment — and reopening
+ // needs a whole 300px to appear from somewhere. Admitting both session
+ // columns on the strength of that zero produces a rail where no panel can
+ // spare 300px: the pane cannot come back, and the separators on either
+ // side of it have no legal move in either direction. Counting it at its
+ // floor is what keeps the rail one the user can still work.
+ const measuredWidthPx = panelRef.current?.getSize().inPixels;
+ const docWidthPx =
+ measuredWidthPx != null && measuredWidthPx > 0
+ ? measuredWidthPx
+ : docPanelWidthPxRef.current;
+ return {
+ workspaceWidthPx,
+ otherRailWidthPx: Math.max(docWidthPx, DOC_PANEL_MIN_WIDTH_PX),
+ };
+ } catch (error) {
+ reportUnexpectedPanelGroupFailure('resolve-admission-metrics-failed', error);
+ return null;
+ }
+ }
+
+ type AdmissionVisibility = {
+ readonly terminalRightVisible: boolean;
+ readonly agentsVisible: boolean;
+ };
+ const admissionVisibility: AdmissionVisibility = {
+ terminalRightVisible: terminalColumnPresent,
+ agentsVisible,
+ };
+ const admissionVisibilityRef = useRef(admissionVisibility);
+ const previousAdmissionVisibilityRef = useRef(admissionVisibility);
+ const previousAdmissionCollapsedRef = useRef(isCollapsed);
+ const pendingAdmissionCloseRef = useRef<'close-agents' | 'close-terminal' | null>(null);
+
+ function enforceRightRailAdmission(
+ trigger: 'state-change' | 'resize',
+ previous: AdmissionVisibility,
+ ) {
+ const metrics = resolveAdmissionMetrics();
+ if (metrics == null) return;
+ const decision = resolveRightRailAdmission({
+ ...metrics,
+ agentsMinimumWidthPx: MIN_AGENTS_PANEL_WIDTH,
+ previous,
+ current: admissionVisibilityRef.current,
+ trigger,
+ });
+ if (decision.kind === 'none' || pendingAdmissionCloseRef.current === decision.kind) return;
+
+ if (decision.kind === 'close-agents') {
+ if (onAgentsVisibleChange == null) return;
+ pendingAdmissionCloseRef.current = decision.kind;
+ onAgentsVisibleChange(false);
+ toast.info(t`Agent panel closed to keep Terminal readable.`);
+ return;
+ }
+
+ if (onTerminalVisibleChange == null) return;
+ pendingAdmissionCloseRef.current = decision.kind;
+ onTerminalVisibleChange(false);
+ toast.info(t`Terminal closed to make room for the agent panel.`);
+ }
+
+ const enforceRightRailAdmissionRef = useRef(enforceRightRailAdmission);
+ useLayoutEffect(() => {
+ enforceRightRailAdmissionRef.current = enforceRightRailAdmission;
+ admissionVisibilityRef.current = admissionVisibility;
+ });
+
+ useLayoutEffect(() => {
+ if (!agentsVisible && pendingAdmissionCloseRef.current === 'close-agents') {
+ pendingAdmissionCloseRef.current = null;
+ }
+ if (!terminalColumnPresent && pendingAdmissionCloseRef.current === 'close-terminal') {
+ pendingAdmissionCloseRef.current = null;
+ }
+ const previous = previousAdmissionVisibilityRef.current;
+ const previousCollapsed = previousAdmissionCollapsedRef.current;
+ previousAdmissionVisibilityRef.current = {
+ terminalRightVisible: terminalColumnPresent,
+ agentsVisible,
+ };
+ previousAdmissionCollapsedRef.current = isCollapsed;
+ queueMicrotask(() => {
+ enforceRightRailAdmissionRef.current(
+ previousCollapsed === isCollapsed ? 'state-change' : 'resize',
+ previous,
+ );
+ });
+ }, [agentsVisible, terminalColumnPresent, isCollapsed]);
+
+ // The single rail-layout primitive: pin every rail column to the pixel width
+ // its visibility calls for — zero when shut — and let the EDITOR absorb the
+ // remainder.
+ //
+ // It has to be a whole-group `setLayout`. The per-panel `collapse()` /
+ // `expand()` / `resize()` are implemented as a simulated drag of the panel's
+ // ADJACENT separator, so they trade with whichever rail column happens to sit
+ // beside the one being changed — and when that neighbour is itself shut, it
+ // has no width to give and the call silently does nothing at all. Writing the
+ // layout takes the width from the editor instead, which is also what the rail
+ // promises: every rail change trades with the editor, never with another rail.
+ //
+ // What made this unsafe before was not `setLayout` but the panel set moving
+ // underneath it — columns mounting and unmounting, so a fresh panel joined an
+ // already-full group and got whatever was left. The columns are permanent
+ // now, and a shut one is simply a zero-width member.
+ function applyRailLayout(docCollapsed: boolean): boolean {
const group = groupRef.current;
- if (group == null) return;
- // Only the library reads are guarded. The imperative handles throw once
- // their group/panel has unregistered, and this can run from a deferred
- // microtask racing a view-kind remount — a torn-down group just means
- // there is no layout left to correct. The layout math between the guards
- // is ours: swallowing its errors would hide a real bug behind the same
- // silent no-op.
+ if (group == null) return false;
+ // Only the library calls are guarded: the imperative handles throw once
+ // their group has unregistered, and this can run from a deferred callback
+ // racing a view-kind remount. The layout math between them is ours —
+ // swallowing its errors would hide a real bug behind a silent no-op.
let containerPx: number | null;
let layout: Record<string, number>;
try {
containerPx = resolveGroupPxWidth();
layout = group.getLayout();
- } catch {
- return;
+ } catch (error) {
+ reportUnexpectedPanelGroupFailure('apply-rail-layout-read-failed', error);
+ return false;
}
- if (containerPx == null) return;
- const ids = Object.keys(layout);
- if (ids.length === 0) return;
- const residualId = ids.find((id) => !RIGHT_PANEL_IDS.has(id));
- if (residualId == null) return;
- const pinnedPx: Record<string, number> = {};
- if ('doc-panel' in layout) {
- pinnedPx['doc-panel'] = docCollapsed ? 0 : docPanelWidthPxRef.current;
- }
- if ('agents-column' in layout) {
- pinnedPx['agents-column'] = agentsWidthPxRef.current;
+ if (containerPx == null) return false;
+ const accounting = accountRailLayout(Object.keys(layout));
+ if (!accounting.ok) {
+ if (import.meta.env.DEV) {
+ console.warn(
+ JSON.stringify({
+ event: 'right-rail-accounting-failed',
+ unaccountedIds: accounting.unaccountedIds,
+ }),
+ );
+ }
+ return false;
}
- if (Object.keys(pinnedPx).length === 0) return;
- const next = computeStickyRepinLayout({
+ const residualId = accounting.residualId;
+ if (residualId == null) return false;
+
+ const buildPins = (atFloor: boolean): Record<string, number> => {
+ const pins: Record<string, number> = {};
+ if (DOC_PANEL_ID in layout) {
+ pins[DOC_PANEL_ID] = docCollapsed
+ ? 0
+ : atFloor
+ ? DOC_PANEL_MIN_WIDTH_PX
+ : docPanelWidthPxRef.current;
+ }
+ if (TERMINAL_COLUMN_ID in layout) {
+ pins[TERMINAL_COLUMN_ID] = !admissionVisibilityRef.current.terminalRightVisible
+ ? 0
+ : atFloor
+ ? RIGHT_TERMINAL_PANEL_MIN_WIDTH_PX
+ : terminalWidthPxRef.current;
+ }
+ if (AGENTS_COLUMN_ID in layout) {
+ pins[AGENTS_COLUMN_ID] = !admissionVisibilityRef.current.agentsVisible
+ ? 0
+ : atFloor
+ ? MIN_AGENTS_PANEL_WIDTH
+ : agentsWidthPxRef.current;
+ }
+ return pins;
+ };
+
+ const pinnedPx = buildPins(false);
+ if (Object.keys(pinnedPx).length === 0) return false;
+
+ let next = computeStickyRepinLayout({
currentLayout: layout,
containerPx,
pinnedPx,
residualId,
});
- if (next === layout) return;
+ // The preferred widths did not fit. Retry with every open column at its
+ // floor rather than leaving the rail as it was: giving up here is what
+ // opened a column the app believes is visible at zero width, with a live
+ // handle that can move nothing.
+ if (next === layout) {
+ next = computeStickyRepinLayout({
+ currentLayout: layout,
+ containerPx,
+ pinnedPx: buildPins(true),
+ residualId,
+ });
+ }
+ if (next === layout) return true;
try {
group.setLayout(next);
- } catch {
- // Unregistered between the read and the write.
+ } catch (error) {
+ reportUnexpectedPanelGroupFailure('apply-rail-layout-write-failed', error);
+ return false;
}
+ return true;
+ }
+
+ // A hidden column must stay at zero width, and pinning it once is not enough:
+ // the library redistributes space across the whole group on any drag, and a
+ // collapsed member can be handed width by a drag that never touched it. Left
+ // there, the rail carries a column the app believes is closed — no admission
+ // check counts it, no toggle owns it, and it silently eats the editor until
+ // nothing on the rail can move. Snapping it back the moment it grows keeps
+ // "hidden" and "zero width" the same fact.
+ function reclaimHiddenRailColumn(columnId: string, present: boolean, widthPx: number) {
+ if (present || widthPx <= 0) return;
+ queueMicrotask(() => {
+ const group = groupRef.current;
+ if (group == null) return;
+ let layout: Record<string, number>;
+ let containerPx: number | null;
+ try {
+ layout = group.getLayout();
+ containerPx = resolveGroupPxWidth();
+ } catch (error) {
+ // The group can unregister between the queued callback and this read.
+ reportUnexpectedPanelGroupFailure('reclaim-hidden-rail-read-failed', error);
+ return;
+ }
+ if (containerPx == null || !(columnId in layout) || layout[columnId] === 0) return;
+ const residualId = findResidualPanelId(Object.keys(layout));
+ if (residualId == null) return;
+ // Zero only the offending column and hand its width to the editor. A
+ // whole-rail re-pin here would also snap the other columns back to their
+ // persisted widths, undoing the very drag that displaced this one.
+ const next = computeStickyRepinLayout({
+ currentLayout: layout,
+ containerPx,
+ pinnedPx: { [columnId]: 0 },
+ residualId,
+ });
+ if (next === layout) return;
+ try {
+ group.setLayout(next);
+ } catch (error) {
+ // The group can unregister between the read and the write.
+ reportUnexpectedPanelGroupFailure('reclaim-hidden-rail-write-failed', error);
+ }
+ });
+ }
+
+ function assertRightRailLayout(docCollapsed: boolean) {
+ if (
+ isDraggingDocHandleRef.current ||
+ isDraggingTerminalHandleRef.current ||
+ isDraggingAgentsHandleRef.current
+ )
+ return;
+ // Record the intent before applying it. The write changes panel widths,
+ // which fires the ResizeObserver below synchronously — and that re-asserts
+ // from this ref, which React's own state effect has not caught up to yet.
+ // Without this the correction would immediately undo itself.
+ isCollapsedRef.current = docCollapsed;
+ applyRailLayout(docCollapsed);
}
// Latest-ref mirror of the assert for effects that must NOT re-run on render
@@ -772,16 +1042,47 @@ function EditorAreaInner({
// both window listeners on a component React has already torn down.
useEffect(() => () => endHandleDragRef.current?.(), []);
+ // A rail column's visibility is a width, not a mount: both columns are
+ // permanent members of the group, so "hidden" is simply zero width.
+ function syncRailColumns(): boolean {
+ // A live drag owns the layout; correcting under it would fight the pointer.
+ if (
+ isDraggingDocHandleRef.current ||
+ isDraggingTerminalHandleRef.current ||
+ isDraggingAgentsHandleRef.current
+ )
+ return true;
+ return applyRailLayout(isCollapsedRef.current);
+ }
+
+ // `syncRailColumns` is redeclared every render and reads live refs; the
+ // visibility flags are the edges that must re-run it, and listing the function
+ // itself would re-run it on every render instead.
+ // biome-ignore lint/correctness/useExhaustiveDependencies: see above.
+ useEffect(() => {
+ const frameRef = { id: 0 };
+ // The group may not have registered — or may not have measured a width —
+ // on the render that flipped visibility. Retry by frame instead of waiting
+ // for another visibility change that may never come; bounded so a rail that
+ // never registers (its view kind does not mount one) cannot spin forever.
+ const attempt = (attemptsLeft: number) => {
+ if (syncRailColumns() || attemptsLeft <= 0) return;
+ frameRef.id = requestAnimationFrame(() => attempt(attemptsLeft - 1));
+ };
+ attempt(30);
+ return () => {
+ if (frameRef.id !== 0) cancelAnimationFrame(frameRef.id);
+ };
+ }, [terminalColumnPresent, agentsColumnPresent]);
+
// Expand the doc panel from a non-toggle path (tab request, avatar click,
- // width-threshold crossing). Same routing rule as togglePanel: with the
- // agents column mounted, go through the full-layout assert so the width
- // comes from the editor rather than the agents column.
+ // width-threshold crossing). The terminal and agents columns are permanent
+ // group members even while hidden at zero width, so the panel API would try
+ // to trade with a zero-width neighbor and silently do nothing. Route every
+ // transition through the full-group layout instead.
function expandDocPanel() {
- if (agentsColumnPresentRef.current) {
- assertRightRailLayout(false);
- } else {
- panelRef.current?.expand();
- }
+ if (panelRef.current == null) return;
+ assertRightRailLayout(false);
}
function togglePanel() {
@@ -794,23 +1095,15 @@ function EditorAreaInner({
// threshold and immediately invokes the toggle before React commits the
// new partition.
const partition = rightPartitionRef.current;
- // With the agents column mounted, expand/collapse must route through the
- // full-layout assert so the space comes from / returns to the editor — the
- // per-panel APIs would exchange it with the agents column instead.
+ // The permanent rail columns remain adjacent at zero width while hidden.
+ // A per-panel expand/collapse would exchange with that zero-width neighbor
+ // and no-op, so every transition must route through the editor residual.
if (isCollapsed) {
applyToggle('right', partition, 'open');
- if (agentsColumnPresentRef.current) {
- assertRightRailLayout(false);
- } else {
- panelRef.current?.expand();
- }
+ assertRightRailLayout(false);
} else {
applyToggle('right', partition, 'collapsed');
- if (agentsColumnPresentRef.current) {
- assertRightRailLayout(true);
- } else {
- panelRef.current?.collapse();
- }
+ assertRightRailLayout(true);
}
}
@@ -827,19 +1120,12 @@ function EditorAreaInner({
// but until it does any effect reading `isCollapsed` (focus-safety,
// notifyViewMenuStateChanged) would see the pre-collapse value.
setIsCollapsed(nextCollapsed);
- if (agentsColumnPresentRef.current) {
- assertRightRailLayout(nextCollapsed);
- } else if (nextCollapsed) {
- panelRef.current?.collapse();
- } else {
- panelRef.current?.expand();
- }
+ assertRightRailLayout(nextCollapsed);
};
mql.addEventListener('change', onChange);
return () => mql.removeEventListener('change', onChange);
}, [
embeddedHost,
- panelRef,
// biome-ignore lint/correctness/useExhaustiveDependencies: assertRightRailLayout is render-bound; re-subscribing keeps the handler fresh (mirrors the ⌥⌘B menu effect below)
assertRightRailLayout,
]);
@@ -864,6 +1150,7 @@ function EditorAreaInner({
// observer per render would re-assert the layout on every render.
const ro = new ResizeObserver(() => {
assertRightRailLayoutRef.current(isCollapsedRef.current);
+ enforceRightRailAdmissionRef.current('resize', admissionVisibilityRef.current);
});
ro.observe(groupContainerEl);
return () => ro.disconnect();
@@ -916,19 +1203,20 @@ function EditorAreaInner({
// panel-set change triggers, so the correction is deferred one microtask to
// land after it (still ahead of paint — `setLayout` notifies the panels'
// external stores synchronously).
- const prevAgentsColumnPresentRef = useRef(agentsColumnPresent);
+ const panelSetKey = `${terminalColumnPresent}:${agentsColumnPresent}`;
+ const previousPanelSetKeyRef = useRef(panelSetKey);
useLayoutEffect(() => {
- if (prevAgentsColumnPresentRef.current === agentsColumnPresent) return;
- prevAgentsColumnPresentRef.current = agentsColumnPresent;
+ if (previousPanelSetKeyRef.current === panelSetKey) return;
+ previousPanelSetKeyRef.current = panelSetKey;
const docCollapsed = isCollapsed;
queueMicrotask(() => {
assertRightRailLayoutRef.current(docCollapsed);
});
- }, [agentsColumnPresent, isCollapsed]);
+ }, [panelSetKey, isCollapsed]);
useLayoutEffect(() => {
if (!isCollapsed) return;
- const panelEl = document.getElementById('doc-panel');
+ const panelEl = document.getElementById(DOC_PANEL_ID);
if (!panelEl?.contains(document.activeElement)) return;
const toggle = document.querySelector<HTMLElement>('[data-doc-panel-toggle]');
if (toggle) {
@@ -1070,7 +1358,7 @@ function EditorAreaInner({
<ResizableHandle withHandle />
{/* Non-collapsible — folder view has no toolbar toggle; dismiss via avatar re-click. */}
<ResizablePanel
- id="agent-panel"
+ id={AGENT_PANEL_ID}
defaultSize="25%"
minSize="300px"
maxSize="40%"
@@ -1186,7 +1474,7 @@ function EditorAreaInner({
// sticky-width restore is not corrupted by a 1→3 transition.
viewContent = <EditorSkeleton />;
// A ref-free placeholder that mirrors the doc-panel's id + sizing so
- // react-resizable-panels treats it as the same `id="doc-panel"` element
+ // react-resizable-panels treats it as the same doc-panel element
// across skeleton → doc and preserves its pixel width. It carries no
// panelRef/onResize/drag handlers — those read refs and the load window
// is brief and non-interactive — which also keeps this off the React
@@ -1195,7 +1483,7 @@ function EditorAreaInner({
<>
<ResizableHandle withHandle disabled />
<ResizablePanel
- id="doc-panel"
+ id={DOC_PANEL_ID}
defaultSize={initialRightCollapsed ? 0 : `${initialDocPanelWidthPx}px`}
minSize={DOC_PANEL_MIN_SIZE}
maxSize={DOC_PANEL_MAX_SIZE}
@@ -1393,13 +1681,17 @@ function EditorAreaInner({
// editor. Neutralize the panel itself: `disabled` makes drag redistribution
// skip it (deltas flow through to the editor) and `minSize 0` disarms the
// snap-expand threshold. Imperative paths (`setLayout`, `expand`) still
- // move it, so the toolbar toggle keeps working. Scoped to
- // agents-column-present: without that column no drag can reach the
- // collapsed panel at all.
- const docPanelNeutralized = agentsColumnPresent && isCollapsed;
+ // move it, so the toolbar toggle keeps working. Scoped to a resizable rail
+ // being present: without one no drag can reach the collapsed panel at all.
+ // A collapsed panel stays a NORMAL member of the group. Disabling it (the
+ // previous behaviour) is what turned a collapsed interior panel into a dead
+ // neighbour: the handle beside it had nothing to trade against and moved
+ // nothing. Left enabled, the library snap-expands it instead — visible
+ // movement rather than a frozen rail.
rightPanel = (
<>
<ResizableHandle
+ data-doc-panel-handle=""
// No visible grip while collapsed — there is nothing to drag.
withHandle={!isCollapsed}
// A collapsed panel is not drag-resizable: the toolbar toggle and
@@ -1416,11 +1708,10 @@ function EditorAreaInner({
}}
/>
<ResizablePanel
- id="doc-panel"
+ id={DOC_PANEL_ID}
panelRef={panelRef}
- disabled={docPanelNeutralized}
defaultSize={initialRightCollapsed ? 0 : `${initialDocPanelWidthPx}px`}
- minSize={docPanelNeutralized ? '0px' : DOC_PANEL_MIN_SIZE}
+ minSize={DOC_PANEL_MIN_SIZE}
maxSize={DOC_PANEL_MAX_SIZE}
collapsible
collapsedSize={0}
@@ -1578,10 +1869,12 @@ function EditorAreaInner({
// renders on every host; where no shell can spawn it simply stays collapsed.
// The live session host lives in EditorPane (above this component) so a
// view-kind change — which remounts EditorArea's subtree — can't re-spawn it.
- // Here we render only the bottom layout
- // shell, which reports its mount + editor region up (via onSessionPlacements).
+ // Here we render the placement-aware layout shell, which reports its bottom
+ // mount + editor region up (via onSessionPlacements); the right mount lives in
+ // the horizontal rail below.
const leftColumn = (
<TerminalDock
+ placement={terminalPlacement}
visible={terminalVisible}
onVisibleChange={onTerminalVisibleChange ?? (() => {})}
onBottomContainer={setBottomTerminalContainer}
@@ -1599,15 +1892,70 @@ function EditorAreaInner({
</TerminalDock>
);
- // The terminal column sits to the RIGHT of the doc/agent panel
- // (MD | PANE | AGENTS) — the far-right column, its own independent resizable
- // column rather than a tenant of the panel region. The mount div is a callback
- // ref so the session host (owned in EditorPane) portals into it; it unmounts to
- // null when the panel hides.
- const agentsColumn = agentsColumnPresent ? (
+ // The rail's panel set is FIXED: this column is always a member of the group
+ // and represents "hidden" as collapsed, never as unmounted.
+ //
+ // Mounting a column into an already-full group is what starved it — the
+ // library has only the leftover to give a new member, which measured as ~1%
+ // of the group against its own 320px minimum, and a column that small drags
+ // the whole rail into states it cannot resolve. A column that is always
+ // present never has to be inserted, so there is no leftover to land in.
+ const terminalColumn = (
<>
<ResizableHandle
- withHandle
+ withHandle={terminalColumnPresent}
+ className={terminalColumnPresent ? undefined : 'pointer-events-none'}
+ onPointerDown={(event) => {
+ trackHandleDrag(
+ event.pointerId,
+ setIsDraggingTerminalHandle,
+ isDraggingTerminalHandleRef,
+ () => {
+ // Drag-to-close, as the agents column has. The column is
+ // collapsible now that it never unmounts, so a drag can shut it —
+ // and a column sitting at zero width while the app still believes
+ // it is visible has no handle grip and no way back.
+ if (terminalColumnPanelRef.current?.isCollapsed()) {
+ onTerminalVisibleChange?.(false);
+ }
+ },
+ );
+ }}
+ />
+ <ResizablePanel
+ id={TERMINAL_COLUMN_ID}
+ panelRef={terminalColumnPanelRef}
+ defaultSize={terminalColumnPresent ? `${terminalDefaultWidthPx}px` : 0}
+ minSize={`${RIGHT_TERMINAL_PANEL_MIN_WIDTH_PX}px`}
+ collapsible
+ collapsedSize={0}
+ onResize={(size) => {
+ if (size.inPixels > 0 && isDraggingTerminalHandleRef.current) {
+ terminalWidthPxRef.current = size.inPixels;
+ debouncedWriteTerminalWidth(size.inPixels);
+ }
+ reclaimHiddenRailColumn(TERMINAL_COLUMN_ID, terminalColumnPresent, size.inPixels);
+ }}
+ className="flex flex-col"
+ >
+ <div
+ ref={setRightTerminalContainer}
+ data-terminal-panel-mount=""
+ className="flex min-h-0 flex-1 flex-col overflow-hidden"
+ />
+ </ResizablePanel>
+ </>
+ );
+
+ // The agents column sits to the right of the terminal rail
+ // (MD | PANE | TERMINAL | AGENTS), as its own independent resizable column.
+ // Like the terminal column it is a permanent member of the group and shows
+ // "hidden" as collapsed — see the note there for why membership is fixed.
+ const agentsColumn = (
+ <>
+ <ResizableHandle
+ withHandle={agentsColumnPresent}
+ className={agentsColumnPresent ? undefined : 'pointer-events-none'}
onPointerDown={(event) => {
trackHandleDrag(
event.pointerId,
@@ -1615,9 +1963,9 @@ function EditorAreaInner({
isDraggingAgentsHandleRef,
() => {
// Drag-to-close: releasing with the column snapped shut hides the
- // agents panel (unmounting the column), mirroring the doc panel's
- // drag-to-close affordance. Deferred to the release — hiding
- // mid-drag would unmount the separator under the active drag.
+ // agents panel while its permanent rail member stays collapsed,
+ // mirroring the doc panel's drag-to-close affordance. Deferred to
+ // release so visibility does not change under the active drag.
if (agentsColumnPanelRef.current?.isCollapsed()) {
onAgentsVisibleChange?.(false);
}
@@ -1626,9 +1974,9 @@ function EditorAreaInner({
}}
/>
<ResizablePanel
- id="agents-column"
+ id={AGENTS_COLUMN_ID}
panelRef={agentsColumnPanelRef}
- defaultSize={`${initialAgentsWidthPx}px`}
+ defaultSize={agentsColumnPresent ? `${initialAgentsWidthPx}px` : 0}
minSize={`${MIN_AGENTS_PANEL_WIDTH}px`}
// The panel can be dragged wide — up to 95% of the group — leaving the
// editor a 5% sliver (its panel `minSize` while this column is mounted).
@@ -1646,6 +1994,7 @@ function EditorAreaInner({
agentsWidthPxRef.current = size.inPixels;
debouncedWriteAgentsWidth(size.inPixels);
}
+ reclaimHiddenRailColumn(AGENTS_COLUMN_ID, agentsColumnPresent, size.inPixels);
}}
className="flex flex-col"
>
@@ -1657,12 +2006,12 @@ function EditorAreaInner({
/>
</ResizablePanel>
</>
- ) : null;
+ );
// The editor absorbs the residual width whenever something on the right claims
- // space — the doc panel (when present and not collapsed) or the agents column.
+ // space — the doc panel (when present and not collapsed) or a resizable rail.
const editorAbsorbsResidual =
- (rightPanel != null && !initialRightCollapsed) || agentsColumnPresent;
+ (rightPanel != null && !initialRightCollapsed) || resizableRailColumnPresent;
// The agents reveal tab pins to the far-right column edge here; the terminal's
// tab lives inside TerminalDock, pinned to the bottom of the editor column.
@@ -1688,25 +2037,26 @@ function EditorAreaInner({
<ResizablePanelGroup
orientation="horizontal"
groupRef={groupRef}
- data-dragging={isDraggingDocHandle || isDraggingAgentsHandle || undefined}
+ data-dragging={
+ isDraggingDocHandle || isDraggingTerminalHandle || isDraggingAgentsHandle || undefined
+ }
>
<ResizablePanel
// No explicit id: an id here changed how react-resizable-panels
// redistributes on imperative resize and broke the doc-panel
// pixel-width sticky restore. The
// left panel is always the first child, so React keeps it mounted
- // across right-side toggles without one (the terminal still persists).
+ // across right-side toggles without one (the terminal host remains mounted).
//
- // With the agents column mounted the editor yields to a 5% sliver so
- // the panel can be dragged near-full width without ever fully
- // eclipsing the editor — the horizontal mirror of the bottom dock's
- // 95%/5% split (see the terminal column's maxSize below; the pair must
- // sum to 100% or the drag can't reach the max). Without the terminal
- // the 30% floor keeps the editor usable against the doc panel.
- minSize={agentsColumnPresent ? '5%' : '30%'}
+ // With a resizable rail mounted the editor yields to a 5% sliver. That
+ // keeps the agents panel's 95% maximum reachable while allowing the
+ // terminal rail to expand against the residual without its own maximum.
+ // Without a rail the 30% floor keeps the editor usable against the doc
+ // panel.
+ minSize={resizableRailColumnPresent ? '5%' : '30%'}
// Editor takes full width only when nothing on the right claims space;
// otherwise it absorbs the residual while the pixel-sized doc panel and
- // agents column hold their widths.
+ // resizable rails hold their widths.
{...(editorAbsorbsResidual ? {} : { defaultSize: '100%' })}
>
<div ref={setWorkspaceColumnEl} className="flex h-full min-w-0 flex-col">
@@ -1714,6 +2064,7 @@ function EditorAreaInner({
</div>
</ResizablePanel>
{rightPanel}
+ {terminalColumn}
{agentsColumn}
</ResizablePanelGroup>
{rightRevealTabPresent ? (
diff --git a/packages/app/src/components/EditorPane.dom.test.tsx b/packages/app/src/components/EditorPane.dom.test.tsx
index 3ee953230..11351fe49 100644
--- a/packages/app/src/components/EditorPane.dom.test.tsx
+++ b/packages/app/src/components/EditorPane.dom.test.tsx
@@ -190,10 +190,18 @@ vi.doMock('./EditorHeader', () => ({
vi.doMock('./EditorArea', () => ({
EditorArea: ({
renderWorkspaceHeader,
+ terminalPlacement,
+ terminalRightWidth,
}: {
renderWorkspaceHeader?: (tabs: ReactNode) => ReactNode;
+ terminalPlacement?: string;
+ terminalRightWidth?: number;
}) => (
- <div data-testid="editor-area">
+ <div
+ data-testid="editor-area"
+ data-terminal-placement={terminalPlacement}
+ data-terminal-right-width={terminalRightWidth}
+ >
{renderWorkspaceHeader?.(<div data-testid="workspace-tabs" />)}
</div>
),
@@ -213,6 +221,9 @@ vi.doMock('./SessionsHost', () => ({
surface,
bridge,
terminalCapable,
+ terminalPlacement,
+ onTerminalPlacementChange,
+ reserveRightRevealTabGutter,
visible,
launch,
threadLaunch,
@@ -220,6 +231,9 @@ vi.doMock('./SessionsHost', () => ({
surface: string;
bridge?: unknown;
terminalCapable?: boolean;
+ terminalPlacement?: string;
+ onTerminalPlacementChange?: (placement: 'bottom' | 'right') => void;
+ reserveRightRevealTabGutter?: boolean;
visible?: boolean;
launch?: { nonce: number; stagePaste?: string } | null;
threadLaunch?: { nonce: number; agentId?: string; prompt?: string | null } | null;
@@ -229,12 +243,25 @@ vi.doMock('./SessionsHost', () => ({
data-testid={surface === 'agents-panel' ? 'agents-panel' : 'terminal-dock'}
data-has-bridge={String(bridge != null)}
data-terminal-capable={String(terminalCapable === true)}
+ data-terminal-placement={terminalPlacement}
+ data-reserve-right-reveal-gutter={String(reserveRightRevealTabGutter === true)}
data-visible={String(visible)}
data-launch-nonce={launch ? String(launch.nonce) : 'none'}
data-launch-stage={launch?.stagePaste ?? 'none'}
data-thread-launch-nonce={threadLaunch ? String(threadLaunch.nonce) : 'none'}
data-thread-launch-agent={threadLaunch?.agentId ?? 'none'}
- />
+ >
+ {surface === 'terminal-dock' ? (
+ <>
+ <button type="button" onClick={() => onTerminalPlacementChange?.('right')}>
+ Move mock Terminal right
+ </button>
+ <button type="button" onClick={() => onTerminalPlacementChange?.('bottom')}>
+ Move mock Terminal bottom
+ </button>
+ </>
+ ) : null}
+ </div>
);
},
}));
@@ -451,7 +478,12 @@ describe('EditorPane auto-sync onboarding gate', () => {
// empty `{}` stub would no longer model the boundary now that EditorPane calls
// them on mount. getDockState resolves both panels hidden so the restore is a
// no-op — these tests exercise the start-hidden toggle/launch behavior.
-type DockStateResult = { terminalVisible: boolean; agentPanelVisible: boolean };
+type DockStateResult = {
+ terminalVisible: boolean;
+ agentPanelVisible: boolean;
+ placement?: 'bottom' | 'right';
+ rightWidth?: number;
+};
function makeOkDesktopStub(
getDockState: () => Promise<DockStateResult> = async () => ({
terminalVisible: false,
@@ -464,8 +496,10 @@ function makeOkDesktopStub(
agentPanelVisible?: boolean;
canViewInSource?: boolean;
}> = [];
+ const dockStateUpdates: unknown[] = [];
return {
viewMenuPushes,
+ dockStateUpdates,
dispatchMenuAction(action: string) {
for (const cb of menuHandlers) cb(action);
},
@@ -492,6 +526,9 @@ function makeOkDesktopStub(
},
terminal: {
getDockState,
+ setDockState(state: unknown) {
+ dockStateUpdates.push(state);
+ },
cliInstalledMap: async () => ({
claude: true,
codex: false,
@@ -506,6 +543,7 @@ function makeOkDesktopStub(
describe('EditorPane session-panel wiring', () => {
afterEach(() => {
cleanup();
+ localStorage.clear();
delete (window as { okDesktop?: unknown }).okDesktop;
terminalOpenedCalls.length = 0;
clearSelection();
@@ -592,7 +630,7 @@ describe('EditorPane session-panel wiring', () => {
await renderEditorPane();
expect(screen.getByTestId('terminal-dock').getAttribute('data-visible')).toBe('false');
- // Mount pushes terminalVisible:false so the View menu reads "Show Bottom Dock".
+ // Mount pushes terminalVisible:false so the View menu reads "Show Terminal".
// Both panels push on mount, so name the field rather than taking the last.
expect(desk.viewMenuPushes).toContainEqual({ terminalVisible: false });
@@ -605,6 +643,29 @@ describe('EditorPane session-panel wiring', () => {
expect(desk.viewMenuPushes.at(-1)).toEqual({ terminalVisible: false });
});
+ test('desktop: move-terminal changes home while terminal toggles preserve it', async () => {
+ const desk = makeOkDesktopStub();
+ (window as { okDesktop?: unknown }).okDesktop = desk.stub;
+ await renderEditorPane();
+
+ const placement = () =>
+ screen.getByTestId('editor-area').getAttribute('data-terminal-placement');
+
+ expect(placement()).toBe('bottom');
+
+ act(() => desk.dispatchMenuAction('move-terminal'));
+ expect(placement()).toBe('right');
+
+ act(() => desk.dispatchMenuAction('toggle-terminal'));
+ expect(placement()).toBe('right');
+
+ act(() => desk.dispatchMenuAction('toggle-terminal'));
+ expect(placement()).toBe('right');
+
+ act(() => desk.dispatchMenuAction('move-terminal'));
+ expect(placement()).toBe('bottom');
+ });
+
test('desktop: hiding the terminal clears the launch intent so a reopen is blank (regression)', async () => {
const desk = makeOkDesktopStub();
(window as { okDesktop?: unknown }).okDesktop = desk.stub;
@@ -818,6 +879,7 @@ describe('EditorPane session-panel wiring', () => {
});
test('desktop: a reload with BOTH panels retained restores both', async () => {
+ localStorage.setItem('ok-terminal-placement-v1', 'right');
(window as { okDesktop?: unknown }).okDesktop = {
config: { ptyAvailable: true },
onMenuAction: () => () => {},
@@ -831,6 +893,96 @@ describe('EditorPane session-panel wiring', () => {
expect(screen.getByTestId('agents-panel').getAttribute('data-visible')).toBe('true');
expect(screen.getByTestId('terminal-dock').getAttribute('data-visible')).toBe('true');
+ expect(
+ screen.getByTestId('terminal-dock').getAttribute('data-reserve-right-reveal-gutter'),
+ ).toBe('false');
+ });
+
+ test('desktop: per-install right layout reaches both editor and stable terminal host', async () => {
+ localStorage.setItem('ok-terminal-placement-v1', 'right');
+ localStorage.setItem('ok-terminal-right-width-v1', '812');
+ const desk = makeOkDesktopStub(async () => ({
+ terminalVisible: true,
+ agentPanelVisible: false,
+ }));
+ (window as { okDesktop?: unknown }).okDesktop = desk.stub;
+
+ await renderEditorPane();
+
+ expect(screen.getByTestId('editor-area').getAttribute('data-terminal-placement')).toBe('right');
+ expect(screen.getByTestId('editor-area').getAttribute('data-terminal-right-width')).toBe('812');
+ expect(screen.getByTestId('terminal-dock').getAttribute('data-terminal-placement')).toBe(
+ 'right',
+ );
+ expect(
+ screen.getByTestId('terminal-dock').getAttribute('data-reserve-right-reveal-gutter'),
+ ).toBe('true');
+ expect(desk.dockStateUpdates).toEqual([]);
+ });
+
+ test('desktop: a late project-state restore cannot override a user-owned per-install layout', async () => {
+ localStorage.setItem('ok-terminal-placement-v1', 'right');
+ localStorage.setItem('ok-terminal-right-width-v1', '812');
+ let resolveDockState: ((state: DockStateResult) => void) | undefined;
+ const desk = makeOkDesktopStub(
+ () =>
+ new Promise<DockStateResult>((resolve) => {
+ resolveDockState = resolve;
+ }),
+ );
+ (window as { okDesktop?: unknown }).okDesktop = desk.stub;
+ const { EditorPane } = await import('./EditorPane');
+ render(<EditorPane />);
+
+ expect(screen.getByTestId('editor-area').getAttribute('data-terminal-placement')).toBe('right');
+ expect(screen.getByTestId('editor-area').getAttribute('data-terminal-right-width')).toBe('812');
+
+ await userEvent.click(screen.getByRole('button', { name: 'Move mock Terminal bottom' }));
+ expect(screen.getByTestId('editor-area').getAttribute('data-terminal-placement')).toBe(
+ 'bottom',
+ );
+
+ await act(async () => {
+ resolveDockState?.({
+ terminalVisible: false,
+ agentPanelVisible: false,
+ placement: 'right',
+ rightWidth: 480,
+ });
+ });
+
+ expect(screen.getByTestId('editor-area').getAttribute('data-terminal-placement')).toBe(
+ 'bottom',
+ );
+ expect(screen.getByTestId('editor-area').getAttribute('data-terminal-right-width')).toBe('812');
+ expect(desk.dockStateUpdates).toEqual([]);
+ });
+
+ test('desktop: the stable terminal host can move the shared layout in both directions', async () => {
+ const user = userEvent.setup();
+ (window as { okDesktop?: unknown }).okDesktop = {
+ config: { ptyAvailable: true },
+ onMenuAction: () => () => {},
+ editor: { notifyViewMenuStateChanged() {} },
+ terminal: {
+ getDockState: async () => ({ terminalVisible: true, agentPanelVisible: false }),
+ },
+ };
+ await renderEditorPane();
+
+ await user.click(screen.getByRole('button', { name: 'Move mock Terminal right' }));
+ expect(screen.getByTestId('editor-area').getAttribute('data-terminal-placement')).toBe('right');
+ expect(screen.getByTestId('terminal-dock').getAttribute('data-terminal-placement')).toBe(
+ 'right',
+ );
+
+ await user.click(screen.getByRole('button', { name: 'Move mock Terminal bottom' }));
+ expect(screen.getByTestId('editor-area').getAttribute('data-terminal-placement')).toBe(
+ 'bottom',
+ );
+ expect(screen.getByTestId('terminal-dock').getAttribute('data-terminal-placement')).toBe(
+ 'bottom',
+ );
});
// The agents panel's launch intent had no coverage: the host mock captured
diff --git a/packages/app/src/components/EditorPane.tsx b/packages/app/src/components/EditorPane.tsx
index 6f428f90f..27907bca6 100644
--- a/packages/app/src/components/EditorPane.tsx
+++ b/packages/app/src/components/EditorPane.tsx
@@ -1,4 +1,4 @@
-import type { TerminalCli } from '@inkeep/open-knowledge-core';
+import type { TerminalCli, TerminalPlacement } from '@inkeep/open-knowledge-core';
import {
lazy,
Suspense,
@@ -28,6 +28,8 @@ import { useConfigContext } from '@/lib/config-provider';
import { matchesKeyboardShortcut, matchesRendererShortcut } from '@/lib/keyboard-shortcuts';
import { subscribeLocalMenuAction } from '@/lib/local-menu-action-bus';
import { isOverlayLayerOpen } from '@/lib/overlay-layers';
+import { readTerminalPlacement, writeTerminalPlacement } from '@/lib/terminal-placement-store';
+import { readTerminalRightWidth, writeTerminalRightWidth } from '@/lib/terminal-right-width-store';
import { recordTerminalOpened } from '@/lib/terminal-telemetry';
import { setViewMenuState } from '@/lib/view-menu-state-store';
import { AuthModal } from './AuthModal';
@@ -136,8 +138,8 @@ export function EditorPane({ onOpenSearch }: EditorPaneProps = {}) {
}, [authPromptPending]);
const [activeTab, setActiveTab] = useState<PanelTab>(TABS[0].id);
const [autoSyncOnboardingDismissed, setAutoSyncOnboardingDismissed] = useState(false);
- // Bottom-docked terminal — desktop-only (the bridge is absent in the web
- // host, where a real shell is out of scope). Visibility starts hidden; the
+ // Docked terminal — desktop-only (the bridge is absent in the web host,
+ // where a real shell is out of scope). Visibility starts hidden; the
// Cmd/Ctrl+J + View-menu toggle drives this state (wired below).
const desktopBridge = typeof window !== 'undefined' ? (window.okDesktop ?? null) : null;
// The terminal feature (dock + header New chat / toggle) needs not just a
@@ -152,6 +154,17 @@ export function EditorPane({ onOpenSearch }: EditorPaneProps = {}) {
desktopBridge.terminal != null &&
desktopBridge.config.ptyAvailable === true;
const [terminalVisible, setTerminalVisible] = useState(false);
+ const [terminalRestoreRevealNonce, setTerminalRestoreRevealNonce] = useState(0);
+ const [terminalPlacement, setTerminalPlacement] = useState<TerminalPlacement>(() =>
+ readTerminalPlacement(),
+ );
+ const [terminalRightWidth, setTerminalRightWidth] = useState(() => readTerminalRightWidth());
+ useEffect(() => {
+ writeTerminalPlacement(terminalPlacement);
+ }, [terminalPlacement]);
+ useEffect(() => {
+ writeTerminalRightWidth(terminalRightWidth);
+ }, [terminalRightWidth]);
// The agents panel is independent of the terminal — different edge, different
// kind, its own toggle (⌘L). Universal: agent threads are server-hosted, so it
// works on the web host and where pty does not.
@@ -268,7 +281,7 @@ export function EditorPane({ onOpenSearch }: EditorPaneProps = {}) {
//
// Which panel it lands in is the HOSTS' call, not this pane's: they own the
// live session state and both resolve the same preferred AI, so the passage
- // reuses a running CLI in the bottom dock or an open thread in the agents
+ // reuses a running CLI in the terminal's current dock or an open thread in the agents
// panel, and the winner reveals itself. Resolving here instead would limit ⌘J
// to the CLI slice this pane can see, ignoring a preferred in-app agent — and
// this pane cannot know which panel is the right one anyway.
@@ -297,8 +310,8 @@ export function EditorPane({ onOpenSearch }: EditorPaneProps = {}) {
const sendSelectionToAgentsEvent = useEffectEvent(() => sendSelectionToTerminal(false, 'agents'));
const launchNewChatEvent = useEffectEvent(() => launchNewChat());
- // Bottom-dock toggle, dual-wired like the DocPanel: on desktop the View →
- // Bottom Dock item's ⌘J/Ctrl+J accelerator is OS-captured and dispatches
+ // Terminal visibility is dual-wired like the DocPanel: on desktop the View
+ // item's ⌘J/Ctrl+J accelerator is OS-captured and dispatches
// `toggle-terminal`; the web host has no menu, so a window keydown stands in.
//
// ⌘J is a pure toggle: selection-send moved to ⌘L, whose chord names the panel
@@ -309,6 +322,8 @@ export function EditorPane({ onOpenSearch }: EditorPaneProps = {}) {
return subscribeLocalMenuAction((action) => {
if (action === 'toggle-terminal') {
setTerminalVisible((visible) => !visible);
+ } else if (action === 'move-terminal') {
+ setTerminalPlacement((placement) => (placement === 'bottom' ? 'right' : 'bottom'));
} else if (action === 'new-terminal') {
// Terminal menu "New Terminal": reveal the dock (it never hides, unlike
// the toggle). The dock adds the new tab itself off the same action; this
@@ -359,7 +374,7 @@ export function EditorPane({ onOpenSearch }: EditorPaneProps = {}) {
// of the shortcut is menu-delivered. Add one the menu cannot carry — an
// Electron menu item holds a single accelerator — and that binding becomes
// undeliverable on desktop, silently. The fix then is to stay mounted and
- // filter by `matchesRendererShortcut`, as the bottom-dock listener above does.
+ // filter by `matchesRendererShortcut`, as the Terminal listener above does.
useEffect(() => {
if (window.okDesktop != null) return;
function handleKeyDown(event: KeyboardEvent) {
@@ -458,7 +473,7 @@ export function EditorPane({ onOpenSearch }: EditorPaneProps = {}) {
}, [terminalVisible]);
// Reflect terminal visibility to main so the View menu label flips between
- // "Show Bottom Dock" and "Hide Bottom Dock". Gated on the dock-state restore so the
+ // "Show Terminal" and "Hide Terminal". Gated on the dock-state restore so the
// mount-initial `false` can't overwrite main's retained per-window visibility
// before the restore reads it (the reload re-expand depends on that value).
// The first push after the restore settles carries the restored — or
@@ -467,7 +482,7 @@ export function EditorPane({ onOpenSearch }: EditorPaneProps = {}) {
if (window.okDesktop == null) return;
if (!dockRestoreSettled) return;
// Mirror into the renderer store so the Cmd+K palette can show a
- // state-reflecting "Show/Hide Bottom Dock" label (bridge push is main-only).
+ // state-reflecting "Show/Hide Terminal" label (bridge push is main-only).
// Deliberately behind BOTH gates, unlike the unconditional sibling mirrors
// in FileSidebar / EditorArea: publishing the mount-initial `false` before
// the restore settles would flash a wrong palette label on a window whose
@@ -477,6 +492,13 @@ export function EditorPane({ onOpenSearch }: EditorPaneProps = {}) {
window.okDesktop.editor.notifyViewMenuStateChanged({ terminalVisible });
}, [terminalVisible, dockRestoreSettled]);
+ useEffect(() => {
+ if (window.okDesktop == null) return;
+ if (!dockRestoreSettled) return;
+ setViewMenuState({ terminalPlacement });
+ window.okDesktop.editor.notifyViewMenuStateChanged({ terminalPlacement });
+ }, [terminalPlacement, dockRestoreSettled]);
+
// The agents panel's twin of the push above, behind the same restore gate for
// the same reason: its retained per-window visibility is what a reloaded window
// re-expands from, and a mount-initial `false` would overwrite it first.
@@ -550,6 +572,7 @@ export function EditorPane({ onOpenSearch }: EditorPaneProps = {}) {
// The restore — not the user — is driving this reveal; mark it so the
// adoption telemetry below skips it.
restoreRevealRef.current = true;
+ setTerminalRestoreRevealNonce((nonce) => nonce + 1);
setTerminalVisible(true);
})
.catch((err) => {
@@ -714,7 +737,10 @@ export function EditorPane({ onOpenSearch }: EditorPaneProps = {}) {
onActiveTabChange={setActiveTab}
terminalBridge={terminalAvailable ? desktopBridge : null}
terminalVisible={terminalVisible}
+ terminalPlacement={terminalPlacement}
+ terminalRightWidth={terminalRightWidth}
onTerminalVisibleChange={setTerminalVisible}
+ onTerminalRightWidthChange={setTerminalRightWidth}
agentsVisible={agentsVisible}
onAgentsVisibleChange={setAgentsVisible}
onSessionPlacements={setPlacements}
@@ -760,9 +786,13 @@ export function EditorPane({ onOpenSearch }: EditorPaneProps = {}) {
<Suspense fallback={null}>
<SessionsHost
surface="terminal-dock"
+ terminalPlacement={terminalPlacement}
+ onTerminalPlacementChange={setTerminalPlacement}
+ reserveRightRevealTabGutter={terminalPlacement === 'right' && !agentsVisible}
bridge={desktopBridge}
terminalCapable
visible={terminalVisible}
+ terminalRestoreRevealNonce={terminalRestoreRevealNonce}
onVisibleChange={setTerminalVisible}
launch={terminalLaunch}
commandLaunch={terminalCommand}
diff --git a/packages/app/src/components/SessionsHost.tsx b/packages/app/src/components/SessionsHost.tsx
index 9094fa461..ea1924f2e 100644
--- a/packages/app/src/components/SessionsHost.tsx
+++ b/packages/app/src/components/SessionsHost.tsx
@@ -1,6 +1,10 @@
// biome-ignore-all lint/plugin/no-physical-direction-utility: pre-rule backlog — physical margin/padding/inset utilities predate the rule; drain by swapping ml/mr → ms/me, pl/pr → ps/pe, left/right → start/end, then deleting this line. See https://github.com/inkeep/open-knowledge/blob/main/biome-plugins/README.md#no-physical-direction-utilitygrit
-import { TERMINAL_CLIS, type TerminalCli } from '@inkeep/open-knowledge-core';
+import {
+ TERMINAL_CLIS,
+ type TerminalCli,
+ type TerminalPlacement,
+} from '@inkeep/open-knowledge-core';
import type { ThreadInfo, ThreadStatus } from '@inkeep/open-knowledge-core/acp/thread-protocol';
import { useLingui } from '@lingui/react/macro';
import { Loader2, SquareTerminalIcon } from 'lucide-react';
@@ -40,10 +44,11 @@ import {
useOpenAgentThreadTabs,
} from '@/lib/acp/thread-client';
import { stageThreadDraft } from '@/lib/acp/thread-draft-staging';
-import type { OkDesktopBridge } from '@/lib/desktop-bridge-types';
+import type { OkDesktopBridge, OkTerminalRestartSnapshot } from '@/lib/desktop-bridge-types';
import {
type DockSessionOrder,
type DockSurface,
+ readDockRestoreState,
readDockSessionOrder,
readWebDockSessionOrder,
writeDockSessionOrder,
@@ -162,11 +167,11 @@ function focusInsideHost(hostEl: HTMLElement | null): boolean {
}
/**
- * Which surface a host instance is. Each owns one edge and one session kind:
- * the terminal dock owns the bottom and PTYs, the agents panel owns the right
- * and ACP threads, and the standalone terminal window is its own window. The
+ * Which surface a host instance is. Each owns one session kind: the terminal
+ * dock owns PTYs at the currently selected edge, the agents panel owns ACP
+ * threads on the right, and the standalone terminal window is its own window. The
* host is one component because the tab mechanics (order, active tab, rename,
- * reorder, reload placement, focus) are identical across all three; only the
+ * reorder, reload ordering, focus) are identical across all three; only the
* kind gates and chrome differ.
*/
export type SessionSurface = 'terminal-dock' | 'agents-panel' | 'terminal-window';
@@ -247,15 +252,26 @@ interface SessionsHostProps {
*/
readonly terminalCapable?: boolean;
/**
- * Which surface this host is. `'terminal-dock'` is the bottom panel: terminals
- * only, visibility-driven seeding, a collapse control, ⌘1–9 scoped to focus
- * inside the host. `'agents-panel'` is the right panel: agent threads only,
+ * Which surface this host is. `'terminal-dock'` is the movable terminal
+ * workspace: terminals only, visibility-driven seeding, a collapse control,
+ * ⌘1–9 scoped to focus inside the host. `'agents-panel'` is the right panel: agent threads only,
* otherwise identical chrome. `'terminal-window'` is the standalone terminal
* window: terminals only, always visible, seeds its first tab on mount, the tab
* row doubles as the macOS title bar, no collapse control, and ⌘1–9 is
* scope-free.
*/
readonly surface: SessionSurface;
+ readonly terminalPlacement?: TerminalPlacement;
+ /** Moves the docked terminal workspace without changing session ownership. */
+ readonly onTerminalPlacementChange?: (placement: TerminalPlacement) => void;
+ /** Leaves room for the right-edge agents reveal tab in terminal chrome. */
+ readonly reserveRightRevealTabGutter?: boolean;
+ /**
+ * Increments when persisted visibility, rather than a user action, reveals the
+ * dock. The host consumes the token so an unknown PTY inventory cannot be
+ * mistaken for a cold start and synthesize a replacement shell.
+ */
+ readonly terminalRestoreRevealNonce?: number;
/** Controlled visibility. The host reflects it and reports close-last back
* through {@link onVisibleChange}; it never owns it. */
readonly visible: boolean;
@@ -328,6 +344,10 @@ export function SessionsHost({
bridge,
terminalCapable = false,
surface,
+ terminalPlacement = 'bottom',
+ onTerminalPlacementChange,
+ reserveRightRevealTabGutter,
+ terminalRestoreRevealNonce = 0,
visible,
onVisibleChange,
launch = null,
@@ -347,7 +367,7 @@ export function SessionsHost({
// `terminal` surface (a session-only bridge, some E2E hosts, has none).
const terminalAvailable = hostTerminals && terminalCapable && bridge?.terminal != null;
// Which edge this panel occupies — the strip points its collapse chevron by it.
- const edge: SessionPanelEdge = hostThreads ? 'right' : 'bottom';
+ const edge: SessionPanelEdge = hostThreads ? 'right' : terminalPlacement;
// Which per-window record this panel's tab order persists under. The two
// panels persist independently; the standalone window has nothing to restore
// into, so it does not persist at all.
@@ -445,6 +465,7 @@ export function SessionsHost({
const seedOwedRef = useRef(false);
const lastHandledCommandNonceRef = useRef<number | null>(null);
const prevVisibleRef = useRef(isWindow ? false : visible);
+ const consumedRestoreRevealNonceRef = useRef(terminalRestoreRevealNonce);
const ptyIdBySessionRef = useRef(new Map<string, string>());
const stripLaunchNonceRef = useRef(0);
@@ -491,15 +512,21 @@ export function SessionsHost({
* the post-commit refs so it is correct when called from a ptyId callback. */
function persistDockOrderNow() {
if (!persistsOrder) return; // the standalone window IS the surface — nothing to restore into
+ if (canRehydrate && !rehydrationSettled) return;
const ptyMap = ptyIdBySessionRef.current;
const order = sessionsRef.current
.map((session) => computePersistKey(session, ptyMap))
.filter((key): key is string => key != null);
const active = sessionsRef.current.find((s) => s.id === activeSessionIdRef.current);
- writeDockSessionOrder(bridge, persistSurface, {
- order,
- activeKey: active != null ? computePersistKey(active, ptyMap) : null,
- });
+ writeDockSessionOrder(
+ bridge,
+ persistSurface,
+ {
+ order,
+ activeKey: active != null ? computePersistKey(active, ptyMap) : null,
+ },
+ buildTerminalRestartSnapshot(sessionsRef.current, activeSessionIdRef.current),
+ );
}
function setSessionPtyId(id: string, ptyId: string | null) {
@@ -1094,16 +1121,22 @@ export function SessionsHost({
// computation uses only listed deps + the module-pure `computePersistKey`.
useEffect(() => {
if (!persistsOrder) return;
+ if (!rehydrationSettled) return;
const ptyMap = ptyIdBySessionRef.current;
const order = sessions
.map((session) => computePersistKey(session, ptyMap))
.filter((key): key is string => key != null);
const active = sessions.find((s) => s.id === activeSessionId);
- writeDockSessionOrder(bridge, persistSurface, {
- order,
- activeKey: active != null ? computePersistKey(active, ptyMap) : null,
- });
- }, [sessions, activeSessionId, persistsOrder, persistSurface, bridge]);
+ writeDockSessionOrder(
+ bridge,
+ persistSurface,
+ {
+ order,
+ activeKey: active != null ? computePersistKey(active, ptyMap) : null,
+ },
+ buildTerminalRestartSnapshot(sessions, activeSessionId),
+ );
+ }, [sessions, activeSessionId, persistsOrder, persistSurface, bridge, rehydrationSettled]);
// ── Thread reconciliation (agents panel) ────────────────────────────────
// Mirror the server-authoritative open-thread list into thread descriptors: add
@@ -1243,6 +1276,9 @@ export function SessionsHost({
hostThreads &&
threadLaunch != null &&
threadLaunch.nonce !== lastHandledThreadNonceRef.current;
+ const restoredVisibility =
+ hostTerminals && terminalRestoreRevealNonce !== consumedRestoreRevealNonceRef.current;
+ if (restoredVisibility) consumedRestoreRevealNonceRef.current = terminalRestoreRevealNonce;
if (
visible &&
!wasVisible &&
@@ -1250,6 +1286,7 @@ export function SessionsHost({
!threadLaunchPending &&
!(hostThreads && hasInflightThreadLaunch())
) {
+ if (restoredVisibility) return;
seedOwedRef.current = !seedOnRevealRef.current();
return;
}
@@ -1273,6 +1310,8 @@ export function SessionsHost({
rehydrationSettled,
hostThreads,
effectiveDefaultAgent,
+ hostTerminals,
+ terminalRestoreRevealNonce,
]);
// "Start an agent" launch intent (agents panel): resolve the agent and start a
@@ -1325,24 +1364,26 @@ export function SessionsHost({
void (async () => {
// Read the persisted unified order first so terminal survivors are placed by
// it (and threads, arriving async, land at their persisted slots too).
- const persisted = await readDockSessionOrder(bridge, persistSurface).catch(() => null);
+ const { sessionOrder: persisted, terminalSnapshot: restartSnapshot } =
+ await readDockRestoreState(bridge, persistSurface);
if (!cancelled && persisted != null) {
reloadOrderRef.current = persisted.order;
pendingActiveKeyRef.current = persisted.activeKey;
}
- let survivors: readonly {
- ptyId: string;
- customLabel: string | null;
- ordinal: number | null;
- }[] = [];
+ let survivors:
+ | readonly {
+ ptyId: string;
+ customLabel: string | null;
+ ordinal: number | null;
+ }[]
+ | null = null;
try {
survivors = (await bridge.terminal.list()) ?? [];
} catch (err) {
- console.error('[terminal] reload session list() failed; cold-starting:', err);
- survivors = [];
+ console.error('[terminal] reload session list() failed; preserving restart snapshot:', err);
}
if (cancelled) return;
- if (survivors.length > 0) {
+ if (survivors != null && survivors.length > 0) {
const order = reloadOrderRef.current;
const rankOf = (ptyId: string) => {
const i = order.indexOf(ptyId);
@@ -1372,6 +1413,24 @@ export function SessionsHost({
});
sessionCounterRef.current = Math.max(recovered.length, ...recovered.map((r) => r.ordinal));
setSessions(recovered);
+ } else if (survivors != null && restartSnapshot != null && restartSnapshot.tabs.length > 0) {
+ const recovered = restartSnapshot.tabs.map((entry, index) => ({
+ kind: 'terminal' as const,
+ commandId: null,
+ id: makeSessionId(index + 1),
+ launch: null,
+ title: null,
+ customLabel: entry.customLabel,
+ ordinal: entry.ordinal,
+ adoptPtyId: null,
+ }));
+ sessionCounterRef.current = Math.max(recovered.length, ...recovered.map((r) => r.ordinal));
+ pendingActiveKeyRef.current = null;
+ setSessions(recovered);
+ const active = recovered.find(
+ (session) => session.ordinal === restartSnapshot?.activeOrdinal,
+ );
+ if (active != null) setActiveSessionId(active.id);
}
setRehydrationSettled(true);
// Bound the reload-active wait: if the restored active tab never materializes
@@ -1613,6 +1672,7 @@ export function SessionsHost({
const sessionViews = showStrip ? (
<TerminalTabStrip
sessions={tabDescriptors}
+ sessionKind={hostThreads ? 'agent' : 'terminal'}
activeSessionId={activeSessionId}
onSelect={(id) => {
// A deliberate tab selection is the user taking over the active slot.
@@ -1632,6 +1692,8 @@ export function SessionsHost({
dragActiveRef.current = active;
}}
edge={edge}
+ onPlacementChange={surface === 'terminal-dock' ? onTerminalPlacementChange : undefined}
+ reserveRightRevealTabGutter={reserveRightRevealTabGutter}
onCollapse={isWindow ? undefined : () => onVisibleChange(false)}
draggable={isWindow}
className="h-full"
@@ -1798,6 +1860,23 @@ function computePersistKey(
return session.adoptPtyId ?? ptyMap.get(session.id) ?? null;
}
+function buildTerminalRestartSnapshot(
+ sessions: readonly SessionDescriptor[],
+ activeSessionId: string,
+): OkTerminalRestartSnapshot {
+ const terminals = sessions.filter(
+ (session): session is TerminalSessionDescriptor => session.kind === 'terminal',
+ );
+ const active = terminals.find((session) => session.id === activeSessionId);
+ return {
+ tabs: terminals.map((session) => ({
+ ordinal: session.ordinal,
+ customLabel: session.customLabel,
+ })),
+ activeOrdinal: active?.ordinal ?? null,
+ };
+}
+
/**
* Place freshly-added sessions into `kept`: a session whose reload-stable key is in
* the persisted `order` inserts at its ranked slot (restoring the cross-kind reload
diff --git a/packages/app/src/components/TerminalDock.dom.test.tsx b/packages/app/src/components/TerminalDock.dom.test.tsx
index 314fab51b..f9eae2d6b 100644
--- a/packages/app/src/components/TerminalDock.dom.test.tsx
+++ b/packages/app/src/components/TerminalDock.dom.test.tsx
@@ -238,15 +238,19 @@ type TestLaunch = {
function DockHarness({
v,
l,
+ p = 'bottom',
+ targetAvailable = true,
onVisibleChange,
bridge,
// biome-ignore lint/suspicious/noExplicitAny: test harness props
}: any) {
const [bottomContainer, setBottomContainer] = useState<HTMLDivElement | null>(null);
+ const [rightContainer, setRightContainer] = useState<HTMLDivElement | null>(null);
const [editorRegionEl, setEditorRegionEl] = useState<HTMLDivElement | null>(null);
return (
<TooltipProvider>
<TerminalDock
+ placement={p}
visible={v}
onVisibleChange={onVisibleChange}
onBottomContainer={setBottomContainer}
@@ -254,26 +258,37 @@ function DockHarness({
>
<div data-testid="editor-child" />
</TerminalDock>
+ {p === 'right' && targetAvailable ? (
+ <div ref={setRightContainer} data-testid="terminal-right-mount" />
+ ) : null}
<SessionsHost
surface="terminal-dock"
+ terminalPlacement={p}
bridge={bridge}
terminalCapable
visible={v}
onVisibleChange={onVisibleChange}
launch={l ?? null}
- container={bottomContainer}
- isShowing={v && bottomContainer != null}
+ container={p === 'right' ? rightContainer : bottomContainer}
+ isShowing={v && (p === 'right' ? rightContainer != null : bottomContainer != null)}
onRequestEditorFocus={() => editorRegionEl?.focus()}
/>
</TooltipProvider>
);
}
-function renderDock(visible: boolean, launch?: TestLaunch | null) {
+function renderDock(visible: boolean, launch?: TestLaunch | null, placement = 'bottom') {
const onVisibleChange = vi.fn((_v: boolean) => {});
const { bridge, create, kill, input, viewMenuPushes, dispatchMenuAction } = makeBridge();
- const ui = (v: boolean, l?: TestLaunch | null) => (
- <DockHarness v={v} l={l ?? null} onVisibleChange={onVisibleChange} bridge={bridge} />
+ const ui = (v: boolean, l?: TestLaunch | null, p = placement, targetAvailable = true) => (
+ <DockHarness
+ v={v}
+ l={l ?? null}
+ p={p}
+ targetAvailable={targetAvailable}
+ onVisibleChange={onVisibleChange}
+ bridge={bridge}
+ />
);
const utils = render(ui(visible, launch));
return {
@@ -284,7 +299,8 @@ function renderDock(visible: boolean, launch?: TestLaunch | null) {
input,
viewMenuPushes,
dispatchMenuAction,
- rerender: (v: boolean, l?: TestLaunch | null) => utils.rerender(ui(v, l)),
+ rerender: (v: boolean, l?: TestLaunch | null, p = placement, targetAvailable = true) =>
+ utils.rerender(ui(v, l, p, targetAvailable)),
};
}
@@ -338,10 +354,84 @@ describe('TerminalDock multi-session', () => {
__resetLocalMenuActionBusForTests();
});
- test('tab strip exposes the collapse button, and no way to move the dock', () => {
+ test('moving the terminal reuses the live session subtree', async () => {
+ const dock = renderDock(true);
+ await waitFor(() => expect(dock.create).toHaveBeenCalledTimes(1));
+ const session = screen.getByTestId('terminal-session');
+
+ dock.rerender(true, null, 'right');
+
+ await waitFor(() => {
+ expect(screen.getByTestId('terminal-right-mount').contains(session)).toBe(true);
+ });
+ expect(screen.getByTestId('terminal-session')).toBe(session);
+ expect(dock.create).toHaveBeenCalledTimes(1);
+ expect(dock.kill).not.toHaveBeenCalled();
+ expect(document.getElementById(TERMINAL_PANEL_ID)).toBeNull();
+
+ dock.rerender(true, null, 'bottom');
+
+ await waitFor(() => {
+ expect(document.getElementById(TERMINAL_PANEL_ID)?.contains(session)).toBe(true);
+ });
+ expect(screen.getByTestId('terminal-session')).toBe(session);
+ expect(screen.queryByTestId('terminal-right-mount')).toBeNull();
+ expect(dock.create).toHaveBeenCalledTimes(1);
+ expect(dock.kill).not.toHaveBeenCalled();
+ });
+
+ test('a transiently missing target retains the session until the rail attaches', async () => {
+ const dock = renderDock(true);
+ await waitFor(() => expect(dock.create).toHaveBeenCalledTimes(1));
+ const session = screen.getByTestId('terminal-session');
+
+ dock.rerender(true, null, 'right', false);
+
+ expect(screen.queryByTestId('terminal-session')).toBeNull();
+ expect(dock.create).toHaveBeenCalledTimes(1);
+ expect(dock.kill).not.toHaveBeenCalled();
+
+ dock.rerender(true, null, 'right');
+
+ await waitFor(() => {
+ expect(screen.getByTestId('terminal-right-mount').contains(session)).toBe(true);
+ });
+ expect(screen.getByTestId('terminal-session')).toBe(session);
+ expect(dock.create).toHaveBeenCalledTimes(1);
+ expect(dock.kill).not.toHaveBeenCalled();
+ });
+
+ test('rapid moves preserve tab order, active selection, and every session node', async () => {
+ const user = userEvent.setup();
+ const dock = renderDock(true);
+ await waitFor(() => expect(dock.create).toHaveBeenCalledTimes(1));
+ await addTerminalTab(user);
+ await waitFor(() => expect(dock.create).toHaveBeenCalledTimes(2));
+ const sessionNodes = screen.getAllByTestId('terminal-session');
+ const orderedIds = sessionPanels().map((panel) => panel.dataset.terminalSession);
+ const activeId = activePanelId();
+
+ dock.rerender(true, null, 'right');
+ dock.rerender(true, null, 'bottom');
+ dock.rerender(true, null, 'right');
+
+ expect(screen.getAllByTestId('terminal-session')).toEqual(sessionNodes);
+ expect(sessionPanels().map((panel) => panel.dataset.terminalSession)).toEqual(orderedIds);
+ expect(activePanelId()).toBe(activeId);
+ expect(dock.create).toHaveBeenCalledTimes(2);
+ expect(dock.kill).not.toHaveBeenCalled();
+ expect(document.querySelectorAll('[data-terminal-session]')).toHaveLength(2);
+ expect(document.getElementById(TERMINAL_PANEL_ID)).toBeNull();
+ expect(
+ screen.getByTestId('terminal-right-mount').querySelectorAll('[data-terminal-session]'),
+ ).toHaveLength(2);
+ });
+
+ test('tab strip exposes the collapse button without obsolete dock or drag controls', () => {
renderDock(true);
- expect(screen.getByRole('button', { name: 'Collapse panel' })).not.toBeNull();
- // The terminal owns the bottom edge outright: no dock-toggle, no drag grip.
+ expect(screen.getByRole('button', { name: 'Collapse Terminal' })).not.toBeNull();
+ // Placement lives in the strip's context menu, so the old dock button and
+ // drag-to-dock grip must stay absent.
expect(screen.queryByRole('button', { name: /Dock sessions/ })).toBeNull();
expect(screen.queryByRole('button', { name: 'Drag to dock the terminal' })).toBeNull();
});
diff --git a/packages/app/src/components/TerminalDock.reload-survival.dom.test.tsx b/packages/app/src/components/TerminalDock.reload-survival.dom.test.tsx
index ea5575990..7564e57d4 100644
--- a/packages/app/src/components/TerminalDock.reload-survival.dom.test.tsx
+++ b/packages/app/src/components/TerminalDock.reload-survival.dom.test.tsx
@@ -109,10 +109,12 @@ const { SessionsHost } = await import('./SessionsHost');
function ReloadHarness({
bridge,
visible,
+ terminalRestoreRevealNonce = 0,
launch = null,
}: {
bridge: OkDesktopBridge;
visible: boolean;
+ terminalRestoreRevealNonce?: number;
launch?: { prompt: string; cli: string; nonce: number } | null;
}) {
const [bottomContainer, setBottomContainer] = useState<HTMLDivElement | null>(null);
@@ -131,6 +133,7 @@ function ReloadHarness({
bridge={bridge}
terminalCapable
visible={visible}
+ terminalRestoreRevealNonce={terminalRestoreRevealNonce}
onVisibleChange={() => {}}
// biome-ignore lint/suspicious/noExplicitAny: test launch shape
launch={launch as any}
@@ -242,6 +245,27 @@ describe('issue #351 — the terminal dock rehydrates surviving sessions after a
expect(tabs.map((tab) => tab.textContent)).toEqual(['deploy', 'Terminal 1', 'logs']);
});
+ test('a rejected dock-state read preserves main survivor order and settles rehydration', async () => {
+ const { bridge } = makeSurvivingMainBridge([
+ { ptyId: 'pty-3', customLabel: 'deploy', ordinal: 3 },
+ { ptyId: 'pty-1', customLabel: null, ordinal: 1 },
+ { ptyId: 'pty-2', customLabel: 'logs', ordinal: 2 },
+ ]);
+ bridge.terminal.getDockState = vi.fn(async () => {
+ throw new Error('ipc torn down mid-reload');
+ });
+
+ renderDock(bridge, true);
+
+ await waitFor(() => expect(screen.getAllByTestId('terminal-session')).toHaveLength(3), {
+ timeout: 2000,
+ });
+ const tabs = within(screen.getByRole('tablist', { name: 'Terminal sessions' })).getAllByRole(
+ 'tab',
+ );
+ expect(tabs.map((tab) => tab.textContent)).toEqual(['deploy', 'Terminal 1', 'logs']);
+ });
+
test('a rename pushes the new custom label to main (renderer->main persist path)', async () => {
const { bridge, setMeta } = makeSurvivingMainBridge([
{ ptyId: 'pty-1', customLabel: null, ordinal: 1 },
@@ -318,6 +342,40 @@ describe('issue #351 — the terminal dock rehydrates surviving sessions after a
});
});
+ test('a rejecting list() never treats a restart snapshot as proof that no PTY survived', async () => {
+ const create = vi.fn(async () => ({ ok: true as const, ptyId: 'duplicate-pty' }));
+ const bridge = {
+ onMenuAction: () => () => {},
+ editor: { notifyViewMenuStateChanged: () => {} },
+ terminal: {
+ create,
+ kill: vi.fn(async (_id: string) => {}),
+ list: vi.fn(async () => {
+ throw new Error('inventory transport failed');
+ }),
+ getDockState: vi.fn(async () => ({
+ terminalVisible: true,
+ agentPanelVisible: false,
+ terminalSnapshot: {
+ tabs: [{ ordinal: 1, customLabel: 'survivor' }],
+ activeOrdinal: 1,
+ },
+ })),
+ },
+ } as unknown as OkDesktopBridge;
+
+ const { rerender } = render(
+ <ReloadHarness bridge={bridge} visible={false} terminalRestoreRevealNonce={0} />,
+ );
+ await waitFor(() => expect(bridge.terminal.list).toHaveBeenCalled());
+ await act(async () => {});
+ rerender(<ReloadHarness bridge={bridge} visible terminalRestoreRevealNonce={1} />);
+ await act(async () => {});
+
+ expect(screen.queryAllByTestId('terminal-session')).toHaveLength(0);
+ expect(create).not.toHaveBeenCalled();
+ });
+
test('an Ask-AI selection does NOT raw-write into a reload survivor (unknown shell type)', async () => {
// A reload survivor comes back with no launch descriptor, so the host cannot
// tell a surviving CLI TUI (safe to write) from a surviving bare shell (where a
diff --git a/packages/app/src/components/TerminalDock.tsx b/packages/app/src/components/TerminalDock.tsx
index 285c5f68a..06d78e367 100644
--- a/packages/app/src/components/TerminalDock.tsx
+++ b/packages/app/src/components/TerminalDock.tsx
@@ -1,3 +1,4 @@
+import type { TerminalPlacement } from '@inkeep/open-knowledge-core';
import { useTheme } from 'next-themes';
import { type ReactNode, useEffect, useRef, useState } from 'react';
import { usePanelRef } from 'react-resizable-panels';
@@ -23,6 +24,7 @@ export const MAX_STRANDED_REPORTS = 5;
interface TerminalDockProps {
/** The editor chrome (header + area) the terminal docks beneath. */
readonly children: ReactNode;
+ readonly placement?: TerminalPlacement;
/**
* Controlled visibility. Drag-collapsing the bottom panel reports back through
* {@link onVisibleChange}.
@@ -42,16 +44,16 @@ interface TerminalDockProps {
}
/**
- * The bottom layout shell for the docked terminal: a vertical split with the
- * editor on top and a collapsible bottom panel beneath. It owns the bottom panel's
- * height (persist + drag) and collapse, and exposes the bottom mount + editor
- * region elements. It deliberately owns NO session state — the live terminal lives
- * in {@link SessionsHost}, mounted above the panel group, and portals into
- * the bottom mount this component renders. That separation is what lets the editor
- * re-render (and the view kind change) without re-spawning the PTY.
+ * The vertical editor shell for the docked terminal. It renders and owns the
+ * persisted bottom split only while the bottom edge is active; the editor region
+ * remains mounted when the terminal moves right. It deliberately owns NO session
+ * state — the live terminal lives in {@link SessionsHost}, mounted above this
+ * shell. That separation lets the presentation edge change without re-spawning
+ * the PTY.
*/
export function TerminalDock({
children,
+ placement = 'bottom',
visible,
onVisibleChange,
onBottomContainer,
@@ -59,7 +61,8 @@ export function TerminalDock({
}: TerminalDockProps) {
const { resolvedTheme } = useTheme();
const panelRef = usePanelRef();
- const [isCollapsed, setIsCollapsed] = useState(!visible);
+ const bottomVisible = placement === 'bottom' && visible;
+ const [isCollapsed, setIsCollapsed] = useState(!bottomVisible);
const xtermBackground = useLiveXtermTheme(resolvedTheme).background;
// Snapshot the persisted height once at mount; the ref carries the running value
// during user drag.
@@ -123,7 +126,7 @@ export function TerminalDock({
const panel = panelRef.current;
if (panel == null) return;
try {
- if (visible) {
+ if (bottomVisible) {
panel.resize(`${heightPxRef.current}px`);
} else {
panel.collapse();
@@ -135,7 +138,7 @@ export function TerminalDock({
// guard cannot see it: recovery is the next `visible` transition
// re-running this effect, or any later change to the panel's own box.
}
- }, [visible, panelRef]);
+ }, [bottomVisible, panelRef]);
// The persisted height is viewport-relative: `readTerminalHeight` caps it at
// 50vh, but only at read time, and this shell snapshots it once at mount. A
@@ -149,7 +152,7 @@ export function TerminalDock({
const next = clampTerminalHeight(heightPxRef.current);
if (next === heightPxRef.current) return;
heightPxRef.current = next;
- if (!visible) return;
+ if (!bottomVisible) return;
try {
panelRef.current?.resize(`${next}px`);
} catch {
@@ -158,7 +161,7 @@ export function TerminalDock({
};
window.addEventListener('resize', reclampToViewport);
return () => window.removeEventListener('resize', reclampToViewport);
- }, [visible, panelRef]);
+ }, [bottomVisible, panelRef]);
return (
<ResizablePanelGroup
@@ -183,112 +186,116 @@ export function TerminalDock({
in and drag-up-to-open would be a hidden second entry point. Gating on
controlled props (not `isCollapsed`) means an in-progress drag-to-collapse
completes before the handle disables on the next commit. */}
- <ResizableHandle
- withHandle={visible}
- disabled={!visible}
- onPointerDown={(event) => {
- if (!visible) return;
- // A prior gesture that never saw a release would otherwise leave the
- // flag set forever.
- endDragRef.current?.();
- setIsDragging(true);
- isDraggingRef.current = true;
- const { pointerId } = event;
- // A drag ends on `pointerup` OR `pointercancel`: a cancelled pointer
- // fires NO pointerup — once the browser suppresses a pointer stream
- // (touch pan/zoom/scroll takeover, or the OS invalidating the
- // pointer) no further events arrive for that pointerId. Without the
- // cancel arm the flag stays set, and every later imperative or
- // observer-driven resize reads as a user drag: `onVisibleChange`
- // fires spuriously, the persisted height gets overwritten, and the
- // stranded-dock guard stops firing.
- //
- // `window` is the right target because a release outside the dock
- // still lands there; both listeners are scoped to the originating
- // `pointerId` so a second touch's cancel cannot end this drag.
- const end = () => {
- setIsDragging(false);
- isDraggingRef.current = false;
- window.removeEventListener('pointerup', onEnd);
- window.removeEventListener('pointercancel', onEnd);
- endDragRef.current = null;
- };
- const onEnd = (ev: PointerEvent) => {
- if (ev.pointerId !== pointerId) return;
- end();
- };
- endDragRef.current = end;
- window.addEventListener('pointerup', onEnd);
- window.addEventListener('pointercancel', onEnd);
- }}
- />
- <ResizablePanel
- id={TERMINAL_PANEL_ID}
- // Paint the whole dock surface with the exact xterm canvas color so the tab
- // strip, its controls, and any chrome read as one continuous surface with
- // the terminal — no app-background seam between the strip and canvas.
- style={{ backgroundColor: xtermBackground }}
- panelRef={panelRef}
- defaultSize={visible ? `${initialHeightPx}px` : 0}
- minSize="120px"
- // The terminal can be dragged tall — up to 95% of the dock — leaving the
- // editor a 5% sliver (its panel `minSize`). Pair the two: the terminal's max
- // plus the editor's min must sum to 100% or the drag can't reach it.
- maxSize="95%"
- collapsible
- collapsedSize={0}
- onResize={(size) => {
- const collapsed = size.asPercentage === 0;
- setIsCollapsed(collapsed);
- // Invariant: the bottom panel occupies ZERO height whenever the dock is
- // hidden. The `visible` effect asserts that only on a TRANSITION, so
- // any path leaving the panel expanded without flipping `visible` — a
- // library re-layout, or a collapse
- // issued while the group was unmeasurable and therefore discarded —
- // strands the editor behind an empty band with no dock chrome and
- // nothing left to re-assert it. This is the panel's own resize signal,
- // so it catches that state whatever produced it. The handle is disabled
- // while hidden, so an expanded-hidden panel is never a user width worth
- // preserving.
- //
- // Gate on pixels rather than `collapsed`: an unmeasurable group makes
- // `asPercentage` NaN, which compares false against 0 and would read as
- // "expanded", firing this guard spuriously on a panel that has no size
- // at all.
- if (!visible && size.inPixels > 0 && !isDraggingRef.current) {
- reportStrandedDock(size.inPixels, size.asPercentage);
- try {
- panelRef.current?.collapse();
- } catch {
- // Panel unregistered mid-flight — the next resize re-asserts.
- }
- return;
- }
- // Persist + reflect to controlled visibility only on a user drag;
- // imperative replays from the `visible` effect also fire onResize and must
- // not overwrite the persisted value or loop onVisibleChange.
- if (isDraggingRef.current) {
- if (collapsed && visible) onVisibleChange(false);
- else if (!collapsed && !visible) onVisibleChange(true);
- if (size.inPixels > 0) {
- heightPxRef.current = size.inPixels;
- debouncedWriteHeight(size.inPixels);
- }
- }
- }}
- // react-resizable-panels does not apply inert on collapse — children stay in
- // the DOM, tab order, and a11y tree. The explicit `inert` removes the
- // collapsed terminal from focus order.
- inert={isCollapsed}
- className={cn(
- 'flex flex-col',
- !isDragging &&
- 'transition-[flex-grow] duration-150 ease-out motion-reduce:transition-none motion-reduce:duration-0',
- )}
- >
- {/* Mount point for the terminal host's stable host div. */}
- <div ref={onBottomContainer} className="flex min-h-0 flex-1 flex-col overflow-hidden" />
- </ResizablePanel>
+ {placement === 'bottom' ? (
+ <>
+ <ResizableHandle
+ withHandle={bottomVisible}
+ disabled={!bottomVisible}
+ onPointerDown={(event) => {
+ if (!bottomVisible) return;
+ // A prior gesture that never saw a release would otherwise leave the
+ // flag set forever.
+ endDragRef.current?.();
+ setIsDragging(true);
+ isDraggingRef.current = true;
+ const { pointerId } = event;
+ // A drag ends on `pointerup` OR `pointercancel`: a cancelled pointer
+ // fires NO pointerup — once the browser suppresses a pointer stream
+ // (touch pan/zoom/scroll takeover, or the OS invalidating the
+ // pointer) no further events arrive for that pointerId. Without the
+ // cancel arm the flag stays set, and every later imperative or
+ // observer-driven resize reads as a user drag: `onVisibleChange`
+ // fires spuriously, the persisted height gets overwritten, and the
+ // stranded-dock guard stops firing.
+ //
+ // `window` is the right target because a release outside the dock
+ // still lands there; both listeners are scoped to the originating
+ // `pointerId` so a second touch's cancel cannot end this drag.
+ const end = () => {
+ setIsDragging(false);
+ isDraggingRef.current = false;
+ window.removeEventListener('pointerup', onEnd);
+ window.removeEventListener('pointercancel', onEnd);
+ endDragRef.current = null;
+ };
+ const onEnd = (ev: PointerEvent) => {
+ if (ev.pointerId !== pointerId) return;
+ end();
+ };
+ endDragRef.current = end;
+ window.addEventListener('pointerup', onEnd);
+ window.addEventListener('pointercancel', onEnd);
+ }}
+ />
+ <ResizablePanel
+ id={TERMINAL_PANEL_ID}
+ // Paint the whole dock surface with the exact xterm canvas color so the tab
+ // strip, its controls, and any chrome read as one continuous surface with
+ // the terminal — no app-background seam between the strip and canvas.
+ style={{ backgroundColor: xtermBackground }}
+ panelRef={panelRef}
+ defaultSize={bottomVisible ? `${initialHeightPx}px` : 0}
+ minSize="120px"
+ // The terminal can be dragged tall — up to 95% of the dock — leaving the
+ // editor a 5% sliver (its panel `minSize`). Pair the two: the terminal's max
+ // plus the editor's min must sum to 100% or the drag can't reach it.
+ maxSize="95%"
+ collapsible
+ collapsedSize={0}
+ onResize={(size) => {
+ const collapsed = size.asPercentage === 0;
+ setIsCollapsed(collapsed);
+ // Invariant: the bottom panel occupies ZERO height whenever the dock is
+ // hidden. The `visible` effect asserts that only on a TRANSITION, so
+ // any path leaving the panel expanded without flipping `visible` — a
+ // library re-layout, or a collapse
+ // issued while the group was unmeasurable and therefore discarded —
+ // strands the editor behind an empty band with no dock chrome and
+ // nothing left to re-assert it. This is the panel's own resize signal,
+ // so it catches that state whatever produced it. The handle is disabled
+ // while hidden, so an expanded-hidden panel is never a user width worth
+ // preserving.
+ //
+ // Gate on pixels rather than `collapsed`: an unmeasurable group makes
+ // `asPercentage` NaN, which compares false against 0 and would read as
+ // "expanded", firing this guard spuriously on a panel that has no size
+ // at all.
+ if (!bottomVisible && size.inPixels > 0 && !isDraggingRef.current) {
+ reportStrandedDock(size.inPixels, size.asPercentage);
+ try {
+ panelRef.current?.collapse();
+ } catch {
+ // Panel unregistered mid-flight — the next resize re-asserts.
+ }
+ return;
+ }
+ // Persist + reflect to controlled visibility only on a user drag;
+ // imperative replays from the `visible` effect also fire onResize and must
+ // not overwrite the persisted value or loop onVisibleChange.
+ if (isDraggingRef.current) {
+ if (collapsed && bottomVisible) onVisibleChange(false);
+ else if (!collapsed && !bottomVisible) onVisibleChange(true);
+ if (size.inPixels > 0) {
+ heightPxRef.current = size.inPixels;
+ debouncedWriteHeight(size.inPixels);
+ }
+ }
+ }}
+ // react-resizable-panels does not apply inert on collapse — children stay in
+ // the DOM, tab order, and a11y tree. The explicit `inert` removes the
+ // collapsed terminal from focus order.
+ inert={isCollapsed}
+ className={cn(
+ 'flex flex-col',
+ !isDragging &&
+ 'transition-[flex-grow] duration-150 ease-out motion-reduce:transition-none motion-reduce:duration-0',
+ )}
+ >
+ {/* Mount point for the terminal host's stable host div. */}
+ <div ref={onBottomContainer} className="flex min-h-0 flex-1 flex-col overflow-hidden" />
+ </ResizablePanel>
+ </>
+ ) : null}
</ResizablePanelGroup>
);
}
diff --git a/packages/app/src/components/TerminalTabStrip.dom.test.tsx b/packages/app/src/components/TerminalTabStrip.dom.test.tsx
index 5c4d70b6d..139e822d7 100644
--- a/packages/app/src/components/TerminalTabStrip.dom.test.tsx
+++ b/packages/app/src/components/TerminalTabStrip.dom.test.tsx
@@ -1,4 +1,4 @@
-import { act, cleanup, render, screen, within } from '@testing-library/react';
+import { act, cleanup, fireEvent, render, screen, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { afterEach, describe, expect, test, vi } from 'vitest';
import { TooltipProvider } from '@/components/ui/tooltip';
@@ -24,11 +24,13 @@ function renderStrip(props?: {
sessions?: readonly TerminalTabDescriptor[];
activeSessionId?: string;
edge?: 'bottom' | 'right';
+ sessionKind?: 'terminal' | 'agent';
draggable?: boolean;
/** Omit the rename handler to assert the affordance is inert without it. */
renameDisabled?: boolean;
/** Render a stub trailing control (stands in for the history menu). */
withTrailing?: boolean;
+ reserveRightRevealTabGutter?: boolean;
}) {
const onSelect = vi.fn((_id: string) => {});
const onTabActivate = vi.fn((_id: string) => {});
@@ -36,6 +38,7 @@ function renderStrip(props?: {
const onClose = vi.fn((_id: string) => {});
const onRename = vi.fn((_id: string, _label: string) => {});
const onCollapse = vi.fn(() => {});
+ const onPlacementChange = vi.fn((_placement: 'bottom' | 'right') => {});
const view = render(
// The app mounts a root TooltipProvider (main.tsx); the strip's control
// tooltips need that context, so the isolated render supplies its own.
@@ -57,7 +60,10 @@ function renderStrip(props?: {
}
onClose={onClose}
onRename={props?.renameDisabled ? undefined : onRename}
+ sessionKind={props?.sessionKind ?? (props?.edge === 'right' ? 'agent' : 'terminal')}
edge={props?.draggable ? undefined : (props?.edge ?? 'bottom')}
+ onPlacementChange={props?.draggable ? undefined : onPlacementChange}
+ reserveRightRevealTabGutter={props?.reserveRightRevealTabGutter}
onCollapse={props?.draggable ? undefined : onCollapse}
draggable={props?.draggable}
/>
@@ -70,6 +76,7 @@ function renderStrip(props?: {
onClose,
onRename,
onCollapse,
+ onPlacementChange,
rerender: view.rerender,
};
}
@@ -84,6 +91,17 @@ describe('TerminalTabStrip', () => {
expect(tabs.map((tab) => tab.textContent)).toEqual(['Terminal 1', 'Terminal 2', 'Terminal 3']);
});
+ test('keeps accessible close controls outside the tablist ownership tree', () => {
+ renderStrip();
+ const tablist = screen.getByRole('tablist', { name: 'Terminal sessions' });
+
+ expect(within(tablist).getAllByRole('tab')).toHaveLength(3);
+ for (const label of ['Terminal 1', 'Terminal 2', 'Terminal 3']) {
+ const closeButton = screen.getByRole('button', { name: `Close ${label}` });
+ expect(tablist.contains(closeButton)).toBe(false);
+ }
+ });
+
// Both panels can be open at once, so a shared "Sessions" name would leave a
// screen-reader user with two indistinguishable tablists (WCAG 1.3.1). The
// names must differ by edge, not merely exist.
@@ -98,6 +116,13 @@ describe('TerminalTabStrip', () => {
expect(screen.queryByRole('tablist', { name: 'Agent chats' })).toBeNull();
});
+ test('keeps terminal identity when its panel occupies the right edge', () => {
+ renderStrip({ edge: 'right', sessionKind: 'terminal' });
+
+ expect(screen.getByRole('tablist', { name: 'Terminal sessions' })).toBeTruthy();
+ expect(screen.queryByRole('tablist', { name: 'Agent chats' })).toBeNull();
+ });
+
test('hovering a tab surfaces the full (untruncated) title in a tooltip', async () => {
const user = userEvent.setup();
// A process-set OSC title long enough to hard-clip at the tab's max width;
@@ -206,7 +231,7 @@ describe('TerminalTabStrip', () => {
test('the New button hugs the last tab, preceding the trailing collapse control', () => {
renderStrip();
const newButton = screen.getByRole('button', { name: 'New session' });
- const collapse = screen.getByRole('button', { name: 'Collapse panel' });
+ const collapse = screen.getByRole('button', { name: 'Collapse Terminal' });
// The New button sits immediately right of the tablist; the spacer pushes the
// trailing group to the far right.
expect(
@@ -218,7 +243,7 @@ describe('TerminalTabStrip', () => {
renderStrip({ withTrailing: true });
const trailing = screen.getByRole('button', { name: 'Reopen a past chat' });
const newButton = screen.getByRole('button', { name: 'New session' });
- const collapse = screen.getByRole('button', { name: 'Collapse panel' });
+ const collapse = screen.getByRole('button', { name: 'Collapse Terminal' });
// The New button hugs the tabs on the left; the trailing control sits in the
// far-right cluster, before the collapse control.
expect(
@@ -241,21 +266,112 @@ describe('TerminalTabStrip', () => {
expect(onNewButtonClick).not.toHaveBeenCalled();
});
- // Each panel owns one edge now, so the strip offers no way to move it — a
- // leftover dock-toggle would be a control with nothing to do.
- test('offers no dock-position control on either edge', () => {
- renderStrip({ edge: 'bottom' });
- expect(screen.queryByRole('button', { name: /Dock sessions/ })).toBeNull();
- cleanup();
- renderStrip({ edge: 'right' });
- expect(screen.queryByRole('button', { name: /Dock sessions/ })).toBeNull();
+ test('the bottom Terminal context menu contains one placement action that moves it right', async () => {
+ const user = userEvent.setup();
+ const { onPlacementChange } = renderStrip({ edge: 'bottom', sessionKind: 'terminal' });
+
+ fireEvent.contextMenu(screen.getByRole('tablist', { name: 'Terminal sessions' }));
+
+ const menu = await screen.findByRole('menu');
+ const placementAction = within(menu).getByRole('menuitem', {
+ name: 'Move to right panel',
+ });
+ expect(within(menu).getAllByRole('menuitem')).toHaveLength(1);
+
+ await user.click(placementAction);
+
+ expect(onPlacementChange).toHaveBeenCalledWith('right');
+ });
+
+ test('Shift+F10 opens the placement menu from a focused Terminal tab and preserves operable focus', async () => {
+ const user = userEvent.setup();
+ const { onPlacementChange } = renderStrip({ edge: 'bottom', sessionKind: 'terminal' });
+ const focusedTab = screen.getByRole('tab', { name: 'Terminal 1' });
+ act(() => focusedTab.focus());
+
+ fireEvent.keyDown(focusedTab, { key: 'F10', shiftKey: true });
+
+ const placementAction = await screen.findByRole('menuitem', {
+ name: 'Move to right panel',
+ });
+ expect(placementAction).toBe(document.activeElement);
+
+ await user.keyboard('{Enter}');
+
+ expect(onPlacementChange).toHaveBeenCalledWith('right');
+ expect(focusedTab).toBe(document.activeElement);
+ });
+
+ test('the platform context-menu key opens placement and Escape restores the focused Terminal tab', async () => {
+ const user = userEvent.setup();
+ const { onPlacementChange } = renderStrip({ edge: 'bottom', sessionKind: 'terminal' });
+ const focusedTab = screen.getByRole('tab', { name: 'Terminal 2' });
+ act(() => focusedTab.focus());
+
+ fireEvent.keyDown(focusedTab, { key: 'ContextMenu' });
+
+ expect(await screen.findByRole('menuitem', { name: 'Move to right panel' })).toBe(
+ document.activeElement,
+ );
+
+ await user.keyboard('{Escape}');
+
+ expect(onPlacementChange).not.toHaveBeenCalled();
+ expect(focusedTab).toBe(document.activeElement);
+ });
+
+ test('the right Terminal header has a named 24px dock control that moves it bottom', async () => {
+ const user = userEvent.setup();
+ const { onPlacementChange } = renderStrip({ edge: 'right', sessionKind: 'terminal' });
+ const dockButton = screen.getByRole('button', { name: 'Move Terminal to bottom' });
+
+ expect(dockButton.getAttribute('data-size')).toBe('icon-xs');
+ expect(dockButton.className).toContain('focus-visible:ring-3');
+
+ await user.click(dockButton);
+
+ expect(onPlacementChange).toHaveBeenCalledWith('bottom');
+ });
+
+ test('the bottom Terminal header has a named 24px dock control that moves it right', async () => {
+ const user = userEvent.setup();
+ const { onPlacementChange } = renderStrip({ edge: 'bottom', sessionKind: 'terminal' });
+ const dockButton = screen.getByRole('button', { name: 'Move Terminal to right' });
+
+ expect(dockButton.getAttribute('data-size')).toBe('icon-xs');
+ expect(dockButton.className).toContain('focus-visible:ring-3');
+
+ await user.click(dockButton);
+
+ expect(onPlacementChange).toHaveBeenCalledWith('right');
+ });
+
+ test('the right Terminal header clears the collapsed agents reveal control', () => {
+ renderStrip({
+ edge: 'right',
+ sessionKind: 'terminal',
+ reserveRightRevealTabGutter: true,
+ });
+
+ expect(document.querySelector('[data-terminal-tab-row]')?.className).toContain('pr-9');
+ });
+
+ test('the agent strip keeps independent names and controls without Terminal placement actions', () => {
+ renderStrip({ edge: 'right', sessionKind: 'agent' });
+
+ expect(screen.getByRole('tablist', { name: 'Agent chats' })).toBeDefined();
+ expect(screen.getByRole('button', { name: 'Collapse agent panel' })).toBeDefined();
+ expect(screen.queryByRole('button', { name: /Move Terminal/ })).toBeNull();
+
+ fireEvent.contextMenu(screen.getByRole('tablist', { name: 'Agent chats' }));
+ expect(screen.queryByRole('menu')).toBeNull();
});
test('the collapse control reports onCollapse and never onClose / new-button', async () => {
const user = userEvent.setup();
const { onCollapse, onClose, onNewButtonClick } = renderStrip();
- await user.click(screen.getByRole('button', { name: 'Collapse panel' }));
+ await user.click(screen.getByRole('button', { name: 'Collapse Terminal' }));
expect(onCollapse).toHaveBeenCalledTimes(1);
expect(onClose).not.toHaveBeenCalled();
@@ -269,7 +385,7 @@ describe('TerminalTabStrip', () => {
test('every strip-owned icon-only control exposes an accessible name', () => {
renderStrip();
- expect(screen.getByRole('button', { name: 'Collapse panel' })).toBeDefined();
+ expect(screen.getByRole('button', { name: 'Collapse Terminal' })).toBeDefined();
for (const label of ['Terminal 1', 'Terminal 2', 'Terminal 3']) {
expect(screen.getByRole('button', { name: `Close ${label}` })).toBeDefined();
}
@@ -283,7 +399,7 @@ describe('TerminalTabStrip', () => {
expect(document.querySelector('[data-electron-drag]')).not.toBeNull();
// The window has no collapse control — window management is the OS title
// bar's job — but keeps the New button (feature parity).
- expect(screen.queryByRole('button', { name: 'Collapse panel' })).toBeNull();
+ expect(screen.queryByRole('button', { name: 'Collapse Terminal' })).toBeNull();
expect(screen.getByRole('button', { name: 'New session' })).toBeDefined();
cleanup();
renderStrip();
@@ -312,11 +428,13 @@ describe('TerminalTabStrip', () => {
const input = screen.getByRole('textbox', { name: 'Rename Terminal 2' });
expect(input).toBe(document.activeElement);
expect((input as HTMLInputElement).value).toBe('Terminal 2');
- // The renaming tab's trigger is REPLACED by the input (never nested inside a
- // role="tab" button); the other tabs keep their triggers.
- expect(screen.queryByRole('tab', { name: 'Terminal 2' })).toBeNull();
+ // Rename is an auxiliary control outside the tablist ownership tree. The
+ // session remains represented by its tab throughout the edit, while the
+ // focused input overlays it visually without invalid interactive nesting.
+ expect(screen.getByRole('tab', { name: 'Terminal 2' })).toBeDefined();
expect(screen.getByRole('tab', { name: 'Terminal 1' })).toBeDefined();
expect(input.closest('[role="tab"]')).toBeNull();
+ expect(screen.getByRole('tablist', { name: 'Terminal sessions' }).contains(input)).toBe(false);
});
test('double-click that opens rename fires onTabActivate at most once (second click suppressed)', async () => {
@@ -443,6 +561,7 @@ describe('TerminalTabStrip', () => {
{ id: 's1', label: 'Terminal 1' },
{ id: 's2', label: 'Terminal 2' },
]}
+ sessionKind="terminal"
activeSessionId="s1"
onSelect={() => {}}
newButton={stubNewButton(() => {})}
diff --git a/packages/app/src/components/TerminalTabStrip.tsx b/packages/app/src/components/TerminalTabStrip.tsx
index 402b1aba4..6c8a76b26 100644
--- a/packages/app/src/components/TerminalTabStrip.tsx
+++ b/packages/app/src/components/TerminalTabStrip.tsx
@@ -8,9 +8,22 @@ import {
useSortable,
} from '@dnd-kit/sortable';
import { Trans, useLingui } from '@lingui/react/macro';
-import { ChevronDownIcon, ChevronRightIcon, XIcon } from 'lucide-react';
-import { type ReactNode, useEffect, useRef, useState } from 'react';
+import {
+ ChevronDownIcon,
+ ChevronRightIcon,
+ PanelBottomIcon,
+ PanelRightIcon,
+ XIcon,
+} from 'lucide-react';
+import { type ReactElement, type ReactNode, useEffect, useRef, useState } from 'react';
import { Button } from '@/components/ui/button';
+import {
+ ContextMenu,
+ ContextMenuContent,
+ ContextMenuGroup,
+ ContextMenuItem,
+ ContextMenuTrigger,
+} from '@/components/ui/context-menu';
import { InputGroup, InputGroupInput } from '@/components/ui/input-group';
import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs';
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip';
@@ -19,6 +32,7 @@ import {
createTabReorderModifier,
getSortableTabStyle,
measureTabReorderBounds,
+ shouldOpenTabContextMenu,
TAB_REORDER_AUTO_SCROLL,
type TabReorderBounds,
tabRunCollisionDetection,
@@ -32,22 +46,24 @@ const TERMINAL_TAB_SORTABLE_SELECTOR = '[data-terminal-tab-sortable]';
/**
* One terminal tab as a `@dnd-kit/sortable` node. Only the pointer listeners +
* transform are wired (no `attributes` spread and no `KeyboardSensor`): dnd-kit's
- * `attributes` would inject `role="button"` + `tabIndex` onto this wrapper and
- * break the Radix tablist's roving-focus semantics, and keyboard reorder is a
- * dedicated ⌘⇧←/→ chord in the host rather than dnd-kit's Space-lift model. The
- * wrapper is not focusable, so its listeners never intercept Radix arrow keys or
- * the trigger's F2. `disabled` short-circuits sortable while any rename is open.
+ * `attributes` would overwrite the Radix trigger's tab semantics, while keyboard
+ * reorder belongs to the host's dedicated ⌘⇧←/→ chord rather than dnd-kit's
+ * Space-lift model. The pointer listeners attach to the trigger, but without a
+ * keyboard sensor they do not claim Radix arrow keys or F2. `disabled`
+ * short-circuits sortable while any rename is open.
*/
function SortableTerminalTab({
id,
disabled,
- isActive,
children,
}: {
id: string;
disabled: boolean;
- isActive: boolean;
- children: ReactNode;
+ children: (sortable: {
+ setNodeRef: (node: HTMLElement | null) => void;
+ listeners: ReturnType<typeof useSortable>['listeners'];
+ style: ReturnType<typeof getSortableTabStyle>;
+ }) => ReactNode;
}) {
const { setNodeRef, listeners, rect, transform, transition, isDragging } = useSortable({
id,
@@ -59,23 +75,7 @@ function SortableTerminalTab({
transform,
transition,
});
- return (
- // dnd-kit pointer listeners on a non-focusable wrapper; the role="tab" child
- // owns keyboard + a11y, so this div carries no interactive role of its own.
- <div
- ref={setNodeRef}
- data-terminal-tab-sortable=""
- style={style}
- className={cn(
- 'group flex shrink-0 cursor-default items-center rounded-md pr-0.5 transition-colors',
- isActive ? 'bg-muted' : 'hover:bg-muted/50',
- isDragging && 'z-10',
- )}
- {...listeners}
- >
- {children}
- </div>
- );
+ return children({ setNodeRef, listeners, style });
}
/** One session as the tab strip sees it: a stable id, a display label, and an
@@ -89,14 +89,67 @@ export interface TerminalTabDescriptor {
readonly icon?: ReactNode;
}
-/** Which edge of the editor a session panel occupies. The terminal dock owns the
- * bottom, the agents panel owns the right; the strip only needs it to point the
- * collapse chevron the way the panel slides shut. */
+/** Which edge of the editor a session panel occupies. The strip uses the edge to
+ * point the collapse chevron; accessible identity comes from the session kind. */
export type SessionPanelEdge = 'bottom' | 'right';
+type SessionKind = 'terminal' | 'agent';
+
+function BottomTerminalPlacementMenu({
+ children,
+ onMoveRight,
+}: {
+ readonly children: ReactElement;
+ readonly onMoveRight?: () => void;
+}) {
+ const keyboardTriggerRef = useRef<HTMLElement | null>(null);
+ if (onMoveRight == null) return children;
+
+ return (
+ <ContextMenu>
+ <ContextMenuTrigger
+ asChild
+ onKeyDown={(event) => {
+ if (!shouldOpenTabContextMenu(event)) return;
+ event.preventDefault();
+ keyboardTriggerRef.current =
+ document.activeElement instanceof HTMLElement ? document.activeElement : null;
+ const rect = event.currentTarget.getBoundingClientRect();
+ event.currentTarget.dispatchEvent(
+ new MouseEvent('contextmenu', {
+ bubbles: true,
+ cancelable: true,
+ clientX: rect.left,
+ clientY: rect.bottom,
+ }),
+ );
+ }}
+ >
+ {children}
+ </ContextMenuTrigger>
+ <ContextMenuContent
+ onCloseAutoFocus={(event) => {
+ if (keyboardTriggerRef.current == null) return;
+ event.preventDefault();
+ keyboardTriggerRef.current.focus();
+ keyboardTriggerRef.current = null;
+ }}
+ >
+ <ContextMenuGroup>
+ <ContextMenuItem onSelect={onMoveRight}>
+ <PanelRightIcon aria-hidden="true" />
+ <Trans>Move to right panel</Trans>
+ </ContextMenuItem>
+ </ContextMenuGroup>
+ </ContextMenuContent>
+ </ContextMenu>
+ );
+}
interface TerminalTabStripProps {
/** Sessions in tab order. */
readonly sessions: readonly TerminalTabDescriptor[];
+ /** Kept separate from edge because the terminal can occupy either edge. */
+ readonly sessionKind: SessionKind;
/** Currently active session id (controlled — the strip keeps no selection state). */
readonly activeSessionId: string;
/** Fires with a session id when the user activates a tab (click or arrow keys). */
@@ -139,6 +192,10 @@ interface TerminalTabStripProps {
* Absent on the standalone terminal window (nothing to collapse — the window
* is the terminal). */
readonly edge?: SessionPanelEdge;
+ /** Moves the terminal workspace to another editor edge. Terminal dock only. */
+ readonly onPlacementChange?: (placement: SessionPanelEdge) => void;
+ /** Leaves room for the agents-panel reveal tab when it overlays the right edge. */
+ readonly reserveRightRevealTabGutter?: boolean;
/** Fires when the user collapses (hides) the panel — sessions stay alive.
* The collapse button renders only when provided. */
readonly onCollapse?: () => void;
@@ -178,10 +235,10 @@ interface TerminalTabStripProps {
* (immediately right of the scrollable tablist, outside the scroll container so
* the fade mask never clips it): its primary opens a new tab in the default CLI,
* its carat switches CLI or opens a bare terminal. A flex-1 spacer then pushes the
- * trailing controls to the far right: a dock-toggle that flips the terminal
- * between the bottom dock and the right column, and a collapse button that hides
- * the terminal (sessions stay alive). The consumer owns dock position +
- * visibility; this strip only fires the callbacks.
+ * trailing controls to the far right. Terminal placement is available from a
+ * dock button on either edge and from the bottom strip's context menu; the
+ * collapse button hides the panel while sessions stay alive. The consumer owns
+ * placement and visibility; this strip only fires the callbacks.
*
* The standalone terminal window is the second placement (via the session
* host's window variant): it passes `draggable` (the row doubles as the macOS
@@ -192,6 +249,7 @@ interface TerminalTabStripProps {
*/
export function TerminalTabStrip({
sessions,
+ sessionKind,
activeSessionId,
onSelect,
onTabActivate,
@@ -202,6 +260,8 @@ export function TerminalTabStrip({
onReorder,
onDragActiveChange,
edge,
+ onPlacementChange,
+ reserveRightRevealTabGutter,
onCollapse,
children,
className,
@@ -209,6 +269,12 @@ export function TerminalTabStrip({
}: TerminalTabStripProps) {
const { t } = useLingui();
const rightEdge = edge === 'right';
+ const placementTarget: SessionPanelEdge = rightEdge ? 'bottom' : 'right';
+ const placementLabel = rightEdge ? t`Move Terminal to bottom` : t`Move Terminal to right`;
+ const onMoveRight =
+ sessionKind === 'terminal' && edge === 'bottom' && onPlacementChange != null
+ ? () => onPlacementChange('right')
+ : undefined;
// Inline rename is transient presentation state owned here; the host owns the
// durable custom label and receives the commit via onRename. Mirrors the
@@ -216,6 +282,7 @@ export function TerminalTabStrip({
// to commit, Escape to cancel) without any of its document-rename plumbing.
const [renamingId, setRenamingId] = useState<string | null>(null);
const [renameValue, setRenameValue] = useState('');
+ const [hoveredId, setHoveredId] = useState<string | null>(null);
const renameInputRef = useRef<HTMLInputElement>(null);
// Set the instant Escape fires so the ensuing blur does not commit —
// Escape-then-blur must cancel. Reset after each rename ends.
@@ -323,56 +390,33 @@ export function TerminalTabStrip({
onValueChange={onSelect}
className={cn('flex min-h-0 min-w-0 flex-1 flex-col', className)}
>
- <div
- ref={rowRef}
- // Window mode: this row is the macOS title bar — h-[62px] to center the
- // tabs against the traffic lights, traffic-light reserve so the first tab
- // clears them, and a drag handle on the empty area (controls opt out via
- // no-drag below). The dock omits all of this.
- data-electron-drag={draggable ? '' : undefined}
- className={cn(
- 'flex shrink-0 flex-row items-center gap-1 px-1.5 py-1',
- // h-[62px] centers the tab on the traffic-light row: the lights sit at
- // trafficLightPosition.y=24 with ~14px height (center ~y31), so an
- // items-center row must be ~62px tall (center 31) for the tab to line
- // up with the bubbles rather than floating above them.
- //
- // Left padding = the shared traffic-light reserve PLUS an extra 0.75rem:
- // the reserve (78px) is tuned for the editor's icon content, but a tab
- // is a background pill, so the bare reserve leaves its left edge touching
- // the green light. The extra gutter clears the bubbles cleanly.
- // pr-[22px] matches the traffic lights' own inset from the left edge
- // (trafficLightPosition.x=22) so the trailing "+" sits the same distance
- // from the right edge as the bubbles are from the left — a consistent
- // window gutter.
- draggable &&
- 'h-[62px] [-webkit-app-region:drag] pr-[22px] pl-[calc(var(--ok-titlebar-reserve-left,1rem)+0.75rem)]',
- )}
- >
- <TabsList
- ref={tabListRef}
- variant="line"
- // Named per panel, not a shared "Sessions": both panels can be open at
- // once, and two identically-named tablists give a screen-reader user no
- // way to tell them apart (WCAG 1.3.1). The standalone terminal window
- // has no edge and is a terminal, so it falls to the terminal name.
- aria-label={rightEdge ? t`Agent chats` : t`Terminal sessions`}
- // Remap a vertical wheel to horizontal scroll so the main scroll wheel
- // moves the tabs sideways, matching the editor tab strip (which native
- // overflow-x alone doesn't do for a plain vertical wheel).
- onWheel={scrollTabStripOnWheel}
- // No `flex-1`: the list sizes to its tabs so "New chat" can hug the
- // last one. `min-w-0` + `overflow-x-auto` keep the tabs scrolling
- // internally when they overflow the space the trailing controls leave.
- // `overflow-y-hidden` is load-bearing: `overflow-x: auto` alone computes
- // the y-axis from `visible` to `auto`, so the tab status-dot's 2px
- // `-bottom-0.5` bleed becomes a stray couple-pixel vertical scroll.
- // Window mode: the whole tab run (incl. inter-tab gaps) is `no-drag` so
- // a pointer drag crossing a gap reorders instead of moving the window;
- // the row's empty space outside the run stays a drag region.
+ <BottomTerminalPlacementMenu onMoveRight={onMoveRight}>
+ <div
+ ref={rowRef}
+ data-terminal-tab-row=""
+ // Window mode: this row is the macOS title bar — h-[62px] to center the
+ // tabs against the traffic lights, traffic-light reserve so the first tab
+ // clears them, and a drag handle on the empty area (controls opt out via
+ // no-drag below). The dock omits all of this.
+ data-electron-drag={draggable ? '' : undefined}
className={cn(
- 'flex h-auto min-w-0 items-center justify-start gap-0.5 overflow-x-auto overflow-y-hidden bg-transparent p-0 [scrollbar-width:none] scroll-fade-mask-x',
- draggable && '[-webkit-app-region:no-drag]',
+ 'flex shrink-0 flex-row items-center gap-1 px-1.5 py-1',
+ rightEdge && reserveRightRevealTabGutter && 'pr-9',
+ // h-[62px] centers the tab on the traffic-light row: the lights sit at
+ // trafficLightPosition.y=24 with ~14px height (center ~y31), so an
+ // items-center row must be ~62px tall (center 31) for the tab to line
+ // up with the bubbles rather than floating above them.
+ //
+ // Left padding = the shared traffic-light reserve PLUS an extra 0.75rem:
+ // the reserve (78px) is tuned for the editor's icon content, but a tab
+ // is a background pill, so the bare reserve leaves its left edge touching
+ // the green light. The extra gutter clears the bubbles cleanly.
+ // pr-[22px] matches the traffic lights' own inset from the left edge
+ // (trafficLightPosition.x=22) so the trailing "+" sits the same distance
+ // from the right edge as the bubbles are from the left — a consistent
+ // window gutter.
+ draggable &&
+ 'h-[62px] [-webkit-app-region:drag] pr-[22px] pl-[calc(var(--ok-titlebar-reserve-left,1rem)+0.75rem)]',
)}
>
<DndContext
@@ -384,7 +428,7 @@ export function TerminalTabStrip({
onDragEnd={handleDragEnd}
onDragCancel={handleDragCancel}
// Portal dnd-kit's SR live-region/described-by helpers to the body so
- // they don't land inside the tablist flex flow (same as editor tabs).
+ // they don't land inside the tablist grid (same as editor tabs).
accessibility={{
container: typeof document !== 'undefined' ? document.body : undefined,
}}
@@ -393,172 +437,214 @@ export function TerminalTabStrip({
items={sessions.map((session) => session.id)}
strategy={horizontalListSortingStrategy}
>
- {sessions.map((session) => {
- const isActive = session.id === activeSessionId;
- return (
- <SortableTerminalTab
- key={session.id}
- id={session.id}
- // Drag off while a rename is open (strip-wide) or when the host
- // supplies no onReorder.
- disabled={!reorderEnabled || renamingId != null}
- isActive={isActive}
- >
- {renamingId === session.id ? (
- // Rename mode: the input REPLACES the trigger inside this group
- // div (never nested inside the `role="tab"` button — that is
- // invalid interactive nesting). The close control is hidden
- // while editing so a stray click can't kill the tab mid-rename.
- <InputGroup
- className={cn(
- 'h-7 w-40 rounded-md border-0 bg-transparent dark:bg-transparent',
- draggable && '[-webkit-app-region:no-drag]',
- )}
+ {/* The scrollable visual run is a grid, while the semantic tablist and
+ auxiliary controls are sibling ownership trees. `display: contents`
+ lets both sets share the same grid cells: close/rename controls stay
+ visually attached to their tab without becoming invalid tablist
+ children. */}
+ <div
+ onWheel={scrollTabStripOnWheel}
+ className={cn(
+ 'grid h-auto w-fit max-w-full min-w-0 grid-flow-col items-center justify-start gap-0.5 overflow-x-auto overflow-y-hidden [grid-auto-columns:max-content] [scrollbar-width:none] scroll-fade-mask-x',
+ draggable && '[-webkit-app-region:no-drag]',
+ )}
+ >
+ <TabsList
+ ref={tabListRef}
+ variant="line"
+ aria-label={sessionKind === 'agent' ? t`Agent chats` : t`Terminal sessions`}
+ className="contents"
+ >
+ {sessions.map((session, index) => {
+ const isActive = session.id === activeSessionId;
+ const isRenaming = renamingId === session.id;
+ return (
+ <SortableTerminalTab
+ key={session.id}
+ id={session.id}
+ disabled={!reorderEnabled || renamingId != null}
>
- <InputGroupInput
- ref={renameInputRef}
- value={renameValue}
- aria-label={t`Rename ${session.label}`}
- data-testid="terminal-tab-rename-input"
- className="h-7 px-2 text-xs"
- onChange={(event) => setRenameValue(event.target.value)}
- onKeyDown={(event) => {
- // Enter/Escape only blur — endRename (the blur handler)
- // is the single commit/cancel point.
- if (event.key === 'Enter') {
- event.preventDefault();
- renameInputRef.current?.blur();
- } else if (event.key === 'Escape') {
- event.preventDefault();
- cancelRenameRef.current = true;
- renameInputRef.current?.blur();
- }
- }}
- onBlur={() => endRename(session.id)}
- />
- </InputGroup>
- ) : (
- <>
- {/* The label truncates at max-w-40, so a process-set title
- (OSC 0/2) that overflows is hard-clipped in the tab — the
- tooltip surfaces the full title on hover. */}
- <Tooltip>
- <TooltipTrigger asChild>
- <TabsTrigger
- value={session.id}
- // Anchor for focus-return after a rename ends.
- data-tab-id={session.id}
- // Pointer/Enter activation routes through onClick (arrow-key
- // navigation does not fire it), so the consumer can focus the
- // terminal on a deliberate select without stealing focus while
- // the user arrows across tabs. The second click of a
- // double-click is skipped (detail >= 2): otherwise its
- // activation would focus the terminal and blur-commit the
- // rename that same double-click is opening.
- onClick={(event) => {
- if (event.detail >= 2) return;
- onTabActivate?.(session.id);
- }}
- // Double-click (pointer) and F2 (keyboard) enter rename —
- // the same two idioms the editor file tabs use. Inert
- // when the host supplies no onRename.
- onDoubleClick={() => enterRename(session)}
- onKeyDown={(event) => {
- if (event.key === 'F2') {
- event.preventDefault();
- enterRename(session);
- }
- }}
- className={cn(
- 'h-7 flex-none gap-1.5 rounded-md px-2 text-xs',
- draggable && '[-webkit-app-region:no-drag]',
- )}
- >
- {session.icon}
- <span className="max-w-40 truncate">{session.label}</span>
- </TabsTrigger>
- </TooltipTrigger>
- <TooltipContent side="bottom" sideOffset={8}>
- {session.label}
- </TooltipContent>
- </Tooltip>
- <Button
- type="button"
- variant="ghost"
- size="icon-xs"
- aria-label={t`Close ${session.label}`}
- // Match the editor-tab pattern: only the active tab's close
- // control sits in the tab order, so a keyboard user reaches a
- // tab's close after activating it rather than tabbing past every
- // inactive tab's close button.
- tabIndex={isActive ? 0 : -1}
- // Close reveals on tab hover or keyboard focus; the active tab
- // keeps it persistently visible. Opacity (not unmount) keeps the
- // control in layout + a11y tree so tabs don't reflow and the
- // keyboard target stays reachable.
+ {({ setNodeRef, listeners, style }) => (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <TabsTrigger
+ ref={setNodeRef}
+ value={session.id}
+ data-terminal-tab-sortable=""
+ data-tab-id={session.id}
+ style={{ ...style, gridColumn: index + 1, gridRow: 1 }}
+ {...listeners}
+ onMouseEnter={() => setHoveredId(session.id)}
+ onMouseLeave={() => setHoveredId(null)}
+ onClick={(event) => {
+ if (event.detail >= 2) return;
+ onTabActivate?.(session.id);
+ }}
+ onDoubleClick={() => enterRename(session)}
+ onKeyDown={(event) => {
+ if (event.key === 'F2') {
+ event.preventDefault();
+ enterRename(session);
+ }
+ }}
+ className={cn(
+ 'h-7 flex-none gap-1.5 rounded-md py-0 pr-7 pl-2 text-xs transition-colors motion-reduce:transition-none',
+ isActive ? 'bg-muted' : 'hover:bg-muted/50',
+ isRenaming && 'w-40 opacity-0',
+ draggable && '[-webkit-app-region:no-drag]',
+ )}
+ >
+ {session.icon}
+ <span className="max-w-40 truncate">{session.label}</span>
+ </TabsTrigger>
+ </TooltipTrigger>
+ <TooltipContent side="bottom" sideOffset={8}>
+ {session.label}
+ </TooltipContent>
+ </Tooltip>
+ )}
+ </SortableTerminalTab>
+ );
+ })}
+ </TabsList>
+ <div className="contents">
+ {sessions.map((session, index) => {
+ const isActive = session.id === activeSessionId;
+ if (renamingId === session.id) {
+ return (
+ <InputGroup
+ key={session.id}
+ style={{ gridColumn: index + 1, gridRow: 1 }}
className={cn(
- 'text-muted-foreground opacity-0 transition-opacity hover:text-foreground group-hover:opacity-100 group-focus-within:opacity-100',
- isActive && 'opacity-100',
+ 'z-20 h-7 w-40 rounded-md border-0 bg-transparent dark:bg-transparent',
draggable && '[-webkit-app-region:no-drag]',
)}
- onClick={(event) => {
- event.stopPropagation();
- onClose(session.id);
- }}
>
- <XIcon aria-hidden="true" />
- </Button>
- </>
- )}
- </SortableTerminalTab>
- );
- })}
+ <InputGroupInput
+ ref={renameInputRef}
+ value={renameValue}
+ aria-label={t`Rename ${session.label}`}
+ data-testid="terminal-tab-rename-input"
+ className="h-7 px-2 text-xs"
+ onChange={(event) => setRenameValue(event.target.value)}
+ onKeyDown={(event) => {
+ if (event.key === 'Enter') {
+ event.preventDefault();
+ renameInputRef.current?.blur();
+ } else if (event.key === 'Escape') {
+ event.preventDefault();
+ cancelRenameRef.current = true;
+ renameInputRef.current?.blur();
+ }
+ }}
+ onBlur={() => endRename(session.id)}
+ />
+ </InputGroup>
+ );
+ }
+ return (
+ <Button
+ key={session.id}
+ type="button"
+ variant="ghost"
+ size="icon-xs"
+ aria-label={t`Close ${session.label}`}
+ tabIndex={isActive ? 0 : -1}
+ style={{ gridColumn: index + 1, gridRow: 1 }}
+ className={cn(
+ 'z-20 mr-0.5 justify-self-end text-muted-foreground opacity-0 transition-opacity hover:text-foreground hover:opacity-100 focus-visible:opacity-100',
+ (isActive || hoveredId === session.id) && 'opacity-100',
+ tabReorderBounds != null && 'pointer-events-none opacity-0',
+ draggable && '[-webkit-app-region:no-drag]',
+ )}
+ onMouseEnter={() => setHoveredId(session.id)}
+ onMouseLeave={() => setHoveredId(null)}
+ onClick={(event) => {
+ event.stopPropagation();
+ onClose(session.id);
+ }}
+ >
+ <XIcon aria-hidden="true" />
+ </Button>
+ );
+ })}
+ </div>
+ </div>
</SortableContext>
</DndContext>
- </TabsList>
- {/* The host's "new session" split button hugs the last tab (outside the
+ {/* The host's "new session" split button hugs the last tab (outside the
tablist's scroll+fade so it is never clipped). Wrapped so window mode
can opt it out of the title-bar drag region. */}
- {newButton != null ? (
- <div className={cn('shrink-0', draggable && '[-webkit-app-region:no-drag]')}>
- {newButton}
- </div>
- ) : null}
- {/* Spacer pushes the trailing controls to the far right. */}
- <div className="flex-1" />
- {/* Host-provided trailing controls (e.g. conversation history), just left
+ {newButton != null ? (
+ <div className={cn('shrink-0', draggable && '[-webkit-app-region:no-drag]')}>
+ {newButton}
+ </div>
+ ) : null}
+ {/* Spacer pushes the trailing controls to the far right. */}
+ <div className="flex-1" />
+ {/* Host-provided trailing controls (e.g. conversation history), just left
of the collapse button. */}
- {trailingControls != null ? (
- <div className={cn('shrink-0', draggable && '[-webkit-app-region:no-drag]')}>
- {trailingControls}
- </div>
- ) : null}
- {onCollapse != null ? (
- <Tooltip>
- <TooltipTrigger asChild>
- <Button
- type="button"
- variant="ghost"
- size="icon-xs"
- aria-label={t`Collapse panel`}
- className="shrink-0 cursor-pointer text-muted-foreground hover:text-foreground"
- onClick={onCollapse}
- >
- {/* Chevron points the way the panel slides shut: down for the
+ {trailingControls != null ? (
+ <div className={cn('shrink-0', draggable && '[-webkit-app-region:no-drag]')}>
+ {trailingControls}
+ </div>
+ ) : null}
+ {sessionKind === 'terminal' && edge != null && onPlacementChange != null ? (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button
+ type="button"
+ variant="ghost"
+ size="icon-xs"
+ aria-label={placementLabel}
+ className="shrink-0 cursor-pointer text-muted-foreground hover:text-foreground"
+ onClick={() => onPlacementChange(placementTarget)}
+ >
+ {rightEdge ? (
+ <PanelBottomIcon aria-hidden="true" />
+ ) : (
+ <PanelRightIcon aria-hidden="true" />
+ )}
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent side="bottom" sideOffset={8}>
+ {placementLabel}
+ </TooltipContent>
+ </Tooltip>
+ ) : null}
+ {onCollapse != null ? (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button
+ type="button"
+ variant="ghost"
+ size="icon-xs"
+ aria-label={
+ sessionKind === 'terminal' ? t`Collapse Terminal` : t`Collapse agent panel`
+ }
+ className="shrink-0 cursor-pointer text-muted-foreground hover:text-foreground"
+ onClick={onCollapse}
+ >
+ {/* Chevron points the way the panel slides shut: down for the
bottom dock, right for the right column. */}
- {rightEdge ? (
- <ChevronRightIcon aria-hidden="true" />
+ {rightEdge ? (
+ <ChevronRightIcon aria-hidden="true" />
+ ) : (
+ <ChevronDownIcon aria-hidden="true" />
+ )}
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent side="bottom" sideOffset={8}>
+ {sessionKind === 'terminal' ? (
+ <Trans>Collapse Terminal</Trans>
) : (
- <ChevronDownIcon aria-hidden="true" />
+ <Trans>Collapse agent panel</Trans>
)}
- </Button>
- </TooltipTrigger>
- <TooltipContent side="bottom" sideOffset={8}>
- <Trans>Collapse panel</Trans>
- </TooltipContent>
- </Tooltip>
- ) : null}
- </div>
+ </TooltipContent>
+ </Tooltip>
+ ) : null}
+ </div>
+ </BottomTerminalPlacementMenu>
{children}
</Tabs>
);
diff --git a/packages/app/src/components/command-palette-commands.ts b/packages/app/src/components/command-palette-commands.ts
index 314ad4b7e..5e4289e46 100644
--- a/packages/app/src/components/command-palette-commands.ts
+++ b/packages/app/src/components/command-palette-commands.ts
@@ -203,8 +203,10 @@ const PALETTE_COMMAND_LABELS = {
sidebarHide: msg`Hide sidebar`,
docPanelShow: msg`Show document panel`,
docPanelHide: msg`Hide document panel`,
- terminalShow: msg`Show Bottom Dock`,
- terminalHide: msg`Hide Bottom Dock`,
+ terminalShow: msg`Show Terminal`,
+ terminalHide: msg`Hide Terminal`,
+ terminalMoveRight: msg`Move Terminal to right`,
+ terminalMoveBottom: msg`Move Terminal to bottom`,
agentPanelShow: msg`Show Agents`,
agentPanelHide: msg`Hide Agents`,
agentPanelAskSelection: msg`Ask AI About Selection`,
@@ -260,6 +262,7 @@ const COMMAND_ICONS: Record<string, ComponentType<{ className?: string }>> = {
'toggle-sidebar': PanelLeft,
'toggle-doc-panel': PanelRight,
'toggle-terminal': SquareTerminal,
+ 'move-terminal': SquareTerminal,
'toggle-agent-panel': MessageSquare,
'toggle-show-hidden-files': Eye,
'toggle-show-ok-folders': Folder,
@@ -373,6 +376,8 @@ function paletteCoreContext(ctx: PaletteCommandContext): CommandContext {
host: ctx.bridge !== null ? 'desktop' : 'web',
activeTargetKind: ctx.contextualTargetKind,
singleFile: ctx.singleFile,
+ terminalCapable:
+ ctx.bridge !== null && ctx.bridge.terminal != null && ctx.bridge.config.ptyAvailable === true,
terminalLive: ctx.viewMenuState.terminalLive === true,
canExpandAll: ctx.viewMenuState.canExpandAll !== false,
canCollapseAll: ctx.viewMenuState.canCollapseAll !== false,
@@ -399,6 +404,13 @@ function resolvePaletteLabel(cmd: CommandIdentity, ctx: PaletteCommandContext):
const key = visible ? cmd.stateToggle.hideKey : cmd.stateToggle.showKey;
return i18n._(PALETTE_COMMAND_LABELS[key as PaletteLabelKey]);
}
+ if (cmd.placementToggle) {
+ const key =
+ ctx.viewMenuState.terminalPlacement === 'right'
+ ? cmd.placementToggle.rightKey
+ : cmd.placementToggle.bottomKey;
+ return i18n._(PALETTE_COMMAND_LABELS[key as PaletteLabelKey]);
+ }
return i18n._(PALETTE_COMMAND_LABELS[cmd.labelKey as PaletteLabelKey]);
}
diff --git a/packages/app/src/components/editor-area-rail-registry.test.ts b/packages/app/src/components/editor-area-rail-registry.test.ts
new file mode 100644
index 000000000..c79e22352
--- /dev/null
+++ b/packages/app/src/components/editor-area-rail-registry.test.ts
@@ -0,0 +1,108 @@
+import { describe, expect, test } from 'vitest';
+import {
+ AGENT_PANEL_ID,
+ AGENTS_COLUMN_ID,
+ accountRailLayout,
+ DOC_PANEL_ID,
+ findResidualPanelId,
+ isRightRailPanelId,
+ RIGHT_RAIL_PANEL_ORDER,
+ TERMINAL_COLUMN_ID,
+} from './editor-area-rail-registry';
+
+// Stands in for the id-less editor panel: react-resizable-panels auto-generates
+// an id for the panel that declares none, and it is the one id the rail
+// accounting must resolve as the residual absorber.
+const EDITOR = 'editor-residual';
+
+/** Every subset of the input, each subset in the input's own order. */
+function powerset<T>(items: readonly T[]): T[][] {
+ let result: T[][] = [[]];
+ for (const item of items) {
+ const next: T[][] = [];
+ for (const subset of result) {
+ next.push(subset);
+ next.push(subset.concat(item));
+ }
+ result = next;
+ }
+ return result;
+}
+
+describe('right-rail panel registry', () => {
+ // Pins membership AND order. Dropping a peer (e.g. the terminal column) or
+ // reordering fails here — a rendered column that is not registered would be
+ // mistaken for the residual editor and silently consume its width.
+ test('registers exactly the four rail peers in canonical order', () => {
+ expect([...RIGHT_RAIL_PANEL_ORDER]).toEqual([
+ DOC_PANEL_ID,
+ AGENT_PANEL_ID,
+ TERMINAL_COLUMN_ID,
+ AGENTS_COLUMN_ID,
+ ]);
+ });
+
+ test('recognizes every registered id and rejects the editor', () => {
+ for (const id of RIGHT_RAIL_PANEL_ORDER) {
+ expect(isRightRailPanelId(id)).toBe(true);
+ }
+ expect(isRightRailPanelId(EDITOR)).toBe(false);
+ });
+});
+
+describe('residual editor discovery across reachable layouts', () => {
+ // The mechanical invariant: for every combination of rail peers (the
+ // registry's powerset) plus the editor, the residual resolves to exactly the
+ // editor and every present peer is accounted for. Adding a peer to the
+ // registry automatically widens this sweep, so the accounting can never fall
+ // behind the membership set.
+ test('resolves exactly the editor and accounts for every peer in all combinations', () => {
+ for (const peers of powerset(RIGHT_RAIL_PANEL_ORDER)) {
+ const layout = [EDITOR, ...peers];
+ expect(findResidualPanelId(layout)).toBe(EDITOR);
+ const accounting = accountRailLayout(layout);
+ expect(accounting.ok).toBe(true);
+ expect(accounting.residualId).toBe(EDITOR);
+ expect(accounting.presentPeers).toEqual(peers);
+ expect(accounting.unaccountedIds).toEqual([]);
+ }
+ });
+
+ test('accounts cleanly for the four-peer wide rail', () => {
+ const layout = [EDITOR, DOC_PANEL_ID, TERMINAL_COLUMN_ID, AGENTS_COLUMN_ID];
+ const accounting = accountRailLayout(layout);
+ expect(accounting.ok).toBe(true);
+ expect(accounting.residualId).toBe(EDITOR);
+ expect(accounting.presentPeers).toEqual([DOC_PANEL_ID, TERMINAL_COLUMN_ID, AGENTS_COLUMN_ID]);
+ });
+
+ test('accounts cleanly for the narrow three-peer rail (agents closed)', () => {
+ const layout = [EDITOR, DOC_PANEL_ID, TERMINAL_COLUMN_ID];
+ const accounting = accountRailLayout(layout);
+ expect(accounting.ok).toBe(true);
+ expect(accounting.residualId).toBe(EDITOR);
+ expect(accounting.presentPeers).toEqual([DOC_PANEL_ID, TERMINAL_COLUMN_ID]);
+ });
+});
+
+describe('the layout invariant fires on model defects', () => {
+ // A column that renders WITHOUT joining the registry shows up as a second
+ // non-peer id: the residual can no longer be resolved (two candidates), and
+ // the accounting flags the stray id. This is the guard that stops a fourth
+ // peer from degrading silently — the failure this whole model exists for.
+ test('an unregistered rendered column breaks residual resolution and accounting', () => {
+ const layout = [EDITOR, DOC_PANEL_ID, 'ghost-column'];
+ expect(findResidualPanelId(layout)).toBeNull();
+ const accounting = accountRailLayout(layout);
+ expect(accounting.ok).toBe(false);
+ expect(accounting.unaccountedIds).toContain('ghost-column');
+ });
+
+ // A layout where every id is a registered peer has no residual — the editor
+ // column has been dropped from the accounting, also a defect.
+ test('a layout missing the residual editor fails the invariant', () => {
+ const layout = [DOC_PANEL_ID, AGENTS_COLUMN_ID];
+ expect(findResidualPanelId(layout)).toBeNull();
+ expect(accountRailLayout(layout).ok).toBe(false);
+ });
+});
diff --git a/packages/app/src/components/editor-area-rail-registry.ts b/packages/app/src/components/editor-area-rail-registry.ts
new file mode 100644
index 000000000..a341928fa
--- /dev/null
+++ b/packages/app/src/components/editor-area-rail-registry.ts
@@ -0,0 +1,84 @@
+/**
+ * Single source of truth for the horizontal editor group's right-rail peer
+ * identities. The editor column is the residual absorber and is deliberately
+ * NOT a member: it carries no panel id and is identified by exclusion — the one
+ * live layout id that is not a registered peer. Registering a rail column here
+ * is what keeps it OUT of the residual slot; an unregistered column that renders
+ * would be mistaken for the editor and consume its width, with no error.
+ *
+ * `assertRightRailLayout` and every rail-accounting site read membership and
+ * order from here rather than re-encoding the id set, so a new peer joins the
+ * rail by being added to `RIGHT_RAIL_PANEL_ORDER` alone.
+ */
+
+// String literals kept as `const` bindings (not `as const`) — a const binding
+// of a string literal already narrows to its literal type, which the ordered
+// tuple below relies on for `RightRailPanelId`.
+export const DOC_PANEL_ID = 'doc-panel';
+export const AGENT_PANEL_ID = 'agent-panel';
+export const TERMINAL_COLUMN_ID = 'terminal-column';
+export const AGENTS_COLUMN_ID = 'agents-column';
+
+/**
+ * Left-to-right order of the rail peers, after the residual editor column.
+ * `doc-panel` and `agent-panel` share the rightPanel slot (never both present);
+ * the terminal column sits between the document side pane and the agents column.
+ */
+export const RIGHT_RAIL_PANEL_ORDER = [
+ DOC_PANEL_ID,
+ AGENT_PANEL_ID,
+ TERMINAL_COLUMN_ID,
+ AGENTS_COLUMN_ID,
+] as const;
+
+export type RightRailPanelId = (typeof RIGHT_RAIL_PANEL_ORDER)[number];
+
+const RIGHT_RAIL_PANEL_ID_SET: ReadonlySet<string> = new Set(RIGHT_RAIL_PANEL_ORDER);
+
+export function isRightRailPanelId(id: string): id is RightRailPanelId {
+ return RIGHT_RAIL_PANEL_ID_SET.has(id);
+}
+
+/**
+ * The residual (editor) panel id in a live layout: the single id that is not a
+ * registered rail peer. Returns null when the count is not exactly one — zero
+ * means no residual to correct, more than one means an unregistered column is
+ * rendering and would otherwise be mistaken for the editor. A correct layout
+ * always yields exactly one, so the strictness turns the silent-degradation
+ * failure into a no-op the caller can bail on rather than a mis-pinned rail.
+ */
+export function findResidualPanelId(layoutIds: Iterable<string>): string | null {
+ let residual: string | null = null;
+ let count = 0;
+ for (const id of layoutIds) {
+ if (isRightRailPanelId(id)) continue;
+ residual = id;
+ count += 1;
+ if (count > 1) return null;
+ }
+ return count === 1 ? residual : null;
+}
+
+/**
+ * Reconstruct the rail from a layout's ids: the residual editor plus every
+ * present registered peer must exactly cover the layout. Any id left over — an
+ * unregistered column, or a peer dropped from the accounting — makes `ok` false.
+ * The guard the rail model is verified against.
+ */
+export interface RailLayoutAccounting {
+ readonly residualId: string | null;
+ readonly presentPeers: readonly RightRailPanelId[];
+ readonly unaccountedIds: readonly string[];
+ readonly ok: boolean;
+}
+
+export function accountRailLayout(layoutIds: Iterable<string>): RailLayoutAccounting {
+ const ids = [...layoutIds];
+ const residualId = findResidualPanelId(ids);
+ const presentPeers = RIGHT_RAIL_PANEL_ORDER.filter((id) => ids.includes(id));
+ const accounted = new Set<string>(presentPeers);
+ if (residualId != null) accounted.add(residualId);
+ const unaccountedIds = ids.filter((id) => !accounted.has(id));
+ const ok = residualId != null && unaccountedIds.length === 0;
+ return { residualId, presentPeers, unaccountedIds, ok };
+}
diff --git a/packages/app/src/components/editor-area-sticky-repin.test.ts b/packages/app/src/components/editor-area-sticky-repin.test.ts
index 3f2589e2e..3d0c48975 100644
--- a/packages/app/src/components/editor-area-sticky-repin.test.ts
+++ b/packages/app/src/components/editor-area-sticky-repin.test.ts
@@ -71,6 +71,65 @@ describe('computeStickyRepinLayout', () => {
expect(next.editor).toBeCloseTo(100, 6);
});
+ test('preserves peer key order and passes an unpinned peer through (four-peer rail)', () => {
+ // editor | doc-panel | terminal-column | agents-column, with the terminal
+ // column unpinned. The returned layout must keep the same key order (the
+ // library has no ordering prop — source/DOM order is the contract) and pass
+ // the unpinned terminal's share through unchanged.
+ const currentLayout = {
+ editor: 40,
+ 'doc-panel': 20,
+ 'terminal-column': 20,
+ 'agents-column': 20,
+ };
+ const next = computeStickyRepinLayout({
+ currentLayout,
+ containerPx: 1000,
+ pinnedPx: { 'doc-panel': 300, 'agents-column': 200 },
+ residualId: 'editor',
+ });
+ expect(Object.keys(next)).toEqual(['editor', 'doc-panel', 'terminal-column', 'agents-column']);
+ expect(next['terminal-column']).toBeCloseTo(20, 6);
+ expect(next['doc-panel']).toBeCloseTo(30, 6);
+ expect(next['agents-column']).toBeCloseTo(20, 6);
+ expect(next.editor).toBeCloseTo(30, 6);
+ });
+
+ test('expands one rail column while its hidden neighbour stays shut (editor pays)', () => {
+ // Both rail columns are permanent members of the group, so a hidden one is
+ // a zero-width peer rather than an absent panel. Showing the terminal must
+ // take its width from the editor: the panel API cannot do this, because
+ // `expand()`/`resize()` trade with the ADJACENT separator, and the adjacent
+ // agents column has nothing to give at zero width.
+ const next = computeStickyRepinLayout({
+ currentLayout: { editor: 70, 'doc-panel': 30, 'terminal-column': 0, 'agents-column': 0 },
+ containerPx: 2000,
+ pinnedPx: { 'terminal-column': 740, 'agents-column': 0 },
+ residualId: 'editor',
+ });
+ expect(next['terminal-column']).toBeCloseTo(37, 6);
+ expect(next['agents-column']).toBe(0);
+ expect(next['doc-panel']).toBeCloseTo(30, 6);
+ expect(next.editor).toBeCloseTo(33, 6);
+ });
+
+ test('hiding a rail column returns its width to the editor, not the other rail', () => {
+ const next = computeStickyRepinLayout({
+ currentLayout: {
+ editor: 23,
+ 'doc-panel': 15,
+ 'terminal-column': 37,
+ 'agents-column': 25,
+ },
+ containerPx: 2000,
+ pinnedPx: { 'terminal-column': 0, 'agents-column': 500 },
+ residualId: 'editor',
+ });
+ expect(next['terminal-column']).toBe(0);
+ expect(next['agents-column']).toBeCloseTo(25, 6);
+ expect(next.editor).toBeCloseTo(60, 6);
+ });
+
test('is a no-op when the container has no measurable width', () => {
const input = { editor: 60, 'doc-panel': 40 };
expect(
diff --git a/packages/app/src/components/right-rail-admission.test.ts b/packages/app/src/components/right-rail-admission.test.ts
new file mode 100644
index 000000000..24fb2c0b8
--- /dev/null
+++ b/packages/app/src/components/right-rail-admission.test.ts
@@ -0,0 +1,104 @@
+import { describe, expect, test } from 'vitest';
+import {
+ MIN_USABLE_RIGHT_TERMINAL_WIDTH_PX,
+ minimumWorkspaceWidthForRightRailPeers,
+ resolveRightRailAdmission,
+} from './right-rail-admission';
+
+// Boundary the rail can host both session columns at, derived rather than
+// transcribed so a change to the terminal's floor moves the fixtures with it.
+const BOTH_COLUMNS_FIT_PX = minimumWorkspaceWidthForRightRailPeers({
+ otherRailWidthPx: 320,
+ agentsMinimumWidthPx: 320,
+});
+const TOO_NARROW_PX = BOTH_COLUMNS_FIT_PX - 1;
+
+describe('right rail admission', () => {
+ test('admits both panels at the exact width that preserves the terminal floor', () => {
+ const minimumWidth = BOTH_COLUMNS_FIT_PX;
+
+ // Admission weighs the terminal at its drag floor, not its preferred width:
+ // both columns coexist in far more windows than a 740px weighting allowed.
+ expect(MIN_USABLE_RIGHT_TERMINAL_WIDTH_PX).toBe(324);
+ expect(minimumWidth).toBe(1015);
+ expect(
+ resolveRightRailAdmission({
+ workspaceWidthPx: minimumWidth,
+ otherRailWidthPx: 320,
+ agentsMinimumWidthPx: 320,
+ previous: { terminalRightVisible: true, agentsVisible: false },
+ current: { terminalRightVisible: true, agentsVisible: true },
+ trigger: 'state-change',
+ }),
+ ).toEqual({ kind: 'none' });
+ });
+
+ test('moving the terminal right closes agents one pixel below the boundary', () => {
+ expect(
+ resolveRightRailAdmission({
+ workspaceWidthPx: TOO_NARROW_PX,
+ otherRailWidthPx: 320,
+ agentsMinimumWidthPx: 320,
+ previous: { terminalRightVisible: false, agentsVisible: true },
+ current: { terminalRightVisible: true, agentsVisible: true },
+ trigger: 'state-change',
+ }),
+ ).toEqual({ kind: 'close-agents' });
+ });
+
+ test('opening agents closes an existing right terminal when space is infeasible', () => {
+ expect(
+ resolveRightRailAdmission({
+ workspaceWidthPx: TOO_NARROW_PX,
+ otherRailWidthPx: 320,
+ agentsMinimumWidthPx: 320,
+ previous: { terminalRightVisible: true, agentsVisible: false },
+ current: { terminalRightVisible: true, agentsVisible: true },
+ trigger: 'state-change',
+ }),
+ ).toEqual({ kind: 'close-terminal' });
+ });
+
+ test('a resize into infeasibility keeps the terminal and closes agents', () => {
+ const visibility = { terminalRightVisible: true, agentsVisible: true } as const;
+ expect(
+ resolveRightRailAdmission({
+ workspaceWidthPx: TOO_NARROW_PX,
+ otherRailWidthPx: 320,
+ agentsMinimumWidthPx: 320,
+ previous: visibility,
+ current: visibility,
+ trigger: 'resize',
+ }),
+ ).toEqual({ kind: 'close-agents' });
+ });
+
+ test.each([
+ {
+ name: 'closing agents',
+ previous: { terminalRightVisible: true, agentsVisible: true },
+ current: { terminalRightVisible: true, agentsVisible: false },
+ },
+ {
+ name: 'closing the terminal',
+ previous: { terminalRightVisible: true, agentsVisible: true },
+ current: { terminalRightVisible: false, agentsVisible: true },
+ },
+ {
+ name: 'a bottom terminal',
+ previous: { terminalRightVisible: false, agentsVisible: true },
+ current: { terminalRightVisible: false, agentsVisible: true },
+ },
+ ])('$name never opens the other panel', ({ previous, current }) => {
+ expect(
+ resolveRightRailAdmission({
+ workspaceWidthPx: 900,
+ otherRailWidthPx: 320,
+ agentsMinimumWidthPx: 320,
+ previous,
+ current,
+ trigger: 'state-change',
+ }),
+ ).toEqual({ kind: 'none' });
+ });
+});
diff --git a/packages/app/src/components/right-rail-admission.ts b/packages/app/src/components/right-rail-admission.ts
new file mode 100644
index 000000000..f1194f83f
--- /dev/null
+++ b/packages/app/src/components/right-rail-admission.ts
@@ -0,0 +1,67 @@
+import { MIN_TERMINAL_RIGHT_WIDTH } from '@inkeep/open-knowledge-core';
+
+// Admission asks whether both rail columns can coexist at all, so it weighs the
+// terminal at its drag floor rather than its preferred width. Weighing it at the
+// preferred width would evict the agent panel from windows where the user is
+// perfectly willing to run a narrower terminal.
+export const MIN_USABLE_RIGHT_TERMINAL_WIDTH_PX = MIN_TERMINAL_RIGHT_WIDTH;
+
+// react-resizable-panels converts pixel constraints through percentages. One
+// extra pixel absorbs percentage and device-pixel rounding at the rendered edge.
+export const RIGHT_TERMINAL_PANEL_MIN_WIDTH_PX = MIN_USABLE_RIGHT_TERMINAL_WIDTH_PX + 1;
+
+const EDITOR_RESIDUAL_FRACTION = 0.05;
+
+interface RightRailVisibility {
+ readonly terminalRightVisible: boolean;
+ readonly agentsVisible: boolean;
+}
+
+interface RightRailAdmissionInput {
+ readonly workspaceWidthPx: number;
+ readonly otherRailWidthPx: number;
+ readonly agentsMinimumWidthPx: number;
+ readonly previous: RightRailVisibility;
+ readonly current: RightRailVisibility;
+ readonly trigger: 'state-change' | 'resize';
+}
+
+export type RightRailAdmissionDecision =
+ | { readonly kind: 'none' }
+ | { readonly kind: 'close-agents' }
+ | { readonly kind: 'close-terminal' };
+
+export function minimumWorkspaceWidthForRightRailPeers({
+ otherRailWidthPx,
+ agentsMinimumWidthPx,
+}: {
+ readonly otherRailWidthPx: number;
+ readonly agentsMinimumWidthPx: number;
+}): number {
+ const peerWidthPx = otherRailWidthPx + agentsMinimumWidthPx + MIN_USABLE_RIGHT_TERMINAL_WIDTH_PX;
+ return Math.ceil(peerWidthPx / (1 - EDITOR_RESIDUAL_FRACTION));
+}
+
+export function resolveRightRailAdmission({
+ workspaceWidthPx,
+ otherRailWidthPx,
+ agentsMinimumWidthPx,
+ previous,
+ current,
+ trigger,
+}: RightRailAdmissionInput): RightRailAdmissionDecision {
+ if (!current.terminalRightVisible || !current.agentsVisible) return { kind: 'none' };
+
+ const minimumWidthPx = minimumWorkspaceWidthForRightRailPeers({
+ otherRailWidthPx,
+ agentsMinimumWidthPx,
+ });
+ if (workspaceWidthPx >= minimumWidthPx) return { kind: 'none' };
+ if (trigger === 'resize') return { kind: 'close-agents' };
+
+ const agentsJustOpened = !previous.agentsVisible && current.agentsVisible;
+ const terminalWasAlreadyRight = previous.terminalRightVisible;
+ return agentsJustOpened && terminalWasAlreadyRight
+ ? { kind: 'close-terminal' }
+ : { kind: 'close-agents' };
+}
diff --git a/packages/app/src/lib/command-menu-parity.test.ts b/packages/app/src/lib/command-menu-parity.test.ts
index da7b4efaf..3610617f2 100644
--- a/packages/app/src/lib/command-menu-parity.test.ts
+++ b/packages/app/src/lib/command-menu-parity.test.ts
@@ -102,8 +102,10 @@ const PALETTE_COMMAND_LABELS = new Set<string>([
'Hide sidebar',
'Show document panel',
'Hide document panel',
- 'Show Bottom Dock',
- 'Hide Bottom Dock',
+ 'Show Terminal',
+ 'Hide Terminal',
+ 'Move Terminal to right',
+ 'Move Terminal to bottom',
'Show Agents',
'Hide Agents',
'Show hidden files',
@@ -178,7 +180,9 @@ function makeFullDeps(): MenuDeps {
docPanelVisible: true,
onToggleDocPanel: noop,
terminalVisible: true,
+ terminalPlacement: 'bottom',
onToggleTerminal: noop,
+ onMoveTerminal: noop,
onNewTerminal: noop,
onKillTerminal: noop,
onNewTerminalWindow: noop,
@@ -360,7 +364,7 @@ describe('command-menu parity ratchet', () => {
{ menuLabel: 'Settings', shortcutId: 'settings' },
{ menuLabel: 'Hide sidebar', shortcutId: 'toggle-files-sidebar' },
{ menuLabel: 'Hide document panel', shortcutId: 'toggle-document-panel' },
- { menuLabel: 'Hide Bottom Dock', shortcutId: 'toggle-terminal-panel' },
+ { menuLabel: 'Hide Terminal', shortcutId: 'toggle-terminal-panel' },
{ menuLabel: 'Hide Agents', shortcutId: 'toggle-agent-panel' },
];
@@ -631,11 +635,11 @@ describe('menu state-dependent rendering', () => {
const labels = new Set(leaves.map((leaf) => normalizeLabel(leaf.label)));
expect(labels.has('Show sidebar')).toBe(true);
expect(labels.has('Show document panel')).toBe(true);
- expect(labels.has('Show Bottom Dock')).toBe(true);
+ expect(labels.has('Show Terminal')).toBe(true);
// A flipped `visible ? hideKey : showKey` would leave the Hide variants here.
expect(labels.has('Hide sidebar')).toBe(false);
expect(labels.has('Hide document panel')).toBe(false);
- expect(labels.has('Hide Bottom Dock')).toBe(false);
+ expect(labels.has('Hide Terminal')).toBe(false);
});
test('Show/Hide toggles render the Hide variant when the panel is visible', () => {
diff --git a/packages/app/src/lib/dock-session-persistence.test.ts b/packages/app/src/lib/dock-session-persistence.test.ts
index aa9008d37..315724b1a 100644
--- a/packages/app/src/lib/dock-session-persistence.test.ts
+++ b/packages/app/src/lib/dock-session-persistence.test.ts
@@ -10,6 +10,7 @@
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
import type { OkDesktopBridge } from '@/lib/desktop-bridge-types';
import {
+ readDockRestoreState,
readDockSessionOrder,
readWebDockSessionOrder,
writeDockSessionOrder,
@@ -25,7 +26,12 @@ function makeDesktopBridge(
) {
const store = { ...initial };
const setDockState = vi.fn(
- (state: { surface: 'terminal' | 'agents'; order: string[]; activeKey: string | null }) => {
+ (state: {
+ surface: 'terminal' | 'agents';
+ order: string[];
+ activeKey: string | null;
+ terminalSnapshot?: { tabs: []; activeOrdinal: null };
+ }) => {
store[state.surface] = { order: state.order, activeKey: state.activeKey };
},
);
@@ -127,6 +133,28 @@ describe('desktop backend (bridge)', () => {
});
});
+ test('reads session order and the terminal restart snapshot from one bridge state', async () => {
+ const getDockState = vi.fn(async () => ({
+ terminalVisible: true,
+ agentPanelVisible: false,
+ terminal: { order: ['pty-1'], activeKey: 'pty-1' },
+ terminalSnapshot: {
+ tabs: [{ ordinal: 1, customLabel: 'deploy' }],
+ activeOrdinal: 1,
+ },
+ }));
+ const bridge = { terminal: { getDockState } } as unknown as OkDesktopBridge;
+
+ await expect(readDockRestoreState(bridge, 'terminal')).resolves.toEqual({
+ sessionOrder: { order: ['pty-1'], activeKey: 'pty-1' },
+ terminalSnapshot: {
+ tabs: [{ ordinal: 1, customLabel: 'deploy' }],
+ activeOrdinal: 1,
+ },
+ });
+ expect(getDockState).toHaveBeenCalledOnce();
+ });
+
test('writes carry the surface, so main files them apart', () => {
const { bridge, setDockState, store } = makeDesktopBridge();
@@ -140,6 +168,30 @@ describe('desktop backend (bridge)', () => {
});
expect(store.agents).toEqual({ order: ['thread-a'], activeKey: 'thread-a' });
expect(store.terminal).toEqual({ order: ['pty-1'], activeKey: null });
+ expect(setDockState).toHaveBeenNthCalledWith(2, {
+ surface: 'terminal',
+ order: ['pty-1'],
+ activeKey: null,
+ terminalSnapshot: { tabs: [], activeOrdinal: null },
+ });
+ });
+
+ test('window-teardown writes warn without reporting a persistence error', async () => {
+ const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});
+ const error = vi.spyOn(console, 'error').mockImplementation(() => {});
+ const bridge = {
+ terminal: {
+ setDockState: async () => ({ ok: false as const, reason: 'ipc-unavailable' as const }),
+ },
+ } as unknown as OkDesktopBridge;
+
+ writeDockSessionOrder(bridge, 'terminal', { order: ['pty-1'], activeKey: 'pty-1' });
+ await vi.waitFor(() => expect(warn).toHaveBeenCalledOnce());
+
+ expect(error).not.toHaveBeenCalled();
+ expect(warn).toHaveBeenCalledWith(
+ '[dock-session-persistence] setDockState skipped during window teardown',
+ );
});
test('an absent sub-record reads null (fresh launch → cold start)', async () => {
@@ -165,6 +217,37 @@ describe('desktop backend (bridge)', () => {
await expect(readDockSessionOrder(bridge, 'terminal')).resolves.toBeNull();
});
+ test('a rejecting dock-state read settles the complete restore state', async () => {
+ const bridge = {
+ terminal: {
+ getDockState: async () => {
+ throw new Error('ipc torn down mid-reload');
+ },
+ },
+ } as unknown as OkDesktopBridge;
+
+ await expect(readDockRestoreState(bridge, 'terminal')).resolves.toEqual({
+ sessionOrder: null,
+ terminalSnapshot: undefined,
+ });
+ });
+
+ test('a live terminal bridge without dock-state capability ignores stale web order', async () => {
+ writeDockSessionOrder(null, 'terminal', { order: ['stale-pty'], activeKey: 'stale-pty' });
+ const bridge = { terminal: { list: async () => [] } } as unknown as OkDesktopBridge;
+
+ await expect(readDockRestoreState(bridge, 'terminal')).resolves.toEqual({
+ sessionOrder: null,
+ terminalSnapshot: undefined,
+ });
+
+ writeDockSessionOrder(bridge, 'terminal', { order: ['desktop-pty'], activeKey: null });
+ expect(readWebDockSessionOrder('terminal')).toEqual({
+ order: ['stale-pty'],
+ activeKey: 'stale-pty',
+ });
+ });
+
test('a bridge with no dock-state methods falls back to the web backend', async () => {
// A session-only desktop bridge (some E2E hosts) has no `terminal` surface at
// all; duck-typing on the method — not on a host flag — is what keeps that
diff --git a/packages/app/src/lib/dock-session-persistence.ts b/packages/app/src/lib/dock-session-persistence.ts
index f30fad221..38aa6900c 100644
--- a/packages/app/src/lib/dock-session-persistence.ts
+++ b/packages/app/src/lib/dock-session-persistence.ts
@@ -20,7 +20,7 @@
* the server replays). The host maps its descriptors to these keys.
*/
-import type { OkDesktopBridge } from '@/lib/desktop-bridge-types';
+import type { OkDesktopBridge, OkTerminalRestartSnapshot } from '@/lib/desktop-bridge-types';
/** Which panel a persisted order belongs to. */
export type DockSurface = 'terminal' | 'agents';
@@ -32,6 +32,11 @@ export interface DockSessionOrder {
readonly activeKey: string | null;
}
+export interface DockRestoreState {
+ readonly sessionOrder: DockSessionOrder | null;
+ readonly terminalSnapshot: OkTerminalRestartSnapshot | undefined;
+}
+
/** localStorage keys for the web backend — UI-pref stores like the other panel
* prefs (height, width), never a `config.yml` field. */
const WEB_STORAGE_KEYS: Record<DockSurface, string> = {
@@ -80,31 +85,46 @@ function writeWeb(surface: DockSurface, state: DockSessionOrder): void {
* Desktop reads main's per-window state; web reads localStorage synchronously
* (wrapped in a promise for one call shape).
*/
-export function readDockSessionOrder(
+export async function readDockRestoreState(
bridge: OkDesktopBridge | null | undefined,
surface: DockSurface,
-): Promise<DockSessionOrder | null> {
+): Promise<DockRestoreState> {
if (typeof bridge?.terminal?.getDockState === 'function') {
- return bridge.terminal
- .getDockState()
- .then((state) => {
- const record = state[surface];
- if (record == null) return null;
- const { order, activeKey } = coerceOrder(record);
- // No retained order at all (fresh launch) reads as null so the caller
- // cold-starts rather than seeding an empty arrangement.
- return order.length === 0 && activeKey === null ? null : { order, activeKey };
- })
- .catch((err) => {
- // Cold-starting is the right fallback, but silence makes the three
- // failure modes (handler missing, main crashed, serialization) look
- // identical to "nothing was retained" — leaving a user report of "my
- // panel comes back empty" with nothing to grep for.
- console.warn('[dock-session-persistence] getDockState failed; cold-starting:', err);
- return null;
- });
+ try {
+ const state = await bridge.terminal.getDockState();
+ const record = state[surface];
+ if (record == null) {
+ return { sessionOrder: null, terminalSnapshot: state.terminalSnapshot };
+ }
+ const { order, activeKey } = coerceOrder(record);
+ // No retained order at all (fresh launch) reads as null so the caller
+ // cold-starts rather than seeding an empty arrangement.
+ const sessionOrder = order.length === 0 && activeKey === null ? null : { order, activeKey };
+ return { sessionOrder, terminalSnapshot: state.terminalSnapshot };
+ } catch (err) {
+ // Cold-starting is the right fallback, but silence makes the three
+ // failure modes (handler missing, main crashed, serialization) look
+ // identical to "nothing was retained" — leaving a user report of "my
+ // panel comes back empty" with nothing to grep for.
+ console.warn('[dock-session-persistence] getDockState failed; cold-starting:', err);
+ return { sessionOrder: null, terminalSnapshot: undefined };
+ }
}
- return Promise.resolve(readWebDockSessionOrder(surface));
+
+ // A live terminal bridge is desktop state even when an older host lacks the
+ // dock-state capability. Mixing in origin-wide web storage can reorder main's
+ // per-window survivors, so this capability gap must cold-start instead.
+ return {
+ sessionOrder: bridge?.terminal == null ? readWebDockSessionOrder(surface) : null,
+ terminalSnapshot: undefined,
+ };
+}
+
+export function readDockSessionOrder(
+ bridge: OkDesktopBridge | null | undefined,
+ surface: DockSurface,
+): Promise<DockSessionOrder | null> {
+ return readDockRestoreState(bridge, surface).then((state) => state.sessionOrder);
}
/** Persist one panel's order for this window/origin. Fire-and-forget on both backends. */
@@ -112,14 +132,32 @@ export function writeDockSessionOrder(
bridge: OkDesktopBridge | null | undefined,
surface: DockSurface,
state: DockSessionOrder,
+ terminalSnapshot: OkTerminalRestartSnapshot = { tabs: [], activeOrdinal: null },
): void {
if (typeof bridge?.terminal?.setDockState === 'function') {
- bridge.terminal.setDockState({
- surface,
+ const sessionState = {
order: [...state.order],
activeKey: state.activeKey,
- });
+ };
+ const write =
+ surface === 'terminal'
+ ? bridge.terminal.setDockState({ surface: 'terminal', ...sessionState, terminalSnapshot })
+ : bridge.terminal.setDockState({ surface: 'agents', ...sessionState });
+ void Promise.resolve(write)
+ .then((result) => {
+ if (result?.ok === false) {
+ if (result.reason === 'ipc-unavailable') {
+ console.warn('[dock-session-persistence] setDockState skipped during window teardown');
+ } else {
+ console.error('[dock-session-persistence] setDockState failed:', result.reason);
+ }
+ }
+ })
+ .catch((err: unknown) => {
+ console.error('[dock-session-persistence] setDockState rejected:', err);
+ });
return;
}
+ if (bridge?.terminal != null) return;
writeWeb(surface, state);
}
diff --git a/packages/app/src/lib/keyboard-shortcuts.ts b/packages/app/src/lib/keyboard-shortcuts.ts
index 8c43e604f..31049046a 100644
--- a/packages/app/src/lib/keyboard-shortcuts.ts
+++ b/packages/app/src/lib/keyboard-shortcuts.ts
@@ -222,8 +222,8 @@ const KEYBOARD_SHORTCUT_DEFINITIONS = [
{
id: 'toggle-terminal-panel',
category: 'general',
- title: msg`Show or hide bottom dock`,
- description: msg`Toggle the bottom dock, where the terminal lives.`,
+ title: msg`Show or hide Terminal`,
+ description: msg`Toggle Terminal in its current dock.`,
scope: msg`OK Desktop`,
// ⌘J must stay bindings[0]: `formatShortcut` renders only the first binding,
// and the menu-accelerator parity ratchet compares that against the View
diff --git a/packages/app/src/lib/menu-label-parity.test.ts b/packages/app/src/lib/menu-label-parity.test.ts
index 9dd8f4c2f..6370b0188 100644
--- a/packages/app/src/lib/menu-label-parity.test.ts
+++ b/packages/app/src/lib/menu-label-parity.test.ts
@@ -65,9 +65,11 @@ describe('palette label map covers every registry labelKey (Phase 2b)', () => {
if (!cmd.palette) continue;
const keys = cmd.stateToggle
? [cmd.stateToggle.showKey, cmd.stateToggle.hideKey]
- : cmd.labelKey !== undefined
- ? [cmd.labelKey]
- : [];
+ : cmd.placementToggle
+ ? [cmd.placementToggle.bottomKey, cmd.placementToggle.rightKey]
+ : cmd.labelKey !== undefined
+ ? [cmd.labelKey]
+ : [];
for (const key of keys) {
it(`palette command "${cmd.id}" label key "${key}" has a descriptor`, () => {
expect(key in PALETTE_COMMAND_LABELS).toBe(true);
diff --git a/packages/app/src/lib/ok-menu-actions.ts b/packages/app/src/lib/ok-menu-actions.ts
index af9e09d19..4275d4515 100644
--- a/packages/app/src/lib/ok-menu-actions.ts
+++ b/packages/app/src/lib/ok-menu-actions.ts
@@ -41,6 +41,7 @@ export const OK_MENU_ACTIONS = [
'collapse-all-tree',
'toggle-doc-panel',
'toggle-terminal',
+ 'move-terminal',
'toggle-agent-panel',
'new-terminal',
'kill-terminal',
diff --git a/packages/app/src/lib/terminal-placement-store.test.ts b/packages/app/src/lib/terminal-placement-store.test.ts
new file mode 100644
index 000000000..92e0ca02b
--- /dev/null
+++ b/packages/app/src/lib/terminal-placement-store.test.ts
@@ -0,0 +1,43 @@
+import { describe, expect, test } from 'vitest';
+import {
+ DEFAULT_TERMINAL_PLACEMENT,
+ readTerminalPlacement,
+ TERMINAL_PLACEMENT_KEY,
+ type TerminalPlacementStorage,
+ writeTerminalPlacement,
+} from './terminal-placement-store.ts';
+
+function memoryStorage(initial: Record<string, string> = {}): TerminalPlacementStorage {
+ const data = new Map(Object.entries(initial));
+ return {
+ getItem(key) {
+ return data.get(key) ?? null;
+ },
+ setItem(key, value) {
+ data.set(key, value);
+ },
+ };
+}
+
+describe('terminal placement persistence', () => {
+ test('a fresh profile starts in the bottom home', () => {
+ expect(readTerminalPlacement(memoryStorage())).toBe('bottom');
+ expect(DEFAULT_TERMINAL_PLACEMENT).toBe('bottom');
+ });
+
+ test.each(['right', 'bottom'] as const)('round-trips the %s home', (placement) => {
+ const storage = memoryStorage();
+ writeTerminalPlacement(placement, storage);
+ expect(storage.getItem(TERMINAL_PLACEMENT_KEY)).toBe(placement);
+ expect(readTerminalPlacement(storage)).toBe(placement);
+ });
+
+ test.each([
+ '',
+ 'sideways',
+ '{"placement":"right"}',
+ ])('defaults malformed or unsupported value %j to bottom', (value) => {
+ const storage = memoryStorage({ [TERMINAL_PLACEMENT_KEY]: value });
+ expect(readTerminalPlacement(storage)).toBe('bottom');
+ });
+});
diff --git a/packages/app/src/lib/terminal-placement-store.ts b/packages/app/src/lib/terminal-placement-store.ts
new file mode 100644
index 000000000..a38940422
--- /dev/null
+++ b/packages/app/src/lib/terminal-placement-store.ts
@@ -0,0 +1,36 @@
+import {
+ DEFAULT_TERMINAL_PLACEMENT,
+ normalizeTerminalPlacement,
+ type TerminalPlacement,
+} from '@inkeep/open-knowledge-core';
+
+export type { TerminalPlacement } from '@inkeep/open-knowledge-core';
+export { DEFAULT_TERMINAL_PLACEMENT } from '@inkeep/open-knowledge-core';
+
+export const TERMINAL_PLACEMENT_KEY = 'ok-terminal-placement-v1';
+
+export interface TerminalPlacementStorage {
+ getItem(key: string): string | null;
+ setItem(key: string, value: string): void;
+}
+
+export function readTerminalPlacement(storage?: TerminalPlacementStorage): TerminalPlacement {
+ try {
+ const target = storage ?? localStorage;
+ return normalizeTerminalPlacement(target.getItem(TERMINAL_PLACEMENT_KEY));
+ } catch {
+ return DEFAULT_TERMINAL_PLACEMENT;
+ }
+}
+
+export function writeTerminalPlacement(
+ placement: TerminalPlacement,
+ storage?: TerminalPlacementStorage,
+): void {
+ try {
+ const target = storage ?? localStorage;
+ target.setItem(TERMINAL_PLACEMENT_KEY, placement);
+ } catch {
+ // Browser storage can reject access; the in-memory placement remains usable for the session.
+ }
+}
diff --git a/packages/app/src/lib/terminal-right-width-store.test.ts b/packages/app/src/lib/terminal-right-width-store.test.ts
new file mode 100644
index 000000000..b3b93f77a
--- /dev/null
+++ b/packages/app/src/lib/terminal-right-width-store.test.ts
@@ -0,0 +1,65 @@
+import { describe, expect, test } from 'vitest';
+import {
+ MIN_TERMINAL_RIGHT_WIDTH,
+ PREFERRED_TERMINAL_RIGHT_WIDTH,
+ readTerminalRightWidth,
+ TERMINAL_RIGHT_WIDTH_KEY,
+ type TerminalRightWidthStorage,
+ writeTerminalRightWidth,
+} from './terminal-right-width-store.ts';
+
+const LEGACY_AGENTS_WIDTH_KEY = 'ok-terminal-width-v1';
+
+function memoryStorage(initial: Record<string, string> = {}): TerminalRightWidthStorage {
+ const data = new Map(Object.entries(initial));
+ return {
+ getItem(key) {
+ return data.get(key) ?? null;
+ },
+ setItem(key, value) {
+ data.set(key, value);
+ },
+ };
+}
+
+describe('right-terminal width persistence', () => {
+ test('uses a fresh default without reading the agents-panel legacy value', () => {
+ const storage = memoryStorage({ [LEGACY_AGENTS_WIDTH_KEY]: '875' });
+ expect(readTerminalRightWidth(storage)).toBe(PREFERRED_TERMINAL_RIGHT_WIDTH);
+ expect(TERMINAL_RIGHT_WIDTH_KEY).not.toBe(LEGACY_AGENTS_WIDTH_KEY);
+ });
+
+ test('keeps a width the user dragged below the preferred width', () => {
+ const storage = memoryStorage();
+ writeTerminalRightWidth(400, storage);
+ expect(readTerminalRightWidth(storage)).toBe(400);
+ });
+
+ test('round-trips a supported width', () => {
+ const storage = memoryStorage();
+ writeTerminalRightWidth(840, storage);
+ expect(readTerminalRightWidth(storage)).toBe(840);
+ });
+
+ test('clamps a width below the supported floor', () => {
+ const storage = memoryStorage({ [TERMINAL_RIGHT_WIDTH_KEY]: '100' });
+ expect(readTerminalRightWidth(storage)).toBe(MIN_TERMINAL_RIGHT_WIDTH);
+ });
+
+ test.each(['', 'not a number', '840px', 'Infinity'])('defaults malformed value %j', (value) => {
+ const storage = memoryStorage({ [TERMINAL_RIGHT_WIDTH_KEY]: value });
+ expect(readTerminalRightWidth(storage)).toBe(PREFERRED_TERMINAL_RIGHT_WIDTH);
+ });
+
+ test('does not impose a persistence ceiling on a finite width', () => {
+ const storage = memoryStorage({ [TERMINAL_RIGHT_WIDTH_KEY]: '2400' });
+ expect(readTerminalRightWidth(storage)).toBe(2400);
+ });
+
+ test('writes only the fresh width key and leaves the agents-panel key untouched', () => {
+ const storage = memoryStorage({ [LEGACY_AGENTS_WIDTH_KEY]: '875' });
+ writeTerminalRightWidth(700, storage);
+ expect(storage.getItem(TERMINAL_RIGHT_WIDTH_KEY)).toBe('700');
+ expect(storage.getItem(LEGACY_AGENTS_WIDTH_KEY)).toBe('875');
+ });
+});
diff --git a/packages/app/src/lib/terminal-right-width-store.ts b/packages/app/src/lib/terminal-right-width-store.ts
new file mode 100644
index 000000000..2cafd898a
--- /dev/null
+++ b/packages/app/src/lib/terminal-right-width-store.ts
@@ -0,0 +1,39 @@
+import {
+ normalizeTerminalRightWidth,
+ PREFERRED_TERMINAL_RIGHT_WIDTH,
+} from '@inkeep/open-knowledge-core';
+
+export {
+ MIN_TERMINAL_RIGHT_WIDTH,
+ PREFERRED_TERMINAL_RIGHT_WIDTH,
+} from '@inkeep/open-knowledge-core';
+
+export const TERMINAL_RIGHT_WIDTH_KEY = 'ok-terminal-right-width-v1';
+
+export interface TerminalRightWidthStorage {
+ getItem(key: string): string | null;
+ setItem(key: string, value: string): void;
+}
+
+export function readTerminalRightWidth(storage?: TerminalRightWidthStorage): number {
+ try {
+ const target = storage ?? localStorage;
+ const raw = target.getItem(TERMINAL_RIGHT_WIDTH_KEY);
+ if (raw === null || raw.trim() === '') return PREFERRED_TERMINAL_RIGHT_WIDTH;
+ const parsed = Number(raw);
+ return Number.isFinite(parsed)
+ ? normalizeTerminalRightWidth(parsed)
+ : PREFERRED_TERMINAL_RIGHT_WIDTH;
+ } catch {
+ return PREFERRED_TERMINAL_RIGHT_WIDTH;
+ }
+}
+
+export function writeTerminalRightWidth(width: number, storage?: TerminalRightWidthStorage): void {
+ try {
+ const target = storage ?? localStorage;
+ target.setItem(TERMINAL_RIGHT_WIDTH_KEY, String(normalizeTerminalRightWidth(width)));
+ } catch {
+ // Browser storage can reject access; the in-memory width remains usable for the session.
+ }
+}
diff --git a/packages/app/src/locales/ar/messages.json b/packages/app/src/locales/ar/messages.json
index 4215716f3..875697179 100644
--- a/packages/app/src/locales/ar/messages.json
+++ b/packages/app/src/locales/ar/messages.json
@@ -32,6 +32,7 @@
],
"-7s4fw": ["البحث في الوكلاء"],
"-8PP0T": ["مطابقة حالة الأحرف"],
+ "-Al4WQ": ["إظهار Terminal أو إخفاؤه"],
"-FeyRg": ["الاحتفاظ بالملف الأصلي"],
"-K0AvT": ["قطع الاتصال"],
"-LHLx7": ["حرّر قالبًا"],
@@ -208,6 +209,7 @@
"2RnFoM": ["تعذّر استئناف هذه المحادثة: ", ["0"]],
"2Snes1": ["هذا يرسل عنوان الرابط خارج جهازك"],
"2UgoBZ": ["غير موجود"],
+ "2VSPan": ["أُغلق Terminal لإفساح المجال للوحة الوكيل."],
"2XQ8Ww": ["فتح المعاينة عند تحرير الوكيل"],
"2YOwme": ["أُعيد التشغيل — يعمل الآن بالإصدار v", ["appRuntime"], "."],
"2YZwPB": ["لم تطابق استجابة الروابط الصادرة الشكل المتوقع."],
@@ -763,6 +765,7 @@
"9uI_rE": ["تراجع"],
"9uRLEH": ["تعذّر فتح «", ["name"], "» — ليست ضمن مهارات المشروع بعد."],
"9wQrUU": ["إعادة هيكلة"],
+ "9xCnv8": ["إخفاء Terminal"],
"9zb2WA": ["يجري الاتصال"],
"A1taO8": ["بحث"],
"A50vr3": ["استخدم الحروف الصغيرة والأرقام و<0>-</0> فقط."],
@@ -1524,6 +1527,7 @@
"KDuPiY": ["يجري رفع ", ["fileName"]],
"KDw4GX": ["أعد المحاولة"],
"KFd4xz": ["غائب"],
+ "KGF42E": ["أُغلقت لوحة الوكيل لإبقاء Terminal سهل القراءة."],
"KGJb9_": ["التعارضات"],
"KH5bQi": ["يُستخدم متغير البيئة <0>OK_EMBEDDINGS_API_KEY</0> (مُدار خارج OpenKnowledge)."],
"KIIamL": [
@@ -1732,6 +1736,7 @@
"الرابط الرمزي مؤشِّر إلى المجلد المصدر بدلًا من أن يكون مجلدًا قائمًا بذاته. يقرأ كل موقع البايتات نفسها تمامًا، فلا شيء يمكن أن ينحرف، لكن الموقع يتوقف عن العمل إذا حُذف المصدر."
],
"MTs6g3": ["تعذّرت إعادة الاتصال بعد إعادة تشغيل الخادم"],
+ "MU_NVW": ["طي Terminal"],
"MUrVEo": ["لا توجد مشاريع حديثة."],
"MV-Dkb": ["عُثر على ", ["countDisplay"], " ملف Markdown"],
"MVxpbf": ["بحث واستبدال"],
@@ -1795,7 +1800,6 @@
"NRSLBe": ["قبل ", ["diffMin"], " دقيقة"],
"NSnIUP": ["صفحتان (زوجي)"],
"NUr4kz": ["نقطة انطلاق قابلة لإعادة الاستخدام للمستندات الجديدة في هذا المجلد."],
- "NUw7lo": ["إظهار اللوحة السفلية أو إخفاؤها، حيث توجد الطرفية."],
"NYUhy5": ["اسم المجلد الفرعي"],
"NYn1cR": ["يجري تحميل المحرر"],
"NYu2Pt": ["مشروع جديد…"],
@@ -1957,6 +1961,7 @@
],
"PrJYSN": ["هذا المجلد ليس على GitHub بعد. لن يعمل الرابط حتى يُدفع."],
"PrVaZo": ["هل تلغي تثبيت OpenKnowledge؟"],
+ "PrWQiT": ["نقل Terminal إلى اليمين"],
"PrhzDE": ["تحريك لأعلى"],
"Q-DKvr": ["التثبيت من ", ["source"]],
"Q1mtyd": ["إخفاء الشريط الجانبي"],
@@ -2107,6 +2112,7 @@
"S9Vnum": ["إزالة ", ["patternText"]],
"S9t1PI": ["يجري إصلاح ", ["0"], "/", ["1"]],
"SCoBBH": ["اقتراحات الوسوم"],
+ "SCveu1": ["أظهر Terminal أو أخفه في موضع الإرساء الحالي."],
"SCzAbA": [["phase"], " — ", ["pct"], "%"],
"SF9qpO": ["شارك بريدك الإلكتروني للمتابعة"],
"SFEWV6": ["تعذّر تحميل مهارات OpenKnowledge. أعد المحاولة."],
@@ -2203,6 +2209,7 @@
"TiPvBP": ["اختيار لون"],
"Tjc1pH": ["القسم <0>(مرساة عنوان اختيارية)</0>"],
"Tn5sik": ["يخبر الوكلاء متى يلجؤون إلى هذه المهارة. يمكنك تحريره لاحقًا."],
+ "Tofsyo": ["نقل Terminal إلى الأسفل"],
"Tq3pcs": ["الاحتفاظ بنسختي"],
"Tq9kNX": ["لا توجد محادثات مفتوحة. أعد فتح محادثة سابقة، أو ابدأ محادثة جديدة بزر +."],
"TsZmgr": ["الملف على القرص، والمعرّف الذي يستخدمه الوكلاء."],
@@ -2436,7 +2443,6 @@
"Wh0im4": ["يحرّر [[", ["realCurrentDoc"], "]]"],
"WhOsNE": ["يتوسطه خط"],
"Wi-VWy": ["تعذّر إرسال التقرير"],
- "WiGqD8": ["إظهار اللوحة السفلية"],
"WkTLN7": ["إظهار ملفات Markdown فقط"],
"WkyP2p": ["قسم المهارات"],
"WmPbvm": ["احصل على تحديثات المنتج في بريدك."],
@@ -2543,7 +2549,6 @@
"YJPN3F": ["بطيء جدًا"],
"YKLP_-": ["أُعيدت تسمية القالب"],
"YLMBSd": ["مثال: تجمّد المحرر بعد لصق جدول كبير"],
- "YM5oO0": ["إظهار اللوحة السفلية أو إخفاؤها"],
"YMlS7s": ["فتح في التطبيق الافتراضي"],
"YPFBfr": [["detail"], " - لا يزال ", ["kind"], " «", ["createdPath"], "» موجودًا على القرص"],
"YRavYS": [
@@ -3199,6 +3204,7 @@
["descriptorLabel"],
"> (على الأرجح خاصية غير صالحة). انسخ المصدر لمعرفة الخطأ، أو احذف الكتلة."
],
+ "g5V4_P": ["طي لوحة الوكيل"],
"g5w1sF": [
"اختر مجلدًا لدمجه في ",
["display"],
@@ -3458,6 +3464,7 @@
"jZ_E5M": ["فشل الجلب — راجع سجلات الخادم للتفاصيل."],
"j_Z6g7": ["الافتراضي المشترك"],
"jbSG8V": ["إظهار الملفات (", ["sidebarShortcutLabel"], ")"],
+ "jcEoUi": ["نقل إلى اللوحة اليمنى"],
"jdGUeI": ["تعذّر إنشاء القالب: ", ["error"]],
"jeCFV7": ["النقل إلى جزء جديد على اليمين"],
"jeJexw": ["تعذّر إتمام تثبيت ", ["0"], " — انظر أدناه."],
@@ -3844,7 +3851,6 @@
"o0bHtA": ["من OpenKnowledge"],
"o2yoFu": ["الكشف في Finder، لا مساحة عمل"],
"o49mDZ": ["يجري تحميل سجل الخط الزمني"],
- "o5jB-D": ["طيّ اللوحة"],
"o9CrsQ": ["research-note"],
"o9fPtM": ["التحديث التلقائي من المصدر"],
"oAFVKX": ["فشل تحديث افتراضي مزامنة المشروع — ", ["detail"]],
@@ -3907,7 +3913,6 @@
"pAgkuZ": ["يجري إعادة فتح «", ["docName"], "» بذاكرة تعاون محلية جديدة."],
"pBROkv": ["شكرًا لاشتراكك. راقب بريدك لتحديثات المنتج."],
"pCralD": ["النقل إلى جزء جديد على اليسار"],
- "pDD2Hm": ["إخفاء اللوحة السفلية"],
"pEQFsW": ["لا توجد مشاريع مطابقة."],
"pFPzHA": ["منتقي الرموز التعبيرية"],
"pFRz_E": ["استبعد هذه التعليقات من هذه الرسالة"],
@@ -4582,6 +4587,7 @@
"xeXS4P": ["أو استخدم حزمة بداية"],
"xeiujy": ["نص"],
"xhlFsx": ["موروث — اضبط قيمة هنا لاستبداله."],
+ "xi9KGG": ["إظهار Terminal"],
"xiv-dW": ["لا توجد ملفات بعد."],
"xlQpTE": ["مزيد من خيارات الرفض"],
"xloBjn": ["المسار النسبي"],
diff --git a/packages/app/src/locales/ar/messages.po b/packages/app/src/locales/ar/messages.po
index 76df3be32..74cb9cb4f 100644
--- a/packages/app/src/locales/ar/messages.po
+++ b/packages/app/src/locales/ar/messages.po
@@ -1365,6 +1365,10 @@ msgstr "ملف إعداد الوكيل"
msgid "Agent mode"
msgstr "وضع الوكيل"
+#: src/components/EditorArea.tsx
+msgid "Agent panel closed to keep Terminal readable."
+msgstr "أُغلقت لوحة الوكيل لإبقاء Terminal سهل القراءة."
+
#: src/components/acp/ThreadView.tsx
msgid "Agent settings"
msgstr "إعدادات الوكيل"
@@ -2496,6 +2500,10 @@ msgstr "طيّ"
msgid "Collapse {keyName}"
msgstr "طيّ {keyName}"
+#: src/components/TerminalTabStrip.tsx
+msgid "Collapse agent panel"
+msgstr "طي لوحة الوكيل"
+
#: src/components/AppMenubar.tsx
#: src/components/command-palette-commands.ts
#: src/components/FileSidebar.tsx
@@ -2520,8 +2528,8 @@ msgid "Collapse graph"
msgstr "طيّ الرسم البياني"
#: src/components/TerminalTabStrip.tsx
-msgid "Collapse panel"
-msgstr "طيّ اللوحة"
+msgid "Collapse Terminal"
+msgstr "طي Terminal"
#: src/editor/slash-command/component-items.tsx
msgid "Collapsible content block (Notion-style toggle)."
@@ -5738,10 +5746,6 @@ msgstr "إخفاء المتقدم"
msgid "Hide Agents"
msgstr "إخفاء الوكلاء"
-#: src/components/command-palette-commands.ts
-msgid "Hide Bottom Dock"
-msgstr "إخفاء اللوحة السفلية"
-
#: src/components/acp/ThreadView.tsx
msgid "Hide details"
msgstr "إخفاء التفاصيل"
@@ -5816,6 +5820,10 @@ msgstr "إخفاء معاينة التحديد"
msgid "Hide sidebar"
msgstr "إخفاء الشريط الجانبي"
+#: src/components/command-palette-commands.ts
+msgid "Hide Terminal"
+msgstr "إخفاء Terminal"
+
#: src/comments/comment-chips.tsx
msgid "Hide these comments"
msgstr "إخفاء هذه التعليقات"
@@ -7019,6 +7027,16 @@ msgstr "انقل هذا الملف أو أعد تسميته داخل المها
msgid "Move succeeded but the sidebar may be out of date — refresh to resync"
msgstr "نجح النقل لكن الشريط الجانبي قد يكون قديمًا — حدّث لإعادة المزامنة"
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to bottom"
+msgstr "نقل Terminal إلى الأسفل"
+
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to right"
+msgstr "نقل Terminal إلى اليمين"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move the current block up or down one position."
msgstr "حرّك الكتلة الحالية موضعًا واحدًا لأعلى أو لأسفل."
@@ -7054,6 +7072,10 @@ msgstr "النقل إلى جزء جديد على اليسار"
msgid "Move to new pane right"
msgstr "النقل إلى جزء جديد على اليمين"
+#: src/components/TerminalTabStrip.tsx
+msgid "Move to right panel"
+msgstr "نقل إلى اللوحة اليمنى"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move to the next CodeMirror lint diagnostic."
msgstr "انتقل إلى تشخيص الفحص التالي في CodeMirror."
@@ -10594,10 +10616,6 @@ msgstr "إظهار الوكلاء"
msgid "Show All"
msgstr "إظهار الكل"
-#: src/components/command-palette-commands.ts
-msgid "Show Bottom Dock"
-msgstr "إظهار اللوحة السفلية"
-
#: src/components/acp/ThreadView.tsx
msgid "Show details"
msgstr "إظهار التفاصيل"
@@ -10665,10 +10683,6 @@ msgstr "إظهار ملفات Markdown فقط"
msgid "Show or hide agents"
msgstr "إظهار الوكلاء أو إخفاؤهم"
-#: src/lib/keyboard-shortcuts.ts
-msgid "Show or hide bottom dock"
-msgstr "إظهار اللوحة السفلية أو إخفاؤها"
-
#: src/lib/keyboard-shortcuts.ts
msgid "Show or hide document panel"
msgstr "إظهار لوحة المستند أو إخفاؤها"
@@ -10677,6 +10691,10 @@ msgstr "إظهار لوحة المستند أو إخفاؤها"
msgid "Show or hide Files"
msgstr "إظهار الملفات أو إخفاؤها"
+#: src/lib/keyboard-shortcuts.ts
+msgid "Show or hide Terminal"
+msgstr "إظهار Terminal أو إخفاؤه"
+
#: src/components/AgentDiffPane.tsx
#: src/components/EditorToolbar.tsx
#: src/components/TimelineDiffPane.tsx
@@ -10717,6 +10735,10 @@ msgstr "إظهار الشريط الجانبي"
msgid "Show source"
msgstr "إظهار المصدر"
+#: src/components/command-palette-commands.ts
+msgid "Show Terminal"
+msgstr "إظهار Terminal"
+
#: src/comments/comment-chips.tsx
msgid "Show these comments"
msgstr "إظهار هذه التعليقات"
@@ -11540,6 +11562,10 @@ msgstr "الطرفية {0}"
msgid "Terminal access isn't enabled for this project."
msgstr "الوصول إلى الطرفية غير مفعّل لهذا المشروع."
+#: src/components/EditorArea.tsx
+msgid "Terminal closed to make room for the agent panel."
+msgstr "أُغلق Terminal لإفساح المجال للوحة الوكيل."
+
#: src/components/TerminalGate.tsx
msgid "Terminal disabled"
msgstr "الطرفية معطّلة"
@@ -12285,8 +12311,8 @@ msgid "Toggle strikethrough formatting."
msgstr "بدّل تنسيق الخط في المنتصف."
#: src/lib/keyboard-shortcuts.ts
-msgid "Toggle the bottom dock, where the terminal lives."
-msgstr "إظهار اللوحة السفلية أو إخفاؤها، حيث توجد الطرفية."
+msgid "Toggle Terminal in its current dock."
+msgstr "أظهر Terminal أو أخفه في موضع الإرساء الحالي."
#: src/lib/keyboard-shortcuts.ts
msgid "Toggle the left file sidebar."
diff --git a/packages/app/src/locales/bn/messages.json b/packages/app/src/locales/bn/messages.json
index 1a164751a..2fdc216f9 100644
--- a/packages/app/src/locales/bn/messages.json
+++ b/packages/app/src/locales/bn/messages.json
@@ -8,6 +8,7 @@
"-5jISU": [["0", "plural", { "one": ["#", " টেমপ্লেট"], "other": ["#", " টেমপ্লেট"] }]],
"-7s4fw": ["এজেন্ট খুঁজুন"],
"-8PP0T": ["অক্ষরের ছাঁদ মেলান"],
+ "-Al4WQ": ["Terminal দেখান বা লুকান"],
"-FeyRg": ["মূল ফাইলটি রাখুন"],
"-K0AvT": ["সংযোগ বিচ্ছিন্ন করুন"],
"-LHLx7": ["টেমপ্লেট সম্পাদিত হয়েছে"],
@@ -185,6 +186,7 @@
"2RnFoM": ["এই চ্যাট পুনরায় শুরু করা যায়নি: ", ["0"]],
"2Snes1": ["এটি লিংকের ঠিকানা আপনার মেশিনের বাইরে পাঠায়"],
"2UgoBZ": ["চলে গেছে"],
+ "2VSPan": ["এজেন্ট প্যানেলের জন্য জায়গা করতে Terminal বন্ধ করা হয়েছে।"],
"2XQ8Ww": ["এজেন্ট সম্পাদনা করলে প্রাকদর্শন খুলুন"],
"2YOwme": ["পুনরায় চালু হয়েছে — এখন v", ["appRuntime"], " চলছে।"],
"2YZwPB": ["বহির্গামী লিংকের সাড়া প্রত্যাশিত আকারের সঙ্গে মেলেনি।"],
@@ -660,6 +662,7 @@
"9uI_rE": ["পূর্বাবস্থায় ফেরান"],
"9uRLEH": ["\"", ["name"], "\" খোলা যায়নি — এটি এখনও প্রকল্পের স্কিলে নেই।"],
"9wQrUU": ["পুনর্গঠন"],
+ "9xCnv8": ["Terminal লুকান"],
"9zb2WA": ["যুক্ত হচ্ছে"],
"A1taO8": ["খুঁজুন"],
"A50vr3": ["কেবল ছোট হাতের অক্ষর, অঙ্ক ও <0>-</0> ব্যবহার করুন।"],
@@ -1286,6 +1289,7 @@
"KDuPiY": [["fileName"], " আপলোড করা হচ্ছে"],
"KDw4GX": ["আবার চেষ্টা করুন"],
"KFd4xz": ["অনুপস্থিত"],
+ "KGF42E": ["Terminal পাঠযোগ্য রাখতে এজেন্ট প্যানেল বন্ধ করা হয়েছে।"],
"KGJb9_": ["দ্বন্দ্ব"],
"KH5bQi": [
"<0>OK_EMBEDDINGS_API_KEY</0> পরিবেশ চলক ব্যবহার করা হচ্ছে (OpenKnowledge-এর বাইরে পরিচালিত)।"
@@ -1457,6 +1461,7 @@
"সিমলিংক নিজের একটি ফোল্ডার না হয়ে বরং উৎস ফোল্ডারের দিকে একটি নির্দেশক। প্রতিটি জায়গা ঠিক একই বাইট পড়ে, তাই কিছুই আলাদা হয়ে যেতে পারে না, আর উৎস মুছে ফেললে সেই জায়গাটি কাজ করা বন্ধ করে দেয়।"
],
"MTs6g3": ["সার্ভার পুনরায় চালুর পর আবার যুক্ত হওয়া যায়নি"],
+ "MU_NVW": ["Terminal সংকুচিত করুন"],
"MUrVEo": ["কোনো সাম্প্রতিক প্রকল্প নেই।"],
"MV-Dkb": [["countDisplay"], "টি markdown ফাইল পাওয়া গেছে"],
"MVxpbf": ["খুঁজুন ও বদলান"],
@@ -1519,7 +1524,6 @@
"NRSLBe": [["diffMin"], " মিনিট আগে"],
"NSnIUP": ["দুই পাতা (জোড়)"],
"NUr4kz": ["এই ফোল্ডারে নতুন নথির জন্য একটি পুনর্ব্যবহারযোগ্য শুরুর বিন্দু।"],
- "NUw7lo": ["নিচের প্যানেল দেখান বা লুকান, যেখানে টার্মিনাল থাকে।"],
"NYUhy5": ["উপ-ফোল্ডারের নাম"],
"NYn1cR": ["সম্পাদক লোড হচ্ছে"],
"NYu2Pt": ["নতুন প্রকল্প…"],
@@ -1683,6 +1687,7 @@
],
"PrJYSN": ["এই ফোল্ডারটি এখনও GitHub-এ নেই। এটি না পাঠানো পর্যন্ত লিংকটি কাজ করবে না।"],
"PrVaZo": ["OpenKnowledge সরাবেন?"],
+ "PrWQiT": ["Terminal ডান দিকে সরান"],
"PrhzDE": ["উপরে সরান"],
"Q-DKvr": [["source"], " থেকে ইনস্টল করুন"],
"Q1mtyd": ["সাইডবার লুকান"],
@@ -1822,6 +1827,7 @@
"S9Vnum": [["patternText"], " সরান"],
"S9t1PI": [["0"], "/", ["1"], " ঠিক করা হচ্ছে"],
"SCoBBH": ["ট্যাগের পরামর্শ"],
+ "SCveu1": ["Terminal-কে তার বর্তমান ডকে দেখান বা লুকান।"],
"SCzAbA": [["phase"], " — ", ["pct"], "%"],
"SF9qpO": ["পরবর্তী যোগাযোগের জন্য আপনার ইমেইল দিন"],
"SFEWV6": ["OpenKnowledge স্কিল লোড করা যায়নি। আবার চেষ্টা করুন।"],
@@ -1898,6 +1904,7 @@
"TiPvBP": ["রং বেছে নিন"],
"Tjc1pH": ["বিভাগ <0>(ঐচ্ছিক শিরোনাম অ্যাংকর)</0>"],
"Tn5sik": ["এজেন্টদের জানায় এই স্কিলটি কখন কাজে লাগাতে হবে। আপনি পরে এটি সম্পাদনা করতে পারবেন।"],
+ "Tofsyo": ["Terminal নিচে সরান"],
"Tq3pcs": ["আমারটি রাখুন"],
"Tq9kNX": ["কোনো খোলা চ্যাট নেই। আগেরটি আবার খুলুন, বা + বোতাম দিয়ে নতুন একটি শুরু করুন।"],
"TsZmgr": ["ডিস্কের ফাইলটি, এবং এজেন্টরা যে id ব্যবহার করে।"],
@@ -2094,7 +2101,6 @@
"Wh0im4": ["[[", ["realCurrentDoc"], "]] সম্পাদনা করা হচ্ছে"],
"WhOsNE": ["কাটা দাগ"],
"Wi-VWy": ["রিপোর্ট পাঠানো যায়নি"],
- "WiGqD8": ["নিচের প্যানেল দেখান"],
"WkTLN7": ["কেবল markdown ফাইল দেখান"],
"WkyP2p": ["স্কিল বিভাগ"],
"WmPbvm": ["আপনার ইনবক্সে পণ্যের হালনাগাদ পান।"],
@@ -2201,7 +2207,6 @@
"YJPN3F": ["খুব ধীর"],
"YKLP_-": ["টেমপ্লেটের নাম বদলানো হয়েছে"],
"YLMBSd": ["যেমন একটি বড় টেবিল পেস্ট করার পর সম্পাদক জমে গিয়েছিল"],
- "YM5oO0": ["নিচের প্যানেল দেখান বা লুকান"],
"YMlS7s": ["ডিফল্ট অ্যাপে খুলুন"],
"YPFBfr": [["detail"], " - ", ["kind"], " \"", ["createdPath"], "\" এখনও ডিস্কে আছে"],
"YRavYS": [
@@ -2737,6 +2742,7 @@
["descriptorLabel"],
"> রেন্ডার করা যায়নি (সম্ভবত একটি ভুল প্রপ)। কী ভুল হয়েছে দেখতে সোর্স কপি করুন, নয়তো ব্লকটি মুছে দিন।"
],
+ "g5V4_P": ["এজেন্ট প্যানেল সংকুচিত করুন"],
"g5w1sF": [
["display"],
"-এর মধ্যে মেলানোর জন্য একটি ফোল্ডার বাছুন। ওই ফোল্ডারটি এটির সিমলিংক হয়ে যায়, তাই তার এজেন্ট এখানে রাখা সবকিছু পড়ে। এই ফোল্ডারটি সত্যিকারের থেকে যায়। দ্বন্দ্বপূর্ণ স্কিল মার্জ বাতিল করে দেয়।"
@@ -2979,6 +2985,7 @@
"jZ_E5M": ["আনা ব্যর্থ — বিস্তারিত জানতে সার্ভার লগ দেখুন।"],
"j_Z6g7": ["ভাগ করা ডিফল্ট"],
"jbSG8V": ["Files দেখান (", ["sidebarShortcutLabel"], ")"],
+ "jcEoUi": ["ডান প্যানেলে সরান"],
"jdGUeI": ["টেমপ্লেট তৈরি করা যায়নি: ", ["error"]],
"jeCFV7": ["ডান পাশের নতুন প্যানে সরান"],
"jeJexw": [["0"], "-এর ইনস্টল শেষ করা যায়নি — নিচে দেখুন।"],
@@ -3326,7 +3333,6 @@
"o0bHtA": ["OpenKnowledge-এর তৈরি"],
"o2yoFu": ["Finder-এ দেখান, কোনো ওয়ার্কস্পেস নেই"],
"o49mDZ": ["কালানুক্রমের ইতিহাস লোড হচ্ছে"],
- "o5jB-D": ["প্যানেল গুটিয়ে নিন"],
"o9CrsQ": ["research-note"],
"o9fPtM": ["উৎস থেকে স্বয়ংক্রিয় হালনাগাদ"],
"oAFVKX": ["প্রকল্পের সিঙ্ক ডিফল্ট হালনাগাদ করতে ব্যর্থ — ", ["detail"]],
@@ -3389,7 +3395,6 @@
"pAgkuZ": ["\"", ["docName"], "\" একটি নতুন স্থানীয় সহযোগিতা ক্যাশসহ আবার খোলা হচ্ছে।"],
"pBROkv": ["সদস্য হওয়ার জন্য ধন্যবাদ। পণ্যের হালনাগাদের জন্য আপনার ইনবক্সে চোখ রাখুন।"],
"pCralD": ["বাঁ পাশের নতুন প্যানে সরান"],
- "pDD2Hm": ["নিচের প্যানেল লুকান"],
"pEQFsW": ["মিলে যাওয়া কোনো প্রকল্প নেই।"],
"pFPzHA": ["ইমোজি নির্বাচক"],
"pFRz_E": ["এই মন্তব্যগুলো এই বার্তার বাইরে রাখুন"],
@@ -3927,6 +3932,7 @@
"xeXS4P": ["নয়তো একটি স্টার্টার প্যাক ব্যবহার করুন"],
"xeiujy": ["লেখা"],
"xhlFsx": ["উত্তরাধিকারসূত্রে পাওয়া — এটি বদলাতে এখানে একটি মান নির্ধারণ করুন।"],
+ "xi9KGG": ["Terminal দেখান"],
"xiv-dW": ["এখনও কোনো ফাইল নেই।"],
"xlQpTE": ["প্রত্যাখ্যানের আরও বিকল্প"],
"xloBjn": ["আপেক্ষিক পথ"],
diff --git a/packages/app/src/locales/bn/messages.po b/packages/app/src/locales/bn/messages.po
index 09ed1df8e..78745d6f3 100644
--- a/packages/app/src/locales/bn/messages.po
+++ b/packages/app/src/locales/bn/messages.po
@@ -1361,6 +1361,10 @@ msgstr "এজেন্ট কনফিগারেশন ফাইল"
msgid "Agent mode"
msgstr "এজেন্ট মোড"
+#: src/components/EditorArea.tsx
+msgid "Agent panel closed to keep Terminal readable."
+msgstr "Terminal পাঠযোগ্য রাখতে এজেন্ট প্যানেল বন্ধ করা হয়েছে।"
+
#: src/components/acp/ThreadView.tsx
msgid "Agent settings"
msgstr "এজেন্ট সেটিং"
@@ -2492,6 +2496,10 @@ msgstr "গুটিয়ে নিন"
msgid "Collapse {keyName}"
msgstr "{keyName} গুটিয়ে নিন"
+#: src/components/TerminalTabStrip.tsx
+msgid "Collapse agent panel"
+msgstr "এজেন্ট প্যানেল সংকুচিত করুন"
+
#: src/components/AppMenubar.tsx
#: src/components/command-palette-commands.ts
#: src/components/FileSidebar.tsx
@@ -2516,8 +2524,8 @@ msgid "Collapse graph"
msgstr "গ্রাফ গুটিয়ে নিন"
#: src/components/TerminalTabStrip.tsx
-msgid "Collapse panel"
-msgstr "প্যানেল গুটিয়ে নিন"
+msgid "Collapse Terminal"
+msgstr "Terminal সংকুচিত করুন"
#: src/editor/slash-command/component-items.tsx
msgid "Collapsible content block (Notion-style toggle)."
@@ -5734,10 +5742,6 @@ msgstr "উন্নত লুকান"
msgid "Hide Agents"
msgstr "Agents লুকান"
-#: src/components/command-palette-commands.ts
-msgid "Hide Bottom Dock"
-msgstr "নিচের প্যানেল লুকান"
-
#: src/components/acp/ThreadView.tsx
msgid "Hide details"
msgstr "বিবরণ লুকান"
@@ -5812,6 +5816,10 @@ msgstr "নির্বাচনের প্রাকদর্শন লুক
msgid "Hide sidebar"
msgstr "সাইডবার লুকান"
+#: src/components/command-palette-commands.ts
+msgid "Hide Terminal"
+msgstr "Terminal লুকান"
+
#: src/comments/comment-chips.tsx
msgid "Hide these comments"
msgstr "এই মন্তব্যগুলো লুকান"
@@ -7015,6 +7023,16 @@ msgstr "এই ফাইলটি স্কিলের ভেতরে সর
msgid "Move succeeded but the sidebar may be out of date — refresh to resync"
msgstr "সরানো সফল হয়েছে কিন্তু সাইডবার পুরোনো হতে পারে — আবার সিঙ্ক করতে সতেজ করুন"
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to bottom"
+msgstr "Terminal নিচে সরান"
+
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to right"
+msgstr "Terminal ডান দিকে সরান"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move the current block up or down one position."
msgstr "বর্তমান ব্লকটি এক ধাপ উপরে বা নিচে সরান।"
@@ -7050,6 +7068,10 @@ msgstr "বাঁ পাশের নতুন প্যানে সরান"
msgid "Move to new pane right"
msgstr "ডান পাশের নতুন প্যানে সরান"
+#: src/components/TerminalTabStrip.tsx
+msgid "Move to right panel"
+msgstr "ডান প্যানেলে সরান"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move to the next CodeMirror lint diagnostic."
msgstr "পরবর্তী CodeMirror lint নির্ণয়ে যান।"
@@ -10590,10 +10612,6 @@ msgstr "Agents দেখান"
msgid "Show All"
msgstr "সব দেখান"
-#: src/components/command-palette-commands.ts
-msgid "Show Bottom Dock"
-msgstr "নিচের প্যানেল দেখান"
-
#: src/components/acp/ThreadView.tsx
msgid "Show details"
msgstr "বিবরণ দেখান"
@@ -10661,10 +10679,6 @@ msgstr "কেবল markdown ফাইল দেখান"
msgid "Show or hide agents"
msgstr "এজেন্ট দেখান বা লুকান"
-#: src/lib/keyboard-shortcuts.ts
-msgid "Show or hide bottom dock"
-msgstr "নিচের প্যানেল দেখান বা লুকান"
-
#: src/lib/keyboard-shortcuts.ts
msgid "Show or hide document panel"
msgstr "নথি প্যানেল দেখান বা লুকান"
@@ -10673,6 +10687,10 @@ msgstr "নথি প্যানেল দেখান বা লুকান"
msgid "Show or hide Files"
msgstr "Files দেখান বা লুকান"
+#: src/lib/keyboard-shortcuts.ts
+msgid "Show or hide Terminal"
+msgstr "Terminal দেখান বা লুকান"
+
#: src/components/AgentDiffPane.tsx
#: src/components/EditorToolbar.tsx
#: src/components/TimelineDiffPane.tsx
@@ -10713,6 +10731,10 @@ msgstr "সাইডবার দেখান"
msgid "Show source"
msgstr "সোর্স দেখান"
+#: src/components/command-palette-commands.ts
+msgid "Show Terminal"
+msgstr "Terminal দেখান"
+
#: src/comments/comment-chips.tsx
msgid "Show these comments"
msgstr "এই মন্তব্যগুলো দেখান"
@@ -11536,6 +11558,10 @@ msgstr "টার্মিনাল {0}"
msgid "Terminal access isn't enabled for this project."
msgstr "এই প্রকল্পের জন্য টার্মিনালে প্রবেশ চালু নেই।"
+#: src/components/EditorArea.tsx
+msgid "Terminal closed to make room for the agent panel."
+msgstr "এজেন্ট প্যানেলের জন্য জায়গা করতে Terminal বন্ধ করা হয়েছে।"
+
#: src/components/TerminalGate.tsx
msgid "Terminal disabled"
msgstr "টার্মিনাল নিষ্ক্রিয়"
@@ -12281,8 +12307,8 @@ msgid "Toggle strikethrough formatting."
msgstr "কাটা দাগের বিন্যাস চালু বা বন্ধ করুন।"
#: src/lib/keyboard-shortcuts.ts
-msgid "Toggle the bottom dock, where the terminal lives."
-msgstr "নিচের প্যানেল দেখান বা লুকান, যেখানে টার্মিনাল থাকে।"
+msgid "Toggle Terminal in its current dock."
+msgstr "Terminal-কে তার বর্তমান ডকে দেখান বা লুকান।"
#: src/lib/keyboard-shortcuts.ts
msgid "Toggle the left file sidebar."
diff --git a/packages/app/src/locales/en/messages.json b/packages/app/src/locales/en/messages.json
index ac61d77a4..bb0379756 100644
--- a/packages/app/src/locales/en/messages.json
+++ b/packages/app/src/locales/en/messages.json
@@ -12,6 +12,7 @@
"-5jISU": [["0", "plural", { "one": ["#", " template"], "other": ["#", " templates"] }]],
"-7s4fw": ["Search agents"],
"-8PP0T": ["Match case"],
+ "-Al4WQ": ["Show or hide Terminal"],
"-FeyRg": ["Keep original file"],
"-K0AvT": ["Disconnect"],
"-LHLx7": ["edited template"],
@@ -189,6 +190,7 @@
"2RnFoM": ["Couldn't resume this chat: ", ["0"]],
"2Snes1": ["This sends the link's address off your machine"],
"2UgoBZ": ["gone"],
+ "2VSPan": ["Terminal closed to make room for the agent panel."],
"2XQ8Ww": ["Open preview when agent edits"],
"2YOwme": ["Restarted — now running v", ["appRuntime"], "."],
"2YZwPB": ["Forward-links response did not match expected shape."],
@@ -688,6 +690,7 @@
"9uI_rE": ["Undo"],
"9uRLEH": ["Couldn't open \"", ["name"], "\" — it isn't in the project's skills yet."],
"9wQrUU": ["Refactoring"],
+ "9xCnv8": ["Hide Terminal"],
"9zb2WA": ["Connecting"],
"A1taO8": ["Search"],
"A50vr3": ["Use lowercase letters, digits, and <0>-</0> only."],
@@ -1339,6 +1342,7 @@
"KDuPiY": ["Uploading ", ["fileName"]],
"KDw4GX": ["Try again"],
"KFd4xz": ["absent"],
+ "KGF42E": ["Agent panel closed to keep Terminal readable."],
"KGJb9_": ["Conflicts"],
"KH5bQi": [
"Using the <0>OK_EMBEDDINGS_API_KEY</0> environment variable (managed outside OpenKnowledge)."
@@ -1516,6 +1520,7 @@
"A symlink is a pointer to the source folder rather than a folder of its own. Every location reads the exact same bytes, so nothing can drift, and a location stops working if the source is deleted."
],
"MTs6g3": ["Couldn't reconnect after server restart"],
+ "MU_NVW": ["Collapse Terminal"],
"MUrVEo": ["No recent projects."],
"MV-Dkb": ["Found ", ["countDisplay"], " markdown files"],
"MVxpbf": ["Find and replace"],
@@ -1581,7 +1586,6 @@
"NRSLBe": [["diffMin"], "m ago"],
"NSnIUP": ["Two-page (even)"],
"NUr4kz": ["A reusable starting point for new documents in this folder."],
- "NUw7lo": ["Toggle the bottom dock, where the terminal lives."],
"NYUhy5": ["Subfolder name"],
"NYn1cR": ["Loading editor"],
"NYu2Pt": ["New project…"],
@@ -1743,6 +1747,7 @@
],
"PrJYSN": ["This folder isn't on GitHub yet. The link won't work until it's pushed."],
"PrVaZo": ["Uninstall OpenKnowledge?"],
+ "PrWQiT": ["Move Terminal to right"],
"PrhzDE": ["Pan up"],
"Q-DKvr": ["Install from ", ["source"]],
"Q1mtyd": ["Hide sidebar"],
@@ -1882,6 +1887,7 @@
"S9Vnum": ["Remove ", ["patternText"]],
"S9t1PI": ["Fixing ", ["0"], "/", ["1"]],
"SCoBBH": ["Tag suggestions"],
+ "SCveu1": ["Toggle Terminal in its current dock."],
"SCzAbA": [["phase"], " — ", ["pct"], "%"],
"SF9qpO": ["Share your email for followups"],
"SFEWV6": ["Couldn't load the OpenKnowledge skills. Try again."],
@@ -1957,6 +1963,7 @@
"TiPvBP": ["Choose color"],
"Tjc1pH": ["Section <0>(optional heading anchor)</0>"],
"Tn5sik": ["Tells agents when to reach for this skill. You can edit it later."],
+ "Tofsyo": ["Move Terminal to bottom"],
"Tq3pcs": ["Keep mine"],
"Tq9kNX": ["No open chats. Reopen a past one, or start a new one with the + button."],
"TsZmgr": ["The file on disk, and the id agents use."],
@@ -2157,7 +2164,6 @@
"Wh0im4": ["editing [[", ["realCurrentDoc"], "]]"],
"WhOsNE": ["Strikethrough"],
"Wi-VWy": ["Couldn't send the report"],
- "WiGqD8": ["Show Bottom Dock"],
"WkTLN7": ["Show only markdown files"],
"WkyP2p": ["Skills section"],
"WmPbvm": ["Get product updates in your inbox."],
@@ -2264,7 +2270,6 @@
"YJPN3F": ["Too slow"],
"YKLP_-": ["Template renamed"],
"YLMBSd": ["e.g. The editor froze after I pasted a large table"],
- "YM5oO0": ["Show or hide bottom dock"],
"YMlS7s": ["Open in default app"],
"YPFBfr": [["detail"], " - ", ["kind"], " \"", ["createdPath"], "\" still exists on disk"],
"YRavYS": [
@@ -2829,6 +2834,7 @@
["descriptorLabel"],
"> failed to render (likely a bad prop). Copy the source to see what went wrong, or delete the block."
],
+ "g5V4_P": ["Collapse agent panel"],
"g5w1sF": [
"Pick a folder to merge INTO ",
["display"],
@@ -3084,6 +3090,7 @@
"jZ_E5M": ["Fetch failed — check the server logs for details."],
"j_Z6g7": ["Shared default"],
"jbSG8V": ["Show Files (", ["sidebarShortcutLabel"], ")"],
+ "jcEoUi": ["Move to right panel"],
"jdGUeI": ["Couldn't create template: ", ["error"]],
"jeCFV7": ["Move to new pane right"],
"jeJexw": ["Couldn't finish installing ", ["0"], " — see below."],
@@ -3444,7 +3451,6 @@
"o0bHtA": ["By OpenKnowledge"],
"o2yoFu": ["Reveal in Finder, No workspace"],
"o49mDZ": ["Loading timeline history"],
- "o5jB-D": ["Collapse panel"],
"o9CrsQ": ["research-note"],
"o9fPtM": ["Auto-update from source"],
"oAFVKX": ["Failed to update the project sync default — ", ["detail"]],
@@ -3509,7 +3515,6 @@
"pAgkuZ": ["Reopening \"", ["docName"], "\" with a fresh local collaboration cache."],
"pBROkv": ["Thanks for subscribing. Watch your inbox for product updates."],
"pCralD": ["Move to new pane left"],
- "pDD2Hm": ["Hide Bottom Dock"],
"pEQFsW": ["No matching projects."],
"pFPzHA": ["Emoji picker"],
"pFRz_E": ["Leave these comments out of this message"],
@@ -4084,6 +4089,7 @@
"xeXS4P": ["Or use a starter pack"],
"xeiujy": ["Text"],
"xhlFsx": ["Inherited — set a value here to replace it."],
+ "xi9KGG": ["Show Terminal"],
"xiv-dW": ["No files yet."],
"xlQpTE": ["More refusal options"],
"xloBjn": ["Relative Path"],
diff --git a/packages/app/src/locales/en/messages.po b/packages/app/src/locales/en/messages.po
index b2d9091cd..44f29733d 100644
--- a/packages/app/src/locales/en/messages.po
+++ b/packages/app/src/locales/en/messages.po
@@ -1365,6 +1365,10 @@ msgstr "Agent configuration file"
msgid "Agent mode"
msgstr "Agent mode"
+#: src/components/EditorArea.tsx
+msgid "Agent panel closed to keep Terminal readable."
+msgstr "Agent panel closed to keep Terminal readable."
+
#: src/components/acp/ThreadView.tsx
msgid "Agent settings"
msgstr "Agent settings"
@@ -2496,6 +2500,10 @@ msgstr "Collapse"
msgid "Collapse {keyName}"
msgstr "Collapse {keyName}"
+#: src/components/TerminalTabStrip.tsx
+msgid "Collapse agent panel"
+msgstr "Collapse agent panel"
+
#: src/components/AppMenubar.tsx
#: src/components/command-palette-commands.ts
#: src/components/FileSidebar.tsx
@@ -2520,8 +2528,8 @@ msgid "Collapse graph"
msgstr "Collapse graph"
#: src/components/TerminalTabStrip.tsx
-msgid "Collapse panel"
-msgstr "Collapse panel"
+msgid "Collapse Terminal"
+msgstr "Collapse Terminal"
#: src/editor/slash-command/component-items.tsx
msgid "Collapsible content block (Notion-style toggle)."
@@ -5738,10 +5746,6 @@ msgstr "Hide advanced"
msgid "Hide Agents"
msgstr "Hide Agents"
-#: src/components/command-palette-commands.ts
-msgid "Hide Bottom Dock"
-msgstr "Hide Bottom Dock"
-
#: src/components/acp/ThreadView.tsx
msgid "Hide details"
msgstr "Hide details"
@@ -5816,6 +5820,10 @@ msgstr "Hide selection preview"
msgid "Hide sidebar"
msgstr "Hide sidebar"
+#: src/components/command-palette-commands.ts
+msgid "Hide Terminal"
+msgstr "Hide Terminal"
+
#: src/comments/comment-chips.tsx
msgid "Hide these comments"
msgstr "Hide these comments"
@@ -7019,6 +7027,16 @@ msgstr "Move or rename this file inside the skill — the path stays under refer
msgid "Move succeeded but the sidebar may be out of date — refresh to resync"
msgstr "Move succeeded but the sidebar may be out of date — refresh to resync"
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to bottom"
+msgstr "Move Terminal to bottom"
+
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to right"
+msgstr "Move Terminal to right"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move the current block up or down one position."
msgstr "Move the current block up or down one position."
@@ -7054,6 +7072,10 @@ msgstr "Move to new pane left"
msgid "Move to new pane right"
msgstr "Move to new pane right"
+#: src/components/TerminalTabStrip.tsx
+msgid "Move to right panel"
+msgstr "Move to right panel"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move to the next CodeMirror lint diagnostic."
msgstr "Move to the next CodeMirror lint diagnostic."
@@ -10594,10 +10616,6 @@ msgstr "Show Agents"
msgid "Show All"
msgstr "Show All"
-#: src/components/command-palette-commands.ts
-msgid "Show Bottom Dock"
-msgstr "Show Bottom Dock"
-
#: src/components/acp/ThreadView.tsx
msgid "Show details"
msgstr "Show details"
@@ -10665,10 +10683,6 @@ msgstr "Show only markdown files"
msgid "Show or hide agents"
msgstr "Show or hide agents"
-#: src/lib/keyboard-shortcuts.ts
-msgid "Show or hide bottom dock"
-msgstr "Show or hide bottom dock"
-
#: src/lib/keyboard-shortcuts.ts
msgid "Show or hide document panel"
msgstr "Show or hide document panel"
@@ -10677,6 +10691,10 @@ msgstr "Show or hide document panel"
msgid "Show or hide Files"
msgstr "Show or hide Files"
+#: src/lib/keyboard-shortcuts.ts
+msgid "Show or hide Terminal"
+msgstr "Show or hide Terminal"
+
#: src/components/AgentDiffPane.tsx
#: src/components/EditorToolbar.tsx
#: src/components/TimelineDiffPane.tsx
@@ -10717,6 +10735,10 @@ msgstr "Show sidebar"
msgid "Show source"
msgstr "Show source"
+#: src/components/command-palette-commands.ts
+msgid "Show Terminal"
+msgstr "Show Terminal"
+
#: src/comments/comment-chips.tsx
msgid "Show these comments"
msgstr "Show these comments"
@@ -11540,6 +11562,10 @@ msgstr "Terminal {0}"
msgid "Terminal access isn't enabled for this project."
msgstr "Terminal access isn't enabled for this project."
+#: src/components/EditorArea.tsx
+msgid "Terminal closed to make room for the agent panel."
+msgstr "Terminal closed to make room for the agent panel."
+
#: src/components/TerminalGate.tsx
msgid "Terminal disabled"
msgstr "Terminal disabled"
@@ -12285,8 +12311,8 @@ msgid "Toggle strikethrough formatting."
msgstr "Toggle strikethrough formatting."
#: src/lib/keyboard-shortcuts.ts
-msgid "Toggle the bottom dock, where the terminal lives."
-msgstr "Toggle the bottom dock, where the terminal lives."
+msgid "Toggle Terminal in its current dock."
+msgstr "Toggle Terminal in its current dock."
#: src/lib/keyboard-shortcuts.ts
msgid "Toggle the left file sidebar."
diff --git a/packages/app/src/locales/es/messages.json b/packages/app/src/locales/es/messages.json
index a3bf50411..92f76915f 100644
--- a/packages/app/src/locales/es/messages.json
+++ b/packages/app/src/locales/es/messages.json
@@ -22,6 +22,7 @@
],
"-7s4fw": ["Buscar agentes"],
"-8PP0T": ["Distinguir mayúsculas"],
+ "-Al4WQ": ["Mostrar u ocultar Terminal"],
"-FeyRg": ["Conservar el archivo original"],
"-K0AvT": ["Desconectar"],
"-LHLx7": ["plantilla editada"],
@@ -213,6 +214,7 @@
"2RnFoM": ["No se pudo reanudar este chat: ", ["0"]],
"2Snes1": ["Esto envía la dirección del enlace fuera de tu equipo"],
"2UgoBZ": ["desaparecida"],
+ "2VSPan": ["Se cerró Terminal para dejar espacio al panel de agentes."],
"2XQ8Ww": ["Abrir la vista previa cuando el agente edite"],
"2YOwme": ["Reiniciado: ahora se ejecuta la v", ["appRuntime"], "."],
"2YZwPB": ["La respuesta de enlaces salientes no tenía la forma esperada."],
@@ -801,6 +803,7 @@
"\": todavía no está entre las habilidades del proyecto."
],
"9wQrUU": ["Refactorización"],
+ "9xCnv8": ["Ocultar Terminal"],
"9zb2WA": ["Conectando"],
"A1taO8": ["Buscar"],
"A50vr3": ["Usa solo letras minúsculas, dígitos y <0>-</0>."],
@@ -1562,6 +1565,7 @@
"KDuPiY": ["Subiendo ", ["fileName"]],
"KDw4GX": ["Inténtalo de nuevo"],
"KFd4xz": ["ausente"],
+ "KGF42E": ["Se cerró el panel de agentes para mantener Terminal legible."],
"KGJb9_": ["Conflictos"],
"KH5bQi": [
"Se está usando la variable de entorno <0>OK_EMBEDDINGS_API_KEY</0> (gestionada fuera de OpenKnowledge)."
@@ -1764,6 +1768,7 @@
"Un enlace simbólico apunta a la carpeta de origen en lugar de ser una carpeta propia. Todas las ubicaciones leen exactamente los mismos bytes, así que nada se desvía, y una ubicación deja de funcionar si se elimina el origen."
],
"MTs6g3": ["No se pudo reconectar tras el reinicio del servidor"],
+ "MU_NVW": ["Contraer Terminal"],
"MUrVEo": ["No hay proyectos recientes."],
"MV-Dkb": ["Se encontraron ", ["countDisplay"], " archivos markdown"],
"MVxpbf": ["Buscar y reemplazar"],
@@ -1831,7 +1836,6 @@
"NRSLBe": ["hace ", ["diffMin"], " min"],
"NSnIUP": ["Dos páginas (pares)"],
"NUr4kz": ["Un punto de partida reutilizable para los documentos nuevos de esta carpeta."],
- "NUw7lo": ["Muestra u oculta el panel inferior, donde vive la terminal."],
"NYUhy5": ["Nombre de la subcarpeta"],
"NYn1cR": ["Cargando el editor"],
"NYu2Pt": ["Proyecto nuevo…"],
@@ -2001,6 +2005,7 @@
"Esta carpeta todavía no está en GitHub. El enlace no funcionará hasta que se suba."
],
"PrVaZo": ["¿Desinstalar OpenKnowledge?"],
+ "PrWQiT": ["Mover Terminal a la derecha"],
"PrhzDE": ["Desplazar hacia arriba"],
"Q-DKvr": ["Instalar desde ", ["source"]],
"Q1mtyd": ["Ocultar la barra lateral"],
@@ -2151,6 +2156,7 @@
"S9Vnum": ["Quitar ", ["patternText"]],
"S9t1PI": ["Arreglando ", ["0"], "/", ["1"]],
"SCoBBH": ["Sugerencias de etiquetas"],
+ "SCveu1": ["Muestra u oculta Terminal en su panel actual."],
"SCzAbA": [["phase"], " — ", ["pct"], "%"],
"SF9qpO": ["Comparte tu correo para que podamos hacer seguimiento"],
"SFEWV6": ["No se pudieron cargar las habilidades de OpenKnowledge. Inténtalo de nuevo."],
@@ -2241,6 +2247,7 @@
"Tn5sik": [
"Indica a los agentes cuándo recurrir a esta habilidad. Puedes editarlo más adelante."
],
+ "Tofsyo": ["Mover Terminal a la parte inferior"],
"Tq3pcs": ["Conservar el mío"],
"Tq9kNX": ["No hay chats abiertos. Reabre uno anterior o inicia uno nuevo con el botón +."],
"TsZmgr": ["El archivo en el disco, y el id que usan los agentes."],
@@ -2477,7 +2484,6 @@
"Wh0im4": ["editando [[", ["realCurrentDoc"], "]]"],
"WhOsNE": ["Tachado"],
"Wi-VWy": ["No se pudo enviar el informe"],
- "WiGqD8": ["Mostrar el panel inferior"],
"WkTLN7": ["Mostrar solo archivos markdown"],
"WkyP2p": ["Sección Habilidades"],
"WmPbvm": ["Recibe novedades del producto en tu correo."],
@@ -2594,7 +2600,6 @@
"YJPN3F": ["Demasiado lento"],
"YKLP_-": ["Plantilla renombrada"],
"YLMBSd": ["p. ej. El editor se quedó bloqueado al pegar una tabla grande"],
- "YM5oO0": ["Mostrar u ocultar el panel inferior"],
"YMlS7s": ["Abrir en la aplicación predeterminada"],
"YPFBfr": [
["detail"],
@@ -3281,6 +3286,7 @@
["descriptorLabel"],
"> (probablemente por una propiedad incorrecta). Copia el código para ver qué falló o elimina el bloque."
],
+ "g5V4_P": ["Contraer el panel de agentes"],
"g5w1sF": [
"Elige una carpeta para fusionarla DENTRO de ",
["display"],
@@ -3562,6 +3568,7 @@
"jZ_E5M": ["Falló el fetch: consulta los registros del servidor para ver los detalles."],
"j_Z6g7": ["Valor compartido por defecto"],
"jbSG8V": ["Mostrar Archivos (", ["sidebarShortcutLabel"], ")"],
+ "jcEoUi": ["Mover al panel derecho"],
"jdGUeI": ["No se pudo crear la plantilla: ", ["error"]],
"jeCFV7": ["Mover a un panel nuevo a la derecha"],
"jeJexw": ["No se pudo terminar de instalar ", ["0"], "; mira abajo."],
@@ -3957,7 +3964,6 @@
"o0bHtA": ["Por OpenKnowledge"],
"o2yoFu": ["Mostrar en el Finder, sin espacio de trabajo"],
"o49mDZ": ["Cargando el historial de la cronología"],
- "o5jB-D": ["Contraer el panel"],
"o9CrsQ": ["nota-de-investigacion"],
"o9fPtM": ["Actualizar automáticamente desde el origen"],
"oAFVKX": ["No se pudo actualizar la sincronización por defecto del proyecto — ", ["detail"]],
@@ -4026,7 +4032,6 @@
"Gracias por suscribirte. Estate atento a tu correo para recibir novedades del producto."
],
"pCralD": ["Mover a un panel nuevo a la izquierda"],
- "pDD2Hm": ["Ocultar el panel inferior"],
"pEQFsW": ["Ningún proyecto coincide."],
"pFPzHA": ["Selector de emojis"],
"pFRz_E": ["Dejar estos comentarios fuera de este mensaje"],
@@ -4683,6 +4688,7 @@
"xeXS4P": ["O usa un paquete inicial"],
"xeiujy": ["Texto"],
"xhlFsx": ["Heredado: define aquí un valor para reemplazarlo."],
+ "xi9KGG": ["Mostrar Terminal"],
"xiv-dW": ["Todavía no hay archivos."],
"xlQpTE": ["Más opciones de rechazo"],
"xloBjn": ["Ruta relativa"],
diff --git a/packages/app/src/locales/es/messages.po b/packages/app/src/locales/es/messages.po
index c6572db40..f7db8141f 100644
--- a/packages/app/src/locales/es/messages.po
+++ b/packages/app/src/locales/es/messages.po
@@ -1365,6 +1365,10 @@ msgstr "Archivo de configuración del agente"
msgid "Agent mode"
msgstr "Modo agente"
+#: src/components/EditorArea.tsx
+msgid "Agent panel closed to keep Terminal readable."
+msgstr "Se cerró el panel de agentes para mantener Terminal legible."
+
#: src/components/acp/ThreadView.tsx
msgid "Agent settings"
msgstr "Ajustes del agente"
@@ -2496,6 +2500,10 @@ msgstr "Contraer"
msgid "Collapse {keyName}"
msgstr "Contraer {keyName}"
+#: src/components/TerminalTabStrip.tsx
+msgid "Collapse agent panel"
+msgstr "Contraer el panel de agentes"
+
#: src/components/AppMenubar.tsx
#: src/components/command-palette-commands.ts
#: src/components/FileSidebar.tsx
@@ -2520,8 +2528,8 @@ msgid "Collapse graph"
msgstr "Contraer el grafo"
#: src/components/TerminalTabStrip.tsx
-msgid "Collapse panel"
-msgstr "Contraer el panel"
+msgid "Collapse Terminal"
+msgstr "Contraer Terminal"
#: src/editor/slash-command/component-items.tsx
msgid "Collapsible content block (Notion-style toggle)."
@@ -5738,10 +5746,6 @@ msgstr "Ocultar opciones avanzadas"
msgid "Hide Agents"
msgstr "Ocultar Agentes"
-#: src/components/command-palette-commands.ts
-msgid "Hide Bottom Dock"
-msgstr "Ocultar el panel inferior"
-
#: src/components/acp/ThreadView.tsx
msgid "Hide details"
msgstr "Ocultar detalles"
@@ -5816,6 +5820,10 @@ msgstr "Ocultar la vista previa de la selección"
msgid "Hide sidebar"
msgstr "Ocultar la barra lateral"
+#: src/components/command-palette-commands.ts
+msgid "Hide Terminal"
+msgstr "Ocultar Terminal"
+
#: src/comments/comment-chips.tsx
msgid "Hide these comments"
msgstr "Ocultar estos comentarios"
@@ -7019,6 +7027,16 @@ msgstr "Mueve o renombra este archivo dentro de la habilidad: la ruta se mantien
msgid "Move succeeded but the sidebar may be out of date — refresh to resync"
msgstr "Se movió correctamente, pero puede que la barra lateral esté desactualizada; actualízala para resincronizar"
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to bottom"
+msgstr "Mover Terminal a la parte inferior"
+
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to right"
+msgstr "Mover Terminal a la derecha"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move the current block up or down one position."
msgstr "Sube o baja una posición el bloque actual."
@@ -7054,6 +7072,10 @@ msgstr "Mover a un panel nuevo a la izquierda"
msgid "Move to new pane right"
msgstr "Mover a un panel nuevo a la derecha"
+#: src/components/TerminalTabStrip.tsx
+msgid "Move to right panel"
+msgstr "Mover al panel derecho"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move to the next CodeMirror lint diagnostic."
msgstr "Ir al siguiente diagnóstico de análisis de CodeMirror."
@@ -10594,10 +10616,6 @@ msgstr "Mostrar Agentes"
msgid "Show All"
msgstr "Mostrar todo"
-#: src/components/command-palette-commands.ts
-msgid "Show Bottom Dock"
-msgstr "Mostrar el panel inferior"
-
#: src/components/acp/ThreadView.tsx
msgid "Show details"
msgstr "Mostrar detalles"
@@ -10665,10 +10683,6 @@ msgstr "Mostrar solo archivos markdown"
msgid "Show or hide agents"
msgstr "Mostrar u ocultar los agentes"
-#: src/lib/keyboard-shortcuts.ts
-msgid "Show or hide bottom dock"
-msgstr "Mostrar u ocultar el panel inferior"
-
#: src/lib/keyboard-shortcuts.ts
msgid "Show or hide document panel"
msgstr "Mostrar u ocultar el panel del documento"
@@ -10677,6 +10691,10 @@ msgstr "Mostrar u ocultar el panel del documento"
msgid "Show or hide Files"
msgstr "Mostrar u ocultar Archivos"
+#: src/lib/keyboard-shortcuts.ts
+msgid "Show or hide Terminal"
+msgstr "Mostrar u ocultar Terminal"
+
#: src/components/AgentDiffPane.tsx
#: src/components/EditorToolbar.tsx
#: src/components/TimelineDiffPane.tsx
@@ -10717,6 +10735,10 @@ msgstr "Mostrar la barra lateral"
msgid "Show source"
msgstr "Mostrar el código"
+#: src/components/command-palette-commands.ts
+msgid "Show Terminal"
+msgstr "Mostrar Terminal"
+
#: src/comments/comment-chips.tsx
msgid "Show these comments"
msgstr "Mostrar estos comentarios"
@@ -11540,6 +11562,10 @@ msgstr "Terminal {0}"
msgid "Terminal access isn't enabled for this project."
msgstr "El acceso a la terminal no está activado en este proyecto."
+#: src/components/EditorArea.tsx
+msgid "Terminal closed to make room for the agent panel."
+msgstr "Se cerró Terminal para dejar espacio al panel de agentes."
+
#: src/components/TerminalGate.tsx
msgid "Terminal disabled"
msgstr "Terminal desactivada"
@@ -12285,8 +12311,8 @@ msgid "Toggle strikethrough formatting."
msgstr "Activa o desactiva el tachado."
#: src/lib/keyboard-shortcuts.ts
-msgid "Toggle the bottom dock, where the terminal lives."
-msgstr "Muestra u oculta el panel inferior, donde vive la terminal."
+msgid "Toggle Terminal in its current dock."
+msgstr "Muestra u oculta Terminal en su panel actual."
#: src/lib/keyboard-shortcuts.ts
msgid "Toggle the left file sidebar."
diff --git a/packages/app/src/locales/fr/messages.json b/packages/app/src/locales/fr/messages.json
index 5036be3c9..bcdf556c7 100644
--- a/packages/app/src/locales/fr/messages.json
+++ b/packages/app/src/locales/fr/messages.json
@@ -22,6 +22,7 @@
],
"-7s4fw": ["Rechercher des agents"],
"-8PP0T": ["Respecter la casse"],
+ "-Al4WQ": ["Afficher ou masquer Terminal"],
"-FeyRg": ["Conserver le fichier d'origine"],
"-K0AvT": ["Déconnecter"],
"-LHLx7": ["modèle modifié"],
@@ -223,6 +224,7 @@
"2RnFoM": ["Impossible de reprendre ce chat : ", ["0"]],
"2Snes1": ["Ceci envoie l'adresse du lien hors de votre machine"],
"2UgoBZ": ["disparu"],
+ "2VSPan": ["Terminal a été fermé pour faire de la place au panneau des agents."],
"2XQ8Ww": ["Ouvrir l'aperçu quand l'agent modifie"],
"2YOwme": ["Redémarré — exécute maintenant la v", ["appRuntime"], "."],
"2YZwPB": ["La réponse des liens sortants ne correspond pas à la forme attendue."],
@@ -826,6 +828,7 @@
" » — elle ne fait pas encore partie des compétences du projet."
],
"9wQrUU": ["Refactorisation"],
+ "9xCnv8": ["Masquer Terminal"],
"9zb2WA": ["Connexion"],
"A1taO8": ["Rechercher"],
"A50vr3": ["Utilisez uniquement des lettres minuscules, des chiffres et <0>-</0>."],
@@ -1588,6 +1591,7 @@
"KDuPiY": ["Envoi de ", ["fileName"]],
"KDw4GX": ["Réessayer"],
"KFd4xz": ["absent"],
+ "KGF42E": ["Le panneau des agents a été fermé pour que Terminal reste lisible."],
"KGJb9_": ["Conflits"],
"KH5bQi": [
"Utilise la variable d'environnement <0>OK_EMBEDDINGS_API_KEY</0> (gérée en dehors d'OpenKnowledge)."
@@ -1788,6 +1792,7 @@
"Un lien symbolique pointe vers le dossier source au lieu d'être un dossier à part entière. Chaque emplacement lit exactement les mêmes octets, donc rien ne peut diverger, et un emplacement cesse de fonctionner si la source est supprimée."
],
"MTs6g3": ["Impossible de se reconnecter après le redémarrage du serveur"],
+ "MU_NVW": ["Réduire Terminal"],
"MUrVEo": ["Aucun projet récent."],
"MV-Dkb": [["countDisplay"], " fichiers markdown trouvés"],
"MVxpbf": ["Rechercher et remplacer"],
@@ -1855,7 +1860,6 @@
"NRSLBe": ["il y a ", ["diffMin"], " min"],
"NSnIUP": ["Deux pages (paires)"],
"NUr4kz": ["Un point de départ réutilisable pour les nouveaux documents de ce dossier."],
- "NUw7lo": ["Affiche ou masque le panneau inférieur, où se trouve le terminal."],
"NYUhy5": ["Nom du sous-dossier"],
"NYn1cR": ["Chargement de l'éditeur"],
"NYu2Pt": ["Nouveau projet…"],
@@ -2027,6 +2031,7 @@
"Ce dossier n'est pas encore sur GitHub. Le lien ne fonctionnera pas tant qu'il n'aura pas été poussé."
],
"PrVaZo": ["Désinstaller OpenKnowledge ?"],
+ "PrWQiT": ["Déplacer Terminal à droite"],
"PrhzDE": ["Faire défiler vers le haut"],
"Q-DKvr": ["Installer depuis ", ["source"]],
"Q1mtyd": ["Masquer la barre latérale"],
@@ -2181,6 +2186,7 @@
"S9Vnum": ["Retirer ", ["patternText"]],
"S9t1PI": ["Correction de ", ["0"], "/", ["1"]],
"SCoBBH": ["Suggestions d'étiquettes"],
+ "SCveu1": ["Affichez ou masquez Terminal dans son panneau actuel."],
"SCzAbA": [["phase"], " — ", ["pct"], "%"],
"SF9qpO": ["Partagez votre e-mail pour le suivi"],
"SFEWV6": ["Impossible de charger les compétences OpenKnowledge. Réessayez."],
@@ -2271,6 +2277,7 @@
"Tn5sik": [
"Indique aux agents quand recourir à cette compétence. Vous pourrez le modifier plus tard."
],
+ "Tofsyo": ["Déplacer Terminal en bas"],
"Tq3pcs": ["Garder la mienne"],
"Tq9kNX": [
"Aucun chat ouvert. Rouvrez-en un ancien ou démarrez-en un nouveau avec le bouton +."
@@ -2517,7 +2524,6 @@
"Wh0im4": ["modifie [[", ["realCurrentDoc"], "]]"],
"WhOsNE": ["Barré"],
"Wi-VWy": ["Impossible d'envoyer le rapport"],
- "WiGqD8": ["Afficher le panneau inférieur"],
"WkTLN7": ["N'afficher que les fichiers markdown"],
"WkyP2p": ["Section Compétences"],
"WmPbvm": ["Recevez les nouveautés du produit dans votre boîte mail."],
@@ -2632,7 +2638,6 @@
"YJPN3F": ["Trop lent"],
"YKLP_-": ["Modèle renommé"],
"YLMBSd": ["par ex. L'éditeur s'est figé après avoir collé un grand tableau"],
- "YM5oO0": ["Afficher ou masquer le panneau inférieur"],
"YMlS7s": ["Ouvrir dans l'application par défaut"],
"YPFBfr": [
["detail"],
@@ -3316,6 +3321,7 @@
["descriptorLabel"],
"> a échoué (probablement une propriété incorrecte). Copiez la source pour voir ce qui ne va pas, ou supprimez le bloc."
],
+ "g5V4_P": ["Réduire le panneau des agents"],
"g5w1sF": [
"Choisissez un dossier à fusionner DANS ",
["display"],
@@ -3599,6 +3605,7 @@
"jZ_E5M": ["Échec de la récupération — consultez les journaux du serveur pour les détails."],
"j_Z6g7": ["Valeur par défaut partagée"],
"jbSG8V": ["Afficher les fichiers (", ["sidebarShortcutLabel"], ")"],
+ "jcEoUi": ["Déplacer vers le panneau de droite"],
"jdGUeI": ["Impossible de créer le modèle : ", ["error"]],
"jeCFV7": ["Déplacer vers un nouveau volet à droite"],
"jeJexw": ["Impossible de terminer l'installation de ", ["0"], " — voir ci-dessous."],
@@ -3996,7 +4003,6 @@
"o0bHtA": ["Par OpenKnowledge"],
"o2yoFu": ["Afficher dans le Finder, sans espace de travail"],
"o49mDZ": ["Chargement de l'historique de la chronologie"],
- "o5jB-D": ["Réduire le panneau"],
"o9CrsQ": ["research-note"],
"o9fPtM": ["Mise à jour automatique depuis la source"],
"oAFVKX": ["Échec de la mise à jour de la synchronisation par défaut du projet — ", ["detail"]],
@@ -4065,7 +4071,6 @@
"Merci pour votre abonnement. Surveillez votre boîte mail pour les nouveautés du produit."
],
"pCralD": ["Déplacer vers un nouveau volet à gauche"],
- "pDD2Hm": ["Masquer le panneau inférieur"],
"pEQFsW": ["Aucun projet correspondant."],
"pFPzHA": ["Sélecteur d'émojis"],
"pFRz_E": ["Ne pas inclure ces commentaires dans ce message"],
@@ -4739,6 +4744,7 @@
"xeXS4P": ["Ou utilisez un pack de démarrage"],
"xeiujy": ["Texte"],
"xhlFsx": ["Hérité — définissez une valeur ici pour le remplacer."],
+ "xi9KGG": ["Afficher Terminal"],
"xiv-dW": ["Pas encore de fichiers."],
"xlQpTE": ["Plus d'options de refus"],
"xloBjn": ["Chemin relatif"],
diff --git a/packages/app/src/locales/fr/messages.po b/packages/app/src/locales/fr/messages.po
index 4ec3a9a95..f7cbebb5f 100644
--- a/packages/app/src/locales/fr/messages.po
+++ b/packages/app/src/locales/fr/messages.po
@@ -1365,6 +1365,10 @@ msgstr "Fichier de configuration de l'agent"
msgid "Agent mode"
msgstr "Mode agent"
+#: src/components/EditorArea.tsx
+msgid "Agent panel closed to keep Terminal readable."
+msgstr "Le panneau des agents a été fermé pour que Terminal reste lisible."
+
#: src/components/acp/ThreadView.tsx
msgid "Agent settings"
msgstr "Paramètres de l'agent"
@@ -2496,6 +2500,10 @@ msgstr "Réduire"
msgid "Collapse {keyName}"
msgstr "Réduire {keyName}"
+#: src/components/TerminalTabStrip.tsx
+msgid "Collapse agent panel"
+msgstr "Réduire le panneau des agents"
+
#: src/components/AppMenubar.tsx
#: src/components/command-palette-commands.ts
#: src/components/FileSidebar.tsx
@@ -2520,8 +2528,8 @@ msgid "Collapse graph"
msgstr "Réduire le graphe"
#: src/components/TerminalTabStrip.tsx
-msgid "Collapse panel"
-msgstr "Réduire le panneau"
+msgid "Collapse Terminal"
+msgstr "Réduire Terminal"
#: src/editor/slash-command/component-items.tsx
msgid "Collapsible content block (Notion-style toggle)."
@@ -5738,10 +5746,6 @@ msgstr "Masquer les options avancées"
msgid "Hide Agents"
msgstr "Masquer les agents"
-#: src/components/command-palette-commands.ts
-msgid "Hide Bottom Dock"
-msgstr "Masquer le panneau inférieur"
-
#: src/components/acp/ThreadView.tsx
msgid "Hide details"
msgstr "Masquer les détails"
@@ -5816,6 +5820,10 @@ msgstr "Masquer l'aperçu de la sélection"
msgid "Hide sidebar"
msgstr "Masquer la barre latérale"
+#: src/components/command-palette-commands.ts
+msgid "Hide Terminal"
+msgstr "Masquer Terminal"
+
#: src/comments/comment-chips.tsx
msgid "Hide these comments"
msgstr "Masquer ces commentaires"
@@ -7019,6 +7027,16 @@ msgstr "Déplacez ou renommez ce fichier à l'intérieur de la compétence — l
msgid "Move succeeded but the sidebar may be out of date — refresh to resync"
msgstr "Déplacement réussi, mais la barre latérale n'est peut-être pas à jour — actualisez pour resynchroniser"
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to bottom"
+msgstr "Déplacer Terminal en bas"
+
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to right"
+msgstr "Déplacer Terminal à droite"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move the current block up or down one position."
msgstr "Déplace le bloc courant d'une position vers le haut ou vers le bas."
@@ -7054,6 +7072,10 @@ msgstr "Déplacer vers un nouveau volet à gauche"
msgid "Move to new pane right"
msgstr "Déplacer vers un nouveau volet à droite"
+#: src/components/TerminalTabStrip.tsx
+msgid "Move to right panel"
+msgstr "Déplacer vers le panneau de droite"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move to the next CodeMirror lint diagnostic."
msgstr "Va au diagnostic de vérification CodeMirror suivant."
@@ -10594,10 +10616,6 @@ msgstr "Afficher les agents"
msgid "Show All"
msgstr "Tout afficher"
-#: src/components/command-palette-commands.ts
-msgid "Show Bottom Dock"
-msgstr "Afficher le panneau inférieur"
-
#: src/components/acp/ThreadView.tsx
msgid "Show details"
msgstr "Afficher les détails"
@@ -10665,10 +10683,6 @@ msgstr "N'afficher que les fichiers markdown"
msgid "Show or hide agents"
msgstr "Afficher ou masquer les agents"
-#: src/lib/keyboard-shortcuts.ts
-msgid "Show or hide bottom dock"
-msgstr "Afficher ou masquer le panneau inférieur"
-
#: src/lib/keyboard-shortcuts.ts
msgid "Show or hide document panel"
msgstr "Afficher ou masquer le panneau du document"
@@ -10677,6 +10691,10 @@ msgstr "Afficher ou masquer le panneau du document"
msgid "Show or hide Files"
msgstr "Afficher ou masquer les fichiers"
+#: src/lib/keyboard-shortcuts.ts
+msgid "Show or hide Terminal"
+msgstr "Afficher ou masquer Terminal"
+
#: src/components/AgentDiffPane.tsx
#: src/components/EditorToolbar.tsx
#: src/components/TimelineDiffPane.tsx
@@ -10717,6 +10735,10 @@ msgstr "Afficher la barre latérale"
msgid "Show source"
msgstr "Afficher la source"
+#: src/components/command-palette-commands.ts
+msgid "Show Terminal"
+msgstr "Afficher Terminal"
+
#: src/comments/comment-chips.tsx
msgid "Show these comments"
msgstr "Afficher ces commentaires"
@@ -11540,6 +11562,10 @@ msgstr "Terminal {0}"
msgid "Terminal access isn't enabled for this project."
msgstr "L'accès au terminal n'est pas activé pour ce projet."
+#: src/components/EditorArea.tsx
+msgid "Terminal closed to make room for the agent panel."
+msgstr "Terminal a été fermé pour faire de la place au panneau des agents."
+
#: src/components/TerminalGate.tsx
msgid "Terminal disabled"
msgstr "Terminal désactivé"
@@ -12285,8 +12311,8 @@ msgid "Toggle strikethrough formatting."
msgstr "Bascule la mise en forme barrée."
#: src/lib/keyboard-shortcuts.ts
-msgid "Toggle the bottom dock, where the terminal lives."
-msgstr "Affiche ou masque le panneau inférieur, où se trouve le terminal."
+msgid "Toggle Terminal in its current dock."
+msgstr "Affichez ou masquez Terminal dans son panneau actuel."
#: src/lib/keyboard-shortcuts.ts
msgid "Toggle the left file sidebar."
diff --git a/packages/app/src/locales/hi/messages.json b/packages/app/src/locales/hi/messages.json
index 90c0d4ec6..783e9fd55 100644
--- a/packages/app/src/locales/hi/messages.json
+++ b/packages/app/src/locales/hi/messages.json
@@ -12,6 +12,7 @@
"-5jISU": [["0", "plural", { "one": ["#", " टेम्पलेट"], "other": ["#", " टेम्पलेट"] }]],
"-7s4fw": ["एजेंट खोजें"],
"-8PP0T": ["अक्षरों का आकार मिलाएँ"],
+ "-Al4WQ": ["Terminal दिखाएँ या छिपाएँ"],
"-FeyRg": ["मूल फ़ाइल रखें"],
"-K0AvT": ["कनेक्शन तोड़ें"],
"-LHLx7": ["टेम्पलेट संपादित किया गया"],
@@ -185,6 +186,7 @@
"2RnFoM": ["यह चैट फिर से शुरू नहीं हो सकी: ", ["0"]],
"2Snes1": ["यह लिंक का पता आपकी मशीन से बाहर भेजता है"],
"2UgoBZ": ["जा चुका"],
+ "2VSPan": ["एजेंट पैनल के लिए जगह बनाने हेतु Terminal बंद कर दिया गया।"],
"2XQ8Ww": ["एजेंट के संपादन करने पर पूर्वावलोकन खोलें"],
"2YOwme": ["पुनः आरंभ हुआ — अब v", ["appRuntime"], " चल रहा है।"],
"2YZwPB": ["आगे जाने वाले लिंक की प्रतिक्रिया अपेक्षित आकार से मेल नहीं खाई।"],
@@ -651,6 +653,7 @@
"9uI_rE": ["पूर्ववत करें"],
"9uRLEH": ["\"", ["name"], "\" नहीं खोली जा सकी — यह अभी प्रोजेक्ट की स्किल में नहीं है।"],
"9wQrUU": ["पुनर्संरचना"],
+ "9xCnv8": ["Terminal छिपाएँ"],
"9zb2WA": ["जोड़ा जा रहा है"],
"A1taO8": ["खोजें"],
"A50vr3": ["केवल छोटे अक्षर, अंक और <0>-</0> उपयोग करें।"],
@@ -1283,6 +1286,7 @@
"KDuPiY": [["fileName"], " अपलोड की जा रही है"],
"KDw4GX": ["फिर कोशिश करें"],
"KFd4xz": ["अनुपस्थित"],
+ "KGF42E": ["Terminal को पढ़ने योग्य बनाए रखने के लिए एजेंट पैनल बंद कर दिया गया।"],
"KGJb9_": ["विरोध"],
"KH5bQi": [
"<0>OK_EMBEDDINGS_API_KEY</0> पर्यावरण चर का उपयोग किया जा रहा है (OpenKnowledge के बाहर प्रबंधित)।"
@@ -1457,6 +1461,7 @@
"सिमलिंक अपने आप में एक फ़ोल्डर होने के बजाय स्रोत फ़ोल्डर की ओर एक संकेतक है। हर स्थान बिल्कुल वही बाइट पढ़ता है, इसलिए कुछ भी अलग नहीं हो सकता, और स्रोत हटने पर वह स्थान काम करना बंद कर देता है।"
],
"MTs6g3": ["सर्वर पुनः आरंभ होने के बाद फिर से नहीं जुड़ा जा सका"],
+ "MU_NVW": ["Terminal संक्षिप्त करें"],
"MUrVEo": ["कोई हाल का प्रोजेक्ट नहीं।"],
"MV-Dkb": [["countDisplay"], " markdown फ़ाइलें मिलीं"],
"MVxpbf": ["खोजें और बदलें"],
@@ -1517,7 +1522,6 @@
"NRSLBe": [["diffMin"], " मिनट पहले"],
"NSnIUP": ["दो पेज (सम)"],
"NUr4kz": ["इस फ़ोल्डर में नए दस्तावेज़ों के लिए एक पुन: उपयोग योग्य शुरुआती बिंदु।"],
- "NUw7lo": ["निचला पैनल दिखाएँ या छिपाएँ, जहाँ टर्मिनल रहता है।"],
"NYUhy5": ["उप-फ़ोल्डर का नाम"],
"NYn1cR": ["संपादक लोड हो रहा है"],
"NYu2Pt": ["नया प्रोजेक्ट…"],
@@ -1679,6 +1683,7 @@
],
"PrJYSN": ["यह फ़ोल्डर अभी GitHub पर नहीं है। जब तक इसे भेजा नहीं जाता तब तक लिंक काम नहीं करेगा।"],
"PrVaZo": ["OpenKnowledge हटाएँ?"],
+ "PrWQiT": ["Terminal को दाईं ओर ले जाएँ"],
"PrhzDE": ["ऊपर खिसकाएँ"],
"Q-DKvr": [["source"], " से इंस्टॉल करें"],
"Q1mtyd": ["साइडबार छिपाएँ"],
@@ -1814,6 +1819,7 @@
"S9Vnum": [["patternText"], " हटाएँ"],
"S9t1PI": [["0"], "/", ["1"], " ठीक किया जा रहा है"],
"SCoBBH": ["टैग सुझाव"],
+ "SCveu1": ["Terminal को उसके मौजूदा डॉक में दिखाएँ या छिपाएँ।"],
"SCzAbA": [["phase"], " — ", ["pct"], "%"],
"SF9qpO": ["आगे संपर्क के लिए अपना ईमेल साझा करें"],
"SFEWV6": ["OpenKnowledge स्किल लोड नहीं हो सकीं। फिर कोशिश करें।"],
@@ -1884,6 +1890,7 @@
"TiPvBP": ["रंग चुनें"],
"Tjc1pH": ["अनुभाग <0>(वैकल्पिक शीर्षक एंकर)</0>"],
"Tn5sik": ["एजेंट को बताता है कि यह स्किल कब उपयोग करनी है। आप इसे बाद में संपादित कर सकते हैं।"],
+ "Tofsyo": ["Terminal को नीचे ले जाएँ"],
"Tq3pcs": ["मेरा वाला रखें"],
"Tq9kNX": ["कोई चैट खुली नहीं है। पिछली चैट फिर से खोलें, या + बटन से नई शुरू करें।"],
"TsZmgr": ["डिस्क की फ़ाइल, और वह id जो एजेंट उपयोग करते हैं।"],
@@ -2078,7 +2085,6 @@
"Wh0im4": ["[[", ["realCurrentDoc"], "]] संपादित किया जा रहा है"],
"WhOsNE": ["काटा हुआ"],
"Wi-VWy": ["रिपोर्ट नहीं भेजी जा सकी"],
- "WiGqD8": ["निचला पैनल दिखाएँ"],
"WkTLN7": ["केवल markdown फ़ाइलें दिखाएँ"],
"WkyP2p": ["स्किल अनुभाग"],
"WmPbvm": ["उत्पाद अपडेट अपने इनबॉक्स में पाएँ।"],
@@ -2185,7 +2191,6 @@
"YJPN3F": ["बहुत धीमा"],
"YKLP_-": ["टेम्पलेट का नाम बदला गया"],
"YLMBSd": ["जैसे एक बड़ी तालिका चिपकाने के बाद संपादक जम गया"],
- "YM5oO0": ["निचला पैनल दिखाएँ या छिपाएँ"],
"YMlS7s": ["डिफ़ॉल्ट ऐप में खोलें"],
"YPFBfr": [["detail"], " - ", ["kind"], " \"", ["createdPath"], "\" अब भी डिस्क पर मौजूद है"],
"YRavYS": [
@@ -2724,6 +2729,7 @@
["descriptorLabel"],
"> रेंडर नहीं हो सका (शायद कोई ग़लत प्रॉप)। क्या ग़लत हुआ यह देखने के लिए स्रोत कॉपी करें, या ब्लॉक हटा दें।"
],
+ "g5V4_P": ["एजेंट पैनल संक्षिप्त करें"],
"g5w1sF": [
"वह फ़ोल्डर चुनें जिसे ",
["display"],
@@ -2969,6 +2975,7 @@
"jZ_E5M": ["फ़ेच विफल — विवरण के लिए सर्वर लॉग देखें।"],
"j_Z6g7": ["साझा डिफ़ॉल्ट"],
"jbSG8V": ["Files दिखाएँ (", ["sidebarShortcutLabel"], ")"],
+ "jcEoUi": ["दाएँ पैनल में ले जाएँ"],
"jdGUeI": ["टेम्पलेट नहीं बनाया जा सका: ", ["error"]],
"jeCFV7": ["दाईं ओर नए फलक में ले जाएँ"],
"jeJexw": [["0"], " का इंस्टॉल पूरा नहीं हो सका — नीचे देखें।"],
@@ -3316,7 +3323,6 @@
"o0bHtA": ["OpenKnowledge द्वारा"],
"o2yoFu": ["Finder में दिखाएँ, कोई कार्यक्षेत्र नहीं"],
"o49mDZ": ["समयरेखा का इतिहास लोड हो रहा है"],
- "o5jB-D": ["पैनल समेटें"],
"o9CrsQ": ["research-note"],
"o9fPtM": ["स्रोत से स्वत: अपडेट"],
"oAFVKX": ["प्रोजेक्ट सिंक डिफ़ॉल्ट अपडेट करने में विफल — ", ["detail"]],
@@ -3379,7 +3385,6 @@
"pAgkuZ": ["\"", ["docName"], "\" को एक नए स्थानीय सहयोग कैश के साथ दोबारा खोला जा रहा है।"],
"pBROkv": ["सदस्यता लेने के लिए धन्यवाद। उत्पाद अपडेट के लिए अपना इनबॉक्स देखते रहें।"],
"pCralD": ["बाईं ओर नए फलक में ले जाएँ"],
- "pDD2Hm": ["निचला पैनल छिपाएँ"],
"pEQFsW": ["कोई मेल खाता प्रोजेक्ट नहीं।"],
"pFPzHA": ["इमोजी चयनकर्ता"],
"pFRz_E": ["इन टिप्पणियों को इस संदेश से बाहर रखें"],
@@ -3923,6 +3928,7 @@
"xeXS4P": ["या कोई स्टार्टर पैक उपयोग करें"],
"xeiujy": ["पाठ"],
"xhlFsx": ["विरासत में मिला — इसे बदलने के लिए यहाँ कोई मान सेट करें।"],
+ "xi9KGG": ["Terminal दिखाएँ"],
"xiv-dW": ["अभी कोई फ़ाइल नहीं।"],
"xlQpTE": ["अस्वीकार के और विकल्प"],
"xloBjn": ["सापेक्ष पथ"],
diff --git a/packages/app/src/locales/hi/messages.po b/packages/app/src/locales/hi/messages.po
index 02b772a6d..0f525320a 100644
--- a/packages/app/src/locales/hi/messages.po
+++ b/packages/app/src/locales/hi/messages.po
@@ -1361,6 +1361,10 @@ msgstr "एजेंट कॉन्फ़िगरेशन फ़ाइल"
msgid "Agent mode"
msgstr "एजेंट मोड"
+#: src/components/EditorArea.tsx
+msgid "Agent panel closed to keep Terminal readable."
+msgstr "Terminal को पढ़ने योग्य बनाए रखने के लिए एजेंट पैनल बंद कर दिया गया।"
+
#: src/components/acp/ThreadView.tsx
msgid "Agent settings"
msgstr "एजेंट सेटिंग"
@@ -2492,6 +2496,10 @@ msgstr "समेटें"
msgid "Collapse {keyName}"
msgstr "{keyName} समेटें"
+#: src/components/TerminalTabStrip.tsx
+msgid "Collapse agent panel"
+msgstr "एजेंट पैनल संक्षिप्त करें"
+
#: src/components/AppMenubar.tsx
#: src/components/command-palette-commands.ts
#: src/components/FileSidebar.tsx
@@ -2516,8 +2524,8 @@ msgid "Collapse graph"
msgstr "ग्राफ़ समेटें"
#: src/components/TerminalTabStrip.tsx
-msgid "Collapse panel"
-msgstr "पैनल समेटें"
+msgid "Collapse Terminal"
+msgstr "Terminal संक्षिप्त करें"
#: src/editor/slash-command/component-items.tsx
msgid "Collapsible content block (Notion-style toggle)."
@@ -5734,10 +5742,6 @@ msgstr "उन्नत छिपाएँ"
msgid "Hide Agents"
msgstr "Agents छिपाएँ"
-#: src/components/command-palette-commands.ts
-msgid "Hide Bottom Dock"
-msgstr "निचला पैनल छिपाएँ"
-
#: src/components/acp/ThreadView.tsx
msgid "Hide details"
msgstr "विवरण छिपाएँ"
@@ -5812,6 +5816,10 @@ msgstr "चयन पूर्वावलोकन छिपाएँ"
msgid "Hide sidebar"
msgstr "साइडबार छिपाएँ"
+#: src/components/command-palette-commands.ts
+msgid "Hide Terminal"
+msgstr "Terminal छिपाएँ"
+
#: src/comments/comment-chips.tsx
msgid "Hide these comments"
msgstr "ये टिप्पणियाँ छिपाएँ"
@@ -7015,6 +7023,16 @@ msgstr "इस फ़ाइल को स्किल के भीतर हि
msgid "Move succeeded but the sidebar may be out of date — refresh to resync"
msgstr "हिलाना सफल रहा पर साइडबार पुराना हो सकता है — फिर से सिंक करने के लिए ताज़ा करें"
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to bottom"
+msgstr "Terminal को नीचे ले जाएँ"
+
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to right"
+msgstr "Terminal को दाईं ओर ले जाएँ"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move the current block up or down one position."
msgstr "मौजूदा ब्लॉक को एक स्थान ऊपर या नीचे ले जाएँ।"
@@ -7050,6 +7068,10 @@ msgstr "बाईं ओर नए फलक में ले जाएँ"
msgid "Move to new pane right"
msgstr "दाईं ओर नए फलक में ले जाएँ"
+#: src/components/TerminalTabStrip.tsx
+msgid "Move to right panel"
+msgstr "दाएँ पैनल में ले जाएँ"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move to the next CodeMirror lint diagnostic."
msgstr "अगले CodeMirror lint निदान पर जाएँ।"
@@ -10590,10 +10612,6 @@ msgstr "Agents दिखाएँ"
msgid "Show All"
msgstr "सभी दिखाएँ"
-#: src/components/command-palette-commands.ts
-msgid "Show Bottom Dock"
-msgstr "निचला पैनल दिखाएँ"
-
#: src/components/acp/ThreadView.tsx
msgid "Show details"
msgstr "विवरण दिखाएँ"
@@ -10661,10 +10679,6 @@ msgstr "केवल markdown फ़ाइलें दिखाएँ"
msgid "Show or hide agents"
msgstr "एजेंट दिखाएँ या छिपाएँ"
-#: src/lib/keyboard-shortcuts.ts
-msgid "Show or hide bottom dock"
-msgstr "निचला पैनल दिखाएँ या छिपाएँ"
-
#: src/lib/keyboard-shortcuts.ts
msgid "Show or hide document panel"
msgstr "दस्तावेज़ पैनल दिखाएँ या छिपाएँ"
@@ -10673,6 +10687,10 @@ msgstr "दस्तावेज़ पैनल दिखाएँ या छ
msgid "Show or hide Files"
msgstr "Files दिखाएँ या छिपाएँ"
+#: src/lib/keyboard-shortcuts.ts
+msgid "Show or hide Terminal"
+msgstr "Terminal दिखाएँ या छिपाएँ"
+
#: src/components/AgentDiffPane.tsx
#: src/components/EditorToolbar.tsx
#: src/components/TimelineDiffPane.tsx
@@ -10713,6 +10731,10 @@ msgstr "साइडबार दिखाएँ"
msgid "Show source"
msgstr "स्रोत दिखाएँ"
+#: src/components/command-palette-commands.ts
+msgid "Show Terminal"
+msgstr "Terminal दिखाएँ"
+
#: src/comments/comment-chips.tsx
msgid "Show these comments"
msgstr "ये टिप्पणियाँ दिखाएँ"
@@ -11536,6 +11558,10 @@ msgstr "टर्मिनल {0}"
msgid "Terminal access isn't enabled for this project."
msgstr "इस प्रोजेक्ट के लिए टर्मिनल पहुँच सक्षम नहीं है।"
+#: src/components/EditorArea.tsx
+msgid "Terminal closed to make room for the agent panel."
+msgstr "एजेंट पैनल के लिए जगह बनाने हेतु Terminal बंद कर दिया गया।"
+
#: src/components/TerminalGate.tsx
msgid "Terminal disabled"
msgstr "टर्मिनल अक्षम"
@@ -12281,8 +12307,8 @@ msgid "Toggle strikethrough formatting."
msgstr "काटी हुई फ़ॉर्मैटिंग चालू या बंद करें।"
#: src/lib/keyboard-shortcuts.ts
-msgid "Toggle the bottom dock, where the terminal lives."
-msgstr "निचला पैनल दिखाएँ या छिपाएँ, जहाँ टर्मिनल रहता है।"
+msgid "Toggle Terminal in its current dock."
+msgstr "Terminal को उसके मौजूदा डॉक में दिखाएँ या छिपाएँ।"
#: src/lib/keyboard-shortcuts.ts
msgid "Toggle the left file sidebar."
diff --git a/packages/app/src/locales/id/messages.json b/packages/app/src/locales/id/messages.json
index c756165b4..9ad1b9a10 100644
--- a/packages/app/src/locales/id/messages.json
+++ b/packages/app/src/locales/id/messages.json
@@ -6,6 +6,7 @@
"-5jISU": [["0", "plural", { "other": ["#", " templat"] }]],
"-7s4fw": ["Cari agen"],
"-8PP0T": ["Cocokkan huruf besar-kecil"],
+ "-Al4WQ": ["Tampilkan atau sembunyikan Terminal"],
"-FeyRg": ["Simpan berkas asli"],
"-K0AvT": ["Putuskan koneksi"],
"-LHLx7": ["templat disunting"],
@@ -189,6 +190,7 @@
"2RnFoM": ["Tidak dapat melanjutkan obrolan ini: ", ["0"]],
"2Snes1": ["Ini mengirim alamat tautannya keluar dari komputer Anda"],
"2UgoBZ": ["hilang"],
+ "2VSPan": ["Terminal ditutup untuk memberi ruang bagi panel agen."],
"2XQ8Ww": ["Buka pratinjau saat agen menyunting"],
"2YOwme": ["Dimulai ulang — kini menjalankan v", ["appRuntime"], "."],
"2YZwPB": ["Respons tautan keluar tidak sesuai bentuk yang diharapkan."],
@@ -677,6 +679,7 @@
"9uI_rE": ["Batalkan"],
"9uRLEH": ["\"", ["name"], "\" tidak bisa dibuka — ia belum ada di keterampilan proyek ini."],
"9wQrUU": ["Refaktor"],
+ "9xCnv8": ["Sembunyikan Terminal"],
"9zb2WA": ["Menghubungkan"],
"A1taO8": ["Cari"],
"A50vr3": ["Pakai hanya huruf kecil, angka, dan <0>-</0>."],
@@ -1338,6 +1341,7 @@
"KDuPiY": ["Mengunggah ", ["fileName"]],
"KDw4GX": ["Coba lagi"],
"KFd4xz": ["tidak ada"],
+ "KGF42E": ["Panel agen ditutup agar Terminal tetap mudah dibaca."],
"KGJb9_": ["Konflik"],
"KH5bQi": [
"Memakai variabel lingkungan <0>OK_EMBEDDINGS_API_KEY</0> (dikelola di luar OpenKnowledge)."
@@ -1508,6 +1512,7 @@
"Symlink adalah penunjuk ke folder sumber, bukan folder tersendiri. Setiap lokasi membaca bita yang persis sama, jadi tidak ada yang bisa melenceng, dan sebuah lokasi berhenti bekerja jika sumbernya dihapus."
],
"MTs6g3": ["Tidak bisa tersambung kembali setelah server dimulai ulang"],
+ "MU_NVW": ["Ciutkan Terminal"],
"MUrVEo": ["Tidak ada proyek terbaru."],
"MV-Dkb": ["Ditemukan ", ["countDisplay"], " berkas markdown"],
"MVxpbf": ["Cari dan ganti"],
@@ -1575,7 +1580,6 @@
"NRSLBe": [["diffMin"], " mnt lalu"],
"NSnIUP": ["Dua halaman (genap)"],
"NUr4kz": ["Titik awal yang bisa dipakai ulang untuk dokumen baru di folder ini."],
- "NUw7lo": ["Tampilkan atau sembunyikan panel bawah, tempat terminal berada."],
"NYUhy5": ["Nama subfolder"],
"NYn1cR": ["Memuat penyunting"],
"NYu2Pt": ["Proyek baru…"],
@@ -1741,6 +1745,7 @@
],
"PrJYSN": ["Folder ini belum ada di GitHub. Tautannya tidak akan berfungsi sampai ia dikirim."],
"PrVaZo": ["Copot OpenKnowledge?"],
+ "PrWQiT": ["Pindahkan Terminal ke kanan"],
"PrhzDE": ["Geser ke atas"],
"Q-DKvr": ["Pasang dari ", ["source"]],
"Q1mtyd": ["Sembunyikan bilah sisi"],
@@ -1876,6 +1881,7 @@
"S9Vnum": ["Hapus ", ["patternText"]],
"S9t1PI": ["Memperbaiki ", ["0"], "/", ["1"]],
"SCoBBH": ["Saran tag"],
+ "SCveu1": ["Tampilkan atau sembunyikan Terminal di dok saat ini."],
"SCzAbA": [["phase"], " — ", ["pct"], "%"],
"SF9qpO": ["Bagikan surel Anda untuk tindak lanjut"],
"SFEWV6": ["Keterampilan OpenKnowledge tidak dapat dimuat. Coba lagi."],
@@ -1949,6 +1955,7 @@
"Tn5sik": [
"Memberi tahu agen kapan harus memakai keterampilan ini. Anda bisa menyuntingnya nanti."
],
+ "Tofsyo": ["Pindahkan Terminal ke bawah"],
"Tq3pcs": ["Pakai punya saya"],
"Tq9kNX": [
"Tidak ada obrolan terbuka. Buka kembali obrolan sebelumnya, atau mulai yang baru dengan tombol +."
@@ -2161,7 +2168,6 @@
"Wh0im4": ["menyunting [[", ["realCurrentDoc"], "]]"],
"WhOsNE": ["Coret"],
"Wi-VWy": ["Laporannya tidak bisa dikirim"],
- "WiGqD8": ["Tampilkan panel bawah"],
"WkTLN7": ["Tampilkan hanya berkas markdown"],
"WkyP2p": ["Bagian Keterampilan"],
"WmPbvm": ["Dapatkan kabar terbaru produk di kotak masuk Anda."],
@@ -2270,7 +2276,6 @@
"YJPN3F": ["Terlalu lambat"],
"YKLP_-": ["Nama templat diganti"],
"YLMBSd": ["mis. Penyunting membeku setelah saya menempelkan tabel besar"],
- "YM5oO0": ["Tampilkan atau sembunyikan panel bawah"],
"YMlS7s": ["Buka di aplikasi bawaan"],
"YPFBfr": [["detail"], " - ", ["kind"], " \"", ["createdPath"], "\" masih ada di disk"],
"YRavYS": [
@@ -2837,6 +2842,7 @@
["descriptorLabel"],
"> gagal dirender (kemungkinan prop yang salah). Salin sumbernya untuk melihat apa yang salah, atau hapus bloknya."
],
+ "g5V4_P": ["Ciutkan panel agen"],
"g5w1sF": [
"Pilih sebuah folder untuk digabungkan KE DALAM ",
["display"],
@@ -3111,6 +3117,7 @@
"jZ_E5M": ["Fetch gagal — periksa log server untuk detailnya."],
"j_Z6g7": ["Bawaan bersama"],
"jbSG8V": ["Tampilkan Berkas (", ["sidebarShortcutLabel"], ")"],
+ "jcEoUi": ["Pindahkan ke panel kanan"],
"jdGUeI": ["Templat tidak bisa dibuat: ", ["error"]],
"jeCFV7": ["Pindahkan ke panel baru di kanan"],
"jeJexw": ["Pemasangan ", ["0"], " tidak bisa diselesaikan — lihat di bawah."],
@@ -3467,7 +3474,6 @@
"o0bHtA": ["Oleh OpenKnowledge"],
"o2yoFu": ["Tampilkan di Finder, tanpa ruang kerja"],
"o49mDZ": ["Memuat riwayat lini masa"],
- "o5jB-D": ["Ciutkan panel"],
"o9CrsQ": ["catatan-riset"],
"o9fPtM": ["Perbarui otomatis dari sumber"],
"oAFVKX": ["Gagal memperbarui sinkronisasi bawaan proyek — ", ["detail"]],
@@ -3534,7 +3540,6 @@
"Terima kasih sudah berlangganan. Pantau kotak masuk Anda untuk kabar terbaru produk."
],
"pCralD": ["Pindahkan ke panel baru di kiri"],
- "pDD2Hm": ["Sembunyikan panel bawah"],
"pEQFsW": ["Tidak ada proyek yang cocok."],
"pFPzHA": ["Pemilih emoji"],
"pFRz_E": ["Jangan sertakan komentar ini dalam pesan ini"],
@@ -4093,6 +4098,7 @@
"xeXS4P": ["Atau pakai paket awal"],
"xeiujy": ["Teks"],
"xhlFsx": ["Diwarisi — setel sebuah nilai di sini untuk menggantinya."],
+ "xi9KGG": ["Tampilkan Terminal"],
"xiv-dW": ["Belum ada berkas."],
"xlQpTE": ["Opsi penolakan lainnya"],
"xloBjn": ["Jalur Relatif"],
diff --git a/packages/app/src/locales/id/messages.po b/packages/app/src/locales/id/messages.po
index 9ae2bf5f2..a6ab4d2ce 100644
--- a/packages/app/src/locales/id/messages.po
+++ b/packages/app/src/locales/id/messages.po
@@ -1361,6 +1361,10 @@ msgstr "Berkas konfigurasi agen"
msgid "Agent mode"
msgstr "Mode agen"
+#: src/components/EditorArea.tsx
+msgid "Agent panel closed to keep Terminal readable."
+msgstr "Panel agen ditutup agar Terminal tetap mudah dibaca."
+
#: src/components/acp/ThreadView.tsx
msgid "Agent settings"
msgstr "Pengaturan agen"
@@ -2492,6 +2496,10 @@ msgstr "Ciutkan"
msgid "Collapse {keyName}"
msgstr "Ciutkan {keyName}"
+#: src/components/TerminalTabStrip.tsx
+msgid "Collapse agent panel"
+msgstr "Ciutkan panel agen"
+
#: src/components/AppMenubar.tsx
#: src/components/command-palette-commands.ts
#: src/components/FileSidebar.tsx
@@ -2516,8 +2524,8 @@ msgid "Collapse graph"
msgstr "Ciutkan graf"
#: src/components/TerminalTabStrip.tsx
-msgid "Collapse panel"
-msgstr "Ciutkan panel"
+msgid "Collapse Terminal"
+msgstr "Ciutkan Terminal"
#: src/editor/slash-command/component-items.tsx
msgid "Collapsible content block (Notion-style toggle)."
@@ -5734,10 +5742,6 @@ msgstr "Sembunyikan opsi lanjutan"
msgid "Hide Agents"
msgstr "Sembunyikan Agen"
-#: src/components/command-palette-commands.ts
-msgid "Hide Bottom Dock"
-msgstr "Sembunyikan panel bawah"
-
#: src/components/acp/ThreadView.tsx
msgid "Hide details"
msgstr "Sembunyikan detail"
@@ -5812,6 +5816,10 @@ msgstr "Sembunyikan pratinjau pilihan"
msgid "Hide sidebar"
msgstr "Sembunyikan bilah sisi"
+#: src/components/command-palette-commands.ts
+msgid "Hide Terminal"
+msgstr "Sembunyikan Terminal"
+
#: src/comments/comment-chips.tsx
msgid "Hide these comments"
msgstr "Sembunyikan komentar ini"
@@ -7015,6 +7023,16 @@ msgstr "Pindahkan atau ganti nama berkas ini di dalam keterampilan — jalurnya
msgid "Move succeeded but the sidebar may be out of date — refresh to resync"
msgstr "Pemindahan berhasil tetapi bilah sisi mungkin tidak mutakhir — segarkan untuk menyinkronkan ulang"
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to bottom"
+msgstr "Pindahkan Terminal ke bawah"
+
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to right"
+msgstr "Pindahkan Terminal ke kanan"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move the current block up or down one position."
msgstr "Menaikkan atau menurunkan blok saat ini satu posisi."
@@ -7050,6 +7068,10 @@ msgstr "Pindahkan ke panel baru di kiri"
msgid "Move to new pane right"
msgstr "Pindahkan ke panel baru di kanan"
+#: src/components/TerminalTabStrip.tsx
+msgid "Move to right panel"
+msgstr "Pindahkan ke panel kanan"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move to the next CodeMirror lint diagnostic."
msgstr "Pergi ke diagnostik lint CodeMirror berikutnya."
@@ -10590,10 +10612,6 @@ msgstr "Tampilkan Agen"
msgid "Show All"
msgstr "Tampilkan semua"
-#: src/components/command-palette-commands.ts
-msgid "Show Bottom Dock"
-msgstr "Tampilkan panel bawah"
-
#: src/components/acp/ThreadView.tsx
msgid "Show details"
msgstr "Tampilkan detail"
@@ -10661,10 +10679,6 @@ msgstr "Tampilkan hanya berkas markdown"
msgid "Show or hide agents"
msgstr "Tampilkan atau sembunyikan agen"
-#: src/lib/keyboard-shortcuts.ts
-msgid "Show or hide bottom dock"
-msgstr "Tampilkan atau sembunyikan panel bawah"
-
#: src/lib/keyboard-shortcuts.ts
msgid "Show or hide document panel"
msgstr "Tampilkan atau sembunyikan panel dokumen"
@@ -10673,6 +10687,10 @@ msgstr "Tampilkan atau sembunyikan panel dokumen"
msgid "Show or hide Files"
msgstr "Tampilkan atau sembunyikan Berkas"
+#: src/lib/keyboard-shortcuts.ts
+msgid "Show or hide Terminal"
+msgstr "Tampilkan atau sembunyikan Terminal"
+
#: src/components/AgentDiffPane.tsx
#: src/components/EditorToolbar.tsx
#: src/components/TimelineDiffPane.tsx
@@ -10713,6 +10731,10 @@ msgstr "Tampilkan bilah sisi"
msgid "Show source"
msgstr "Tampilkan sumber"
+#: src/components/command-palette-commands.ts
+msgid "Show Terminal"
+msgstr "Tampilkan Terminal"
+
#: src/comments/comment-chips.tsx
msgid "Show these comments"
msgstr "Tampilkan komentar ini"
@@ -11536,6 +11558,10 @@ msgstr "Terminal {0}"
msgid "Terminal access isn't enabled for this project."
msgstr "Akses terminal belum diaktifkan untuk proyek ini."
+#: src/components/EditorArea.tsx
+msgid "Terminal closed to make room for the agent panel."
+msgstr "Terminal ditutup untuk memberi ruang bagi panel agen."
+
#: src/components/TerminalGate.tsx
msgid "Terminal disabled"
msgstr "Terminal dinonaktifkan"
@@ -12281,8 +12307,8 @@ msgid "Toggle strikethrough formatting."
msgstr "Menyalakan atau mematikan format coret."
#: src/lib/keyboard-shortcuts.ts
-msgid "Toggle the bottom dock, where the terminal lives."
-msgstr "Tampilkan atau sembunyikan panel bawah, tempat terminal berada."
+msgid "Toggle Terminal in its current dock."
+msgstr "Tampilkan atau sembunyikan Terminal di dok saat ini."
#: src/lib/keyboard-shortcuts.ts
msgid "Toggle the left file sidebar."
diff --git a/packages/app/src/locales/pseudo/messages.json b/packages/app/src/locales/pseudo/messages.json
index 87dd54df8..296f35c06 100644
--- a/packages/app/src/locales/pseudo/messages.json
+++ b/packages/app/src/locales/pseudo/messages.json
@@ -12,6 +12,7 @@
"-5jISU": [["0", "plural", { "one": ["#", " ţēḿƥĺàţē"], "other": ["#", " ţēḿƥĺàţēś"] }]],
"-7s4fw": ["Śēàŕćĥ àĝēńţś"],
"-8PP0T": ["Ḿàţćĥ ćàśē"],
+ "-Al4WQ": ["Śĥōŵ ōŕ ĥĩďē Ţēŕḿĩńàĺ"],
"-FeyRg": ["Ķēēƥ ōŕĩĝĩńàĺ ƒĩĺē"],
"-K0AvT": ["Ďĩśćōńńēćţ"],
"-LHLx7": ["ēďĩţēď ţēḿƥĺàţē"],
@@ -189,6 +190,7 @@
"2RnFoM": ["Ćōũĺďń'ţ ŕēśũḿē ţĥĩś ćĥàţ: ", ["0"]],
"2Snes1": ["Ţĥĩś śēńďś ţĥē ĺĩńķ'ś àďďŕēśś ōƒƒ ŷōũŕ ḿàćĥĩńē"],
"2UgoBZ": ["ĝōńē"],
+ "2VSPan": ["Ţēŕḿĩńàĺ ćĺōśēď ţō ḿàķē ŕōōḿ ƒōŕ ţĥē àĝēńţ ƥàńēĺ."],
"2XQ8Ww": ["Ōƥēń ƥŕēvĩēŵ ŵĥēń àĝēńţ ēďĩţś"],
"2YOwme": ["Ŕēśţàŕţēď — ńōŵ ŕũńńĩńĝ v", ["appRuntime"], "."],
"2YZwPB": ["Ƒōŕŵàŕď-ĺĩńķś ŕēśƥōńśē ďĩď ńōţ ḿàţćĥ ēxƥēćţēď śĥàƥē."],
@@ -688,6 +690,7 @@
"9uI_rE": ["Ũńďō"],
"9uRLEH": ["Ćōũĺďń'ţ ōƥēń \"", ["name"], "\" — ĩţ ĩśń'ţ ĩń ţĥē ƥŕōĴēćţ'ś śķĩĺĺś ŷēţ."],
"9wQrUU": ["Ŕēƒàćţōŕĩńĝ"],
+ "9xCnv8": ["Ĥĩďē Ţēŕḿĩńàĺ"],
"9zb2WA": ["Ćōńńēćţĩńĝ"],
"A1taO8": ["Śēàŕćĥ"],
"A50vr3": ["Ũśē ĺōŵēŕćàśē ĺēţţēŕś, ďĩĝĩţś, àńď <0>-</0> ōńĺŷ."],
@@ -1339,6 +1342,7 @@
"KDuPiY": ["Ũƥĺōàďĩńĝ ", ["fileName"]],
"KDw4GX": ["Ţŕŷ àĝàĩń"],
"KFd4xz": ["àƀśēńţ"],
+ "KGF42E": ["Àĝēńţ ƥàńēĺ ćĺōśēď ţō ķēēƥ Ţēŕḿĩńàĺ ŕēàďàƀĺē."],
"KGJb9_": ["Ćōńƒĺĩćţś"],
"KH5bQi": [
"Ũśĩńĝ ţĥē <0>ŌĶ_ĒḾßĒĎĎĨŃĜŚ_ÀƤĨ_ĶĒŶ</0> ēńvĩŕōńḿēńţ vàŕĩàƀĺē (ḿàńàĝēď ōũţśĩďē ŌƥēńĶńōŵĺēďĝē)."
@@ -1516,6 +1520,7 @@
"À śŷḿĺĩńķ ĩś à ƥōĩńţēŕ ţō ţĥē śōũŕćē ƒōĺďēŕ ŕàţĥēŕ ţĥàń à ƒōĺďēŕ ōƒ ĩţś ōŵń. Ēvēŕŷ ĺōćàţĩōń ŕēàďś ţĥē ēxàćţ śàḿē ƀŷţēś, śō ńōţĥĩńĝ ćàń ďŕĩƒţ, àńď à ĺōćàţĩōń śţōƥś ŵōŕķĩńĝ ĩƒ ţĥē śōũŕćē ĩś ďēĺēţēď."
],
"MTs6g3": ["Ćōũĺďń'ţ ŕēćōńńēćţ àƒţēŕ śēŕvēŕ ŕēśţàŕţ"],
+ "MU_NVW": ["Ćōĺĺàƥśē Ţēŕḿĩńàĺ"],
"MUrVEo": ["Ńō ŕēćēńţ ƥŕōĴēćţś."],
"MV-Dkb": ["Ƒōũńď ", ["countDisplay"], " ḿàŕķďōŵń ƒĩĺēś"],
"MVxpbf": ["Ƒĩńď àńď ŕēƥĺàćē"],
@@ -1581,7 +1586,6 @@
"NRSLBe": [["diffMin"], "ḿ àĝō"],
"NSnIUP": ["Ţŵō-ƥàĝē (ēvēń)"],
"NUr4kz": ["À ŕēũśàƀĺē śţàŕţĩńĝ ƥōĩńţ ƒōŕ ńēŵ ďōćũḿēńţś ĩń ţĥĩś ƒōĺďēŕ."],
- "NUw7lo": ["Ţōĝĝĺē ţĥē ƀōţţōḿ ďōćķ, ŵĥēŕē ţĥē ţēŕḿĩńàĺ ĺĩvēś."],
"NYUhy5": ["Śũƀƒōĺďēŕ ńàḿē"],
"NYn1cR": ["Ĺōàďĩńĝ ēďĩţōŕ"],
"NYu2Pt": ["Ńēŵ ƥŕōĴēćţ…"],
@@ -1743,6 +1747,7 @@
],
"PrJYSN": ["Ţĥĩś ƒōĺďēŕ ĩśń'ţ ōń ĜĩţĤũƀ ŷēţ. Ţĥē ĺĩńķ ŵōń'ţ ŵōŕķ ũńţĩĺ ĩţ'ś ƥũśĥēď."],
"PrVaZo": ["Ũńĩńśţàĺĺ ŌƥēńĶńōŵĺēďĝē?"],
+ "PrWQiT": ["Ḿōvē Ţēŕḿĩńàĺ ţō ŕĩĝĥţ"],
"PrhzDE": ["Ƥàń ũƥ"],
"Q-DKvr": ["Ĩńśţàĺĺ ƒŕōḿ ", ["source"]],
"Q1mtyd": ["Ĥĩďē śĩďēƀàŕ"],
@@ -1882,6 +1887,7 @@
"S9Vnum": ["Ŕēḿōvē ", ["patternText"]],
"S9t1PI": ["Ƒĩxĩńĝ ", ["0"], "/", ["1"]],
"SCoBBH": ["Ţàĝ śũĝĝēśţĩōńś"],
+ "SCveu1": ["Ţōĝĝĺē Ţēŕḿĩńàĺ ĩń ĩţś ćũŕŕēńţ ďōćķ."],
"SCzAbA": [["phase"], " — ", ["pct"], "%"],
"SF9qpO": ["Śĥàŕē ŷōũŕ ēḿàĩĺ ƒōŕ ƒōĺĺōŵũƥś"],
"SFEWV6": ["Ćōũĺďń'ţ ĺōàď ţĥē ŌƥēńĶńōŵĺēďĝē śķĩĺĺś. Ţŕŷ àĝàĩń."],
@@ -1957,6 +1963,7 @@
"TiPvBP": ["Ćĥōōśē ćōĺōŕ"],
"Tjc1pH": ["Śēćţĩōń <0>(ōƥţĩōńàĺ ĥēàďĩńĝ àńćĥōŕ)</0>"],
"Tn5sik": ["Ţēĺĺś àĝēńţś ŵĥēń ţō ŕēàćĥ ƒōŕ ţĥĩś śķĩĺĺ. Ŷōũ ćàń ēďĩţ ĩţ ĺàţēŕ."],
+ "Tofsyo": ["Ḿōvē Ţēŕḿĩńàĺ ţō ƀōţţōḿ"],
"Tq3pcs": ["Ķēēƥ ḿĩńē"],
"Tq9kNX": ["Ńō ōƥēń ćĥàţś. Ŕēōƥēń à ƥàśţ ōńē, ōŕ śţàŕţ à ńēŵ ōńē ŵĩţĥ ţĥē + ƀũţţōń."],
"TsZmgr": ["Ţĥē ƒĩĺē ōń ďĩśķ, àńď ţĥē ĩď àĝēńţś ũśē."],
@@ -2157,7 +2164,6 @@
"Wh0im4": ["ēďĩţĩńĝ [[", ["realCurrentDoc"], "]]"],
"WhOsNE": ["Śţŕĩķēţĥŕōũĝĥ"],
"Wi-VWy": ["Ćōũĺďń'ţ śēńď ţĥē ŕēƥōŕţ"],
- "WiGqD8": ["Śĥōŵ ßōţţōḿ Ďōćķ"],
"WkTLN7": ["Śĥōŵ ōńĺŷ ḿàŕķďōŵń ƒĩĺēś"],
"WkyP2p": ["Śķĩĺĺś śēćţĩōń"],
"WmPbvm": ["Ĝēţ ƥŕōďũćţ ũƥďàţēś ĩń ŷōũŕ ĩńƀōx."],
@@ -2264,7 +2270,6 @@
"YJPN3F": ["Ţōō śĺōŵ"],
"YKLP_-": ["Ţēḿƥĺàţē ŕēńàḿēď"],
"YLMBSd": ["ē.ĝ. Ţĥē ēďĩţōŕ ƒŕōźē àƒţēŕ Ĩ ƥàśţēď à ĺàŕĝē ţàƀĺē"],
- "YM5oO0": ["Śĥōŵ ōŕ ĥĩďē ƀōţţōḿ ďōćķ"],
"YMlS7s": ["Ōƥēń ĩń ďēƒàũĺţ àƥƥ"],
"YPFBfr": [["detail"], " - ", ["kind"], " \"", ["createdPath"], "\" śţĩĺĺ ēxĩśţś ōń ďĩśķ"],
"YRavYS": [
@@ -2829,6 +2834,7 @@
["descriptorLabel"],
"> ƒàĩĺēď ţō ŕēńďēŕ (ĺĩķēĺŷ à ƀàď ƥŕōƥ). Ćōƥŷ ţĥē śōũŕćē ţō śēē ŵĥàţ ŵēńţ ŵŕōńĝ, ōŕ ďēĺēţē ţĥē ƀĺōćķ."
],
+ "g5V4_P": ["Ćōĺĺàƥśē àĝēńţ ƥàńēĺ"],
"g5w1sF": [
"Ƥĩćķ à ƒōĺďēŕ ţō ḿēŕĝē ĨŃŢŌ ",
["display"],
@@ -3084,6 +3090,7 @@
"jZ_E5M": ["Ƒēţćĥ ƒàĩĺēď — ćĥēćķ ţĥē śēŕvēŕ ĺōĝś ƒōŕ ďēţàĩĺś."],
"j_Z6g7": ["Śĥàŕēď ďēƒàũĺţ"],
"jbSG8V": ["Śĥōŵ Ƒĩĺēś (", ["sidebarShortcutLabel"], ")"],
+ "jcEoUi": ["Ḿōvē ţō ŕĩĝĥţ ƥàńēĺ"],
"jdGUeI": ["Ćōũĺďń'ţ ćŕēàţē ţēḿƥĺàţē: ", ["error"]],
"jeCFV7": ["Ḿōvē ţō ńēŵ ƥàńē ŕĩĝĥţ"],
"jeJexw": ["Ćōũĺďń'ţ ƒĩńĩśĥ ĩńśţàĺĺĩńĝ ", ["0"], " — śēē ƀēĺōŵ."],
@@ -3444,7 +3451,6 @@
"o0bHtA": ["ßŷ ŌƥēńĶńōŵĺēďĝē"],
"o2yoFu": ["Ŕēvēàĺ ĩń Ƒĩńďēŕ, Ńō ŵōŕķśƥàćē"],
"o49mDZ": ["Ĺōàďĩńĝ ţĩḿēĺĩńē ĥĩśţōŕŷ"],
- "o5jB-D": ["Ćōĺĺàƥśē ƥàńēĺ"],
"o9CrsQ": ["ŕēśēàŕćĥ-ńōţē"],
"o9fPtM": ["Àũţō-ũƥďàţē ƒŕōḿ śōũŕćē"],
"oAFVKX": ["Ƒàĩĺēď ţō ũƥďàţē ţĥē ƥŕōĴēćţ śŷńć ďēƒàũĺţ — ", ["detail"]],
@@ -3509,7 +3515,6 @@
"pAgkuZ": ["Ŕēōƥēńĩńĝ \"", ["docName"], "\" ŵĩţĥ à ƒŕēśĥ ĺōćàĺ ćōĺĺàƀōŕàţĩōń ćàćĥē."],
"pBROkv": ["Ţĥàńķś ƒōŕ śũƀśćŕĩƀĩńĝ. Ŵàţćĥ ŷōũŕ ĩńƀōx ƒōŕ ƥŕōďũćţ ũƥďàţēś."],
"pCralD": ["Ḿōvē ţō ńēŵ ƥàńē ĺēƒţ"],
- "pDD2Hm": ["Ĥĩďē ßōţţōḿ Ďōćķ"],
"pEQFsW": ["Ńō ḿàţćĥĩńĝ ƥŕōĴēćţś."],
"pFPzHA": ["ĒḿōĴĩ ƥĩćķēŕ"],
"pFRz_E": ["Ĺēàvē ţĥēśē ćōḿḿēńţś ōũţ ōƒ ţĥĩś ḿēśśàĝē"],
@@ -4084,6 +4089,7 @@
"xeXS4P": ["Ōŕ ũśē à śţàŕţēŕ ƥàćķ"],
"xeiujy": ["Ţēxţ"],
"xhlFsx": ["Ĩńĥēŕĩţēď — śēţ à vàĺũē ĥēŕē ţō ŕēƥĺàćē ĩţ."],
+ "xi9KGG": ["Śĥōŵ Ţēŕḿĩńàĺ"],
"xiv-dW": ["Ńō ƒĩĺēś ŷēţ."],
"xlQpTE": ["Ḿōŕē ŕēƒũśàĺ ōƥţĩōńś"],
"xloBjn": ["Ŕēĺàţĩvē Ƥàţĥ"],
diff --git a/packages/app/src/locales/pseudo/messages.po b/packages/app/src/locales/pseudo/messages.po
index add36a35c..0a85b91d5 100644
--- a/packages/app/src/locales/pseudo/messages.po
+++ b/packages/app/src/locales/pseudo/messages.po
@@ -1361,6 +1361,10 @@ msgstr ""
msgid "Agent mode"
msgstr ""
+#: src/components/EditorArea.tsx
+msgid "Agent panel closed to keep Terminal readable."
+msgstr ""
+
#: src/components/acp/ThreadView.tsx
msgid "Agent settings"
msgstr ""
@@ -2492,6 +2496,10 @@ msgstr ""
msgid "Collapse {keyName}"
msgstr ""
+#: src/components/TerminalTabStrip.tsx
+msgid "Collapse agent panel"
+msgstr ""
+
#: src/components/AppMenubar.tsx
#: src/components/command-palette-commands.ts
#: src/components/FileSidebar.tsx
@@ -2516,7 +2524,7 @@ msgid "Collapse graph"
msgstr ""
#: src/components/TerminalTabStrip.tsx
-msgid "Collapse panel"
+msgid "Collapse Terminal"
msgstr ""
#: src/editor/slash-command/component-items.tsx
@@ -5734,10 +5742,6 @@ msgstr ""
msgid "Hide Agents"
msgstr ""
-#: src/components/command-palette-commands.ts
-msgid "Hide Bottom Dock"
-msgstr ""
-
#: src/components/acp/ThreadView.tsx
msgid "Hide details"
msgstr ""
@@ -5812,6 +5816,10 @@ msgstr ""
msgid "Hide sidebar"
msgstr ""
+#: src/components/command-palette-commands.ts
+msgid "Hide Terminal"
+msgstr ""
+
#: src/comments/comment-chips.tsx
msgid "Hide these comments"
msgstr ""
@@ -7015,6 +7023,16 @@ msgstr ""
msgid "Move succeeded but the sidebar may be out of date — refresh to resync"
msgstr ""
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to bottom"
+msgstr ""
+
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to right"
+msgstr ""
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move the current block up or down one position."
msgstr ""
@@ -7050,6 +7068,10 @@ msgstr ""
msgid "Move to new pane right"
msgstr ""
+#: src/components/TerminalTabStrip.tsx
+msgid "Move to right panel"
+msgstr ""
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move to the next CodeMirror lint diagnostic."
msgstr ""
@@ -10590,10 +10612,6 @@ msgstr ""
msgid "Show All"
msgstr ""
-#: src/components/command-palette-commands.ts
-msgid "Show Bottom Dock"
-msgstr ""
-
#: src/components/acp/ThreadView.tsx
msgid "Show details"
msgstr ""
@@ -10662,15 +10680,15 @@ msgid "Show or hide agents"
msgstr ""
#: src/lib/keyboard-shortcuts.ts
-msgid "Show or hide bottom dock"
+msgid "Show or hide document panel"
msgstr ""
#: src/lib/keyboard-shortcuts.ts
-msgid "Show or hide document panel"
+msgid "Show or hide Files"
msgstr ""
#: src/lib/keyboard-shortcuts.ts
-msgid "Show or hide Files"
+msgid "Show or hide Terminal"
msgstr ""
#: src/components/AgentDiffPane.tsx
@@ -10713,6 +10731,10 @@ msgstr ""
msgid "Show source"
msgstr ""
+#: src/components/command-palette-commands.ts
+msgid "Show Terminal"
+msgstr ""
+
#: src/comments/comment-chips.tsx
msgid "Show these comments"
msgstr ""
@@ -11536,6 +11558,10 @@ msgstr ""
msgid "Terminal access isn't enabled for this project."
msgstr ""
+#: src/components/EditorArea.tsx
+msgid "Terminal closed to make room for the agent panel."
+msgstr ""
+
#: src/components/TerminalGate.tsx
msgid "Terminal disabled"
msgstr ""
@@ -12281,7 +12307,7 @@ msgid "Toggle strikethrough formatting."
msgstr ""
#: src/lib/keyboard-shortcuts.ts
-msgid "Toggle the bottom dock, where the terminal lives."
+msgid "Toggle Terminal in its current dock."
msgstr ""
#: src/lib/keyboard-shortcuts.ts
diff --git a/packages/app/src/locales/pt-BR/messages.json b/packages/app/src/locales/pt-BR/messages.json
index ca42c55e1..90ebfb525 100644
--- a/packages/app/src/locales/pt-BR/messages.json
+++ b/packages/app/src/locales/pt-BR/messages.json
@@ -22,6 +22,7 @@
],
"-7s4fw": ["Buscar agentes"],
"-8PP0T": ["Diferenciar maiúsculas"],
+ "-Al4WQ": ["Mostrar ou ocultar o Terminal"],
"-FeyRg": ["Manter o arquivo original"],
"-K0AvT": ["Desconectar"],
"-LHLx7": ["modelo editado"],
@@ -209,6 +210,7 @@
"2RnFoM": ["Não foi possível retomar este chat: ", ["0"]],
"2Snes1": ["Isto envia o endereço do link para fora do seu computador"],
"2UgoBZ": ["sumiu"],
+ "2VSPan": ["O Terminal foi fechado para abrir espaço para o painel de agentes."],
"2XQ8Ww": ["Abrir a pré-visualização quando o agente editar"],
"2YOwme": ["Reiniciado — agora rodando a v", ["appRuntime"], "."],
"2YZwPB": ["A resposta de links de saída não tinha o formato esperado."],
@@ -793,6 +795,7 @@
"\" — ela ainda não está entre as habilidades do projeto."
],
"9wQrUU": ["Refatoração"],
+ "9xCnv8": ["Ocultar o Terminal"],
"9zb2WA": ["Conectando"],
"A1taO8": ["Buscar"],
"A50vr3": ["Use apenas letras minúsculas, dígitos e <0>-</0>."],
@@ -1544,6 +1547,7 @@
"KDuPiY": ["Enviando ", ["fileName"]],
"KDw4GX": ["Tente de novo"],
"KFd4xz": ["ausente"],
+ "KGF42E": ["O painel de agentes foi fechado para manter o Terminal legível."],
"KGJb9_": ["Conflitos"],
"KH5bQi": [
"Usando a variável de ambiente <0>OK_EMBEDDINGS_API_KEY</0> (gerenciada fora do OpenKnowledge)."
@@ -1740,6 +1744,7 @@
"Um link simbólico aponta para a pasta de origem em vez de ser uma pasta própria. Todos os locais leem exatamente os mesmos bytes, então nada se desvia, e um local para de funcionar se a origem for excluída."
],
"MTs6g3": ["Não deu para reconectar após o reinício do servidor"],
+ "MU_NVW": ["Recolher o Terminal"],
"MUrVEo": ["Nenhum projeto recente."],
"MV-Dkb": [["countDisplay"], " arquivos markdown encontrados"],
"MVxpbf": ["Buscar e substituir"],
@@ -1807,7 +1812,6 @@
"NRSLBe": ["há ", ["diffMin"], " min"],
"NSnIUP": ["Duas páginas (pares)"],
"NUr4kz": ["Um ponto de partida reutilizável para novos documentos nesta pasta."],
- "NUw7lo": ["Mostra ou oculta o painel inferior, onde fica o terminal."],
"NYUhy5": ["Nome da subpasta"],
"NYn1cR": ["Carregando o editor"],
"NYu2Pt": ["Novo projeto…"],
@@ -1977,6 +1981,7 @@
"Esta pasta ainda não está no GitHub. O link não vai funcionar até ela ser enviada."
],
"PrVaZo": ["Desinstalar o OpenKnowledge?"],
+ "PrWQiT": ["Mover o Terminal para a direita"],
"PrhzDE": ["Deslocar para cima"],
"Q-DKvr": ["Instalar a partir de ", ["source"]],
"Q1mtyd": ["Ocultar a barra lateral"],
@@ -2125,6 +2130,7 @@
"S9Vnum": ["Remover ", ["patternText"]],
"S9t1PI": ["Corrigindo ", ["0"], "/", ["1"]],
"SCoBBH": ["Sugestões de tags"],
+ "SCveu1": ["Mostre ou oculte o Terminal no painel atual."],
"SCzAbA": [["phase"], " — ", ["pct"], "%"],
"SF9qpO": ["Compartilhe seu e-mail para retorno"],
"SFEWV6": ["Não foi possível carregar as habilidades do OpenKnowledge. Tente de novo."],
@@ -2213,6 +2219,7 @@
"TiPvBP": ["Escolher cor"],
"Tjc1pH": ["Seção <0>(âncora de título, opcional)</0>"],
"Tn5sik": ["Diz aos agentes quando recorrer a esta habilidade. Você pode editar depois."],
+ "Tofsyo": ["Mover o Terminal para a parte inferior"],
"Tq3pcs": ["Manter o meu"],
"Tq9kNX": ["Nenhum chat aberto. Reabra um anterior ou inicie um novo com o botão +."],
"TsZmgr": ["O arquivo no disco, e o id que os agentes usam."],
@@ -2441,7 +2448,6 @@
"Wh0im4": ["editando [[", ["realCurrentDoc"], "]]"],
"WhOsNE": ["Tachado"],
"Wi-VWy": ["Não deu para enviar o relatório"],
- "WiGqD8": ["Mostrar o painel inferior"],
"WkTLN7": ["Mostrar somente arquivos markdown"],
"WkyP2p": ["Seção Habilidades"],
"WmPbvm": ["Receba novidades do produto no seu e-mail."],
@@ -2550,7 +2556,6 @@
"YJPN3F": ["Lento demais"],
"YKLP_-": ["Modelo renomeado"],
"YLMBSd": ["ex.: O editor travou depois que colei uma tabela grande"],
- "YM5oO0": ["Mostrar ou ocultar o painel inferior"],
"YMlS7s": ["Abrir no aplicativo padrão"],
"YPFBfr": [["detail"], " - ", ["kind"], " \"", ["createdPath"], "\" ainda existe no disco"],
"YRavYS": [
@@ -3211,6 +3216,7 @@
["descriptorLabel"],
"> (provavelmente uma prop inválida). Copie o código para ver o que deu errado ou exclua o bloco."
],
+ "g5V4_P": ["Recolher o painel de agentes"],
"g5w1sF": [
"Escolha uma pasta para mesclar DENTRO de ",
["display"],
@@ -3486,6 +3492,7 @@
"jZ_E5M": ["Falha ao buscar — veja os logs do servidor para os detalhes."],
"j_Z6g7": ["Padrão compartilhado"],
"jbSG8V": ["Mostrar Arquivos (", ["sidebarShortcutLabel"], ")"],
+ "jcEoUi": ["Mover para o painel direito"],
"jdGUeI": ["Não deu para criar o modelo: ", ["error"]],
"jeCFV7": ["Mover para um novo painel à direita"],
"jeJexw": ["Não deu para terminar de instalar ", ["0"], " — veja abaixo."],
@@ -3877,7 +3884,6 @@
"o0bHtA": ["Pelo OpenKnowledge"],
"o2yoFu": ["Mostrar no Finder, sem espaço de trabalho"],
"o49mDZ": ["Carregando o histórico da linha do tempo"],
- "o5jB-D": ["Recolher o painel"],
"o9CrsQ": ["nota-de-pesquisa"],
"o9fPtM": ["Atualizar automaticamente pela fonte"],
"oAFVKX": ["Falha ao atualizar a sincronização padrão do projeto — ", ["detail"]],
@@ -3940,7 +3946,6 @@
"pAgkuZ": ["Reabrindo \"", ["docName"], "\" com um cache local de colaboração novo."],
"pBROkv": ["Obrigado por assinar. Fique de olho no seu e-mail para as novidades do produto."],
"pCralD": ["Mover para um novo painel à esquerda"],
- "pDD2Hm": ["Ocultar o painel inferior"],
"pEQFsW": ["Nenhum projeto corresponde."],
"pFPzHA": ["Seletor de emojis"],
"pFRz_E": ["Deixar estes comentários fora desta mensagem"],
@@ -4573,6 +4578,7 @@
"xeXS4P": ["Ou use um pacote inicial"],
"xeiujy": ["Texto"],
"xhlFsx": ["Herdado — defina um valor aqui para substituí-lo."],
+ "xi9KGG": ["Mostrar o Terminal"],
"xiv-dW": ["Ainda não há arquivos."],
"xlQpTE": ["Mais opções de recusa"],
"xloBjn": ["Caminho relativo"],
diff --git a/packages/app/src/locales/pt-BR/messages.po b/packages/app/src/locales/pt-BR/messages.po
index 27031550e..762dd288b 100644
--- a/packages/app/src/locales/pt-BR/messages.po
+++ b/packages/app/src/locales/pt-BR/messages.po
@@ -1361,6 +1361,10 @@ msgstr "Arquivo de configuração do agente"
msgid "Agent mode"
msgstr "Modo agente"
+#: src/components/EditorArea.tsx
+msgid "Agent panel closed to keep Terminal readable."
+msgstr "O painel de agentes foi fechado para manter o Terminal legível."
+
#: src/components/acp/ThreadView.tsx
msgid "Agent settings"
msgstr "Configurações do agente"
@@ -2492,6 +2496,10 @@ msgstr "Recolher"
msgid "Collapse {keyName}"
msgstr "Recolher {keyName}"
+#: src/components/TerminalTabStrip.tsx
+msgid "Collapse agent panel"
+msgstr "Recolher o painel de agentes"
+
#: src/components/AppMenubar.tsx
#: src/components/command-palette-commands.ts
#: src/components/FileSidebar.tsx
@@ -2516,8 +2524,8 @@ msgid "Collapse graph"
msgstr "Recolher o grafo"
#: src/components/TerminalTabStrip.tsx
-msgid "Collapse panel"
-msgstr "Recolher o painel"
+msgid "Collapse Terminal"
+msgstr "Recolher o Terminal"
#: src/editor/slash-command/component-items.tsx
msgid "Collapsible content block (Notion-style toggle)."
@@ -5734,10 +5742,6 @@ msgstr "Ocultar as opções avançadas"
msgid "Hide Agents"
msgstr "Ocultar Agentes"
-#: src/components/command-palette-commands.ts
-msgid "Hide Bottom Dock"
-msgstr "Ocultar o painel inferior"
-
#: src/components/acp/ThreadView.tsx
msgid "Hide details"
msgstr "Ocultar detalhes"
@@ -5812,6 +5816,10 @@ msgstr "Ocultar a pré-visualização da seleção"
msgid "Hide sidebar"
msgstr "Ocultar a barra lateral"
+#: src/components/command-palette-commands.ts
+msgid "Hide Terminal"
+msgstr "Ocultar o Terminal"
+
#: src/comments/comment-chips.tsx
msgid "Hide these comments"
msgstr "Ocultar estes comentários"
@@ -7015,6 +7023,16 @@ msgstr "Mova ou renomeie este arquivo dentro da habilidade — o caminho continu
msgid "Move succeeded but the sidebar may be out of date — refresh to resync"
msgstr "A movimentação deu certo, mas a barra lateral pode estar desatualizada — atualize para ressincronizar"
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to bottom"
+msgstr "Mover o Terminal para a parte inferior"
+
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to right"
+msgstr "Mover o Terminal para a direita"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move the current block up or down one position."
msgstr "Sobe ou desce o bloco atual uma posição."
@@ -7050,6 +7068,10 @@ msgstr "Mover para um novo painel à esquerda"
msgid "Move to new pane right"
msgstr "Mover para um novo painel à direita"
+#: src/components/TerminalTabStrip.tsx
+msgid "Move to right panel"
+msgstr "Mover para o painel direito"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move to the next CodeMirror lint diagnostic."
msgstr "Vai para o próximo diagnóstico de análise do CodeMirror."
@@ -10590,10 +10612,6 @@ msgstr "Mostrar Agentes"
msgid "Show All"
msgstr "Mostrar tudo"
-#: src/components/command-palette-commands.ts
-msgid "Show Bottom Dock"
-msgstr "Mostrar o painel inferior"
-
#: src/components/acp/ThreadView.tsx
msgid "Show details"
msgstr "Mostrar detalhes"
@@ -10661,10 +10679,6 @@ msgstr "Mostrar somente arquivos markdown"
msgid "Show or hide agents"
msgstr "Mostrar ou ocultar os agentes"
-#: src/lib/keyboard-shortcuts.ts
-msgid "Show or hide bottom dock"
-msgstr "Mostrar ou ocultar o painel inferior"
-
#: src/lib/keyboard-shortcuts.ts
msgid "Show or hide document panel"
msgstr "Mostrar ou ocultar o painel do documento"
@@ -10673,6 +10687,10 @@ msgstr "Mostrar ou ocultar o painel do documento"
msgid "Show or hide Files"
msgstr "Mostrar ou ocultar Arquivos"
+#: src/lib/keyboard-shortcuts.ts
+msgid "Show or hide Terminal"
+msgstr "Mostrar ou ocultar o Terminal"
+
#: src/components/AgentDiffPane.tsx
#: src/components/EditorToolbar.tsx
#: src/components/TimelineDiffPane.tsx
@@ -10713,6 +10731,10 @@ msgstr "Mostrar a barra lateral"
msgid "Show source"
msgstr "Mostrar o código"
+#: src/components/command-palette-commands.ts
+msgid "Show Terminal"
+msgstr "Mostrar o Terminal"
+
#: src/comments/comment-chips.tsx
msgid "Show these comments"
msgstr "Mostrar estes comentários"
@@ -11536,6 +11558,10 @@ msgstr "Terminal {0}"
msgid "Terminal access isn't enabled for this project."
msgstr "O acesso ao terminal não está ativado neste projeto."
+#: src/components/EditorArea.tsx
+msgid "Terminal closed to make room for the agent panel."
+msgstr "O Terminal foi fechado para abrir espaço para o painel de agentes."
+
#: src/components/TerminalGate.tsx
msgid "Terminal disabled"
msgstr "Terminal desativado"
@@ -12281,8 +12307,8 @@ msgid "Toggle strikethrough formatting."
msgstr "Liga ou desliga o tachado."
#: src/lib/keyboard-shortcuts.ts
-msgid "Toggle the bottom dock, where the terminal lives."
-msgstr "Mostra ou oculta o painel inferior, onde fica o terminal."
+msgid "Toggle Terminal in its current dock."
+msgstr "Mostre ou oculte o Terminal no painel atual."
#: src/lib/keyboard-shortcuts.ts
msgid "Toggle the left file sidebar."
diff --git a/packages/app/src/locales/ur/messages.json b/packages/app/src/locales/ur/messages.json
index ab59228d6..15f850962 100644
--- a/packages/app/src/locales/ur/messages.json
+++ b/packages/app/src/locales/ur/messages.json
@@ -8,6 +8,7 @@
"-5jISU": [["0", "plural", { "one": ["#", " ٹیمپلیٹ"], "other": ["#", " ٹیمپلیٹس"] }]],
"-7s4fw": ["ایجنٹس تلاش کریں"],
"-8PP0T": ["حروف کی حالت ملائیں"],
+ "-Al4WQ": ["Terminal دکھائیں یا چھپائیں"],
"-FeyRg": ["اصل فائل رکھیں"],
"-K0AvT": ["منقطع کریں"],
"-LHLx7": ["ٹیمپلیٹ میں ترمیم کی"],
@@ -189,6 +190,7 @@
"2RnFoM": ["یہ چیٹ دوبارہ شروع نہیں ہو سکی: ", ["0"]],
"2Snes1": ["یہ لنک کا پتہ آپ کی مشین سے باہر بھیجتا ہے"],
"2UgoBZ": ["غائب"],
+ "2VSPan": ["ایجنٹ پینل کے لیے جگہ بنانے کی خاطر Terminal بند کر دیا گیا۔"],
"2XQ8Ww": ["ایجنٹ کی ترمیم پر پیش منظر کھولیں"],
"2YOwme": ["دوبارہ چل پڑا — اب v", ["appRuntime"], " چل رہا ہے۔"],
"2YZwPB": ["باہر جانے والے لنکس کا جواب متوقع ساخت سے میل نہیں کھایا۔"],
@@ -691,6 +693,7 @@
"9uI_rE": ["واپس لیں"],
"9uRLEH": ["«", ["name"], "» نہیں کھل سکی — یہ ابھی پروجیکٹ کی مہارتوں میں شامل نہیں۔"],
"9wQrUU": ["دوبارہ ڈھانچہ سازی"],
+ "9xCnv8": ["Terminal چھپائیں"],
"9zb2WA": ["منسلک ہو رہا ہے"],
"A1taO8": ["تلاش"],
"A50vr3": ["صرف چھوٹے حروف، ہندسے اور <0>-</0> استعمال کریں۔"],
@@ -1362,6 +1365,7 @@
"KDuPiY": [["fileName"], " اپ لوڈ ہو رہی ہے"],
"KDw4GX": ["دوبارہ کوشش کریں"],
"KFd4xz": ["غیر موجود"],
+ "KGF42E": ["Terminal کو پڑھنے کے قابل رکھنے کے لیے ایجنٹ پینل بند کر دیا گیا۔"],
"KGJb9_": ["تنازعات"],
"KH5bQi": [
"<0>OK_EMBEDDINGS_API_KEY</0> ماحولیاتی متغیر استعمال ہو رہا ہے (OpenKnowledge سے باہر سنبھالا جاتا ہے)۔"
@@ -1546,6 +1550,7 @@
"سِم لنک اپنا الگ فولڈر ہونے کے بجائے ماخذ فولڈر کی طرف اشارہ ہوتا ہے۔ ہر مقام بالکل وہی بائٹس پڑھتا ہے، اس لیے کچھ بھی الگ نہیں ہو سکتا، اور اگر ماخذ حذف ہو جائے تو وہ مقام کام کرنا بند کر دیتا ہے۔"
],
"MTs6g3": ["سرور دوبارہ چلنے کے بعد دوبارہ منسلک نہیں ہو سکا"],
+ "MU_NVW": ["Terminal سمیٹیں"],
"MUrVEo": ["کوئی حالیہ پروجیکٹ نہیں۔"],
"MV-Dkb": [["countDisplay"], " Markdown فائلیں ملیں"],
"MVxpbf": ["تلاش اور تبدیلی"],
@@ -1610,7 +1615,6 @@
"NRSLBe": [["diffMin"], " منٹ پہلے"],
"NSnIUP": ["دو صفحے (جفت)"],
"NUr4kz": ["اس فولڈر میں نئی دستاویزات کے لیے دوبارہ استعمال ہونے والا نقطۂ آغاز۔"],
- "NUw7lo": ["نچلا پینل دکھائیں یا چھپائیں، جہاں ٹرمینل ہوتا ہے۔"],
"NYUhy5": ["ذیلی فولڈر کا نام"],
"NYn1cR": ["ایڈیٹر لوڈ ہو رہا ہے"],
"NYu2Pt": ["نیا پروجیکٹ…"],
@@ -1776,6 +1780,7 @@
],
"PrJYSN": ["یہ فولڈر ابھی GitHub پر نہیں ہے۔ پُش ہونے تک لنک کام نہیں کرے گا۔"],
"PrVaZo": ["OpenKnowledge کی تنصیب ختم کریں؟"],
+ "PrWQiT": ["Terminal کو دائیں منتقل کریں"],
"PrhzDE": ["اوپر کھسکائیں"],
"Q-DKvr": [["source"], " سے نصب کریں"],
"Q1mtyd": ["سائیڈ بار چھپائیں"],
@@ -1919,6 +1924,7 @@
"S9Vnum": [["patternText"], " ہٹائیں"],
"S9t1PI": [["0"], "/", ["1"], " ٹھیک کیا جا رہا ہے"],
"SCoBBH": ["ٹیگ کی تجاویز"],
+ "SCveu1": ["Terminal کو اس کی موجودہ ڈاک میں دکھائیں یا چھپائیں۔"],
"SCzAbA": [["phase"], " — ", ["pct"], "%"],
"SF9qpO": ["رابطے کے لیے اپنا ای میل شیئر کریں"],
"SFEWV6": ["OpenKnowledge مہارتیں لوڈ نہیں ہو سکیں۔ دوبارہ کوشش کریں۔"],
@@ -2001,6 +2007,7 @@
"Tn5sik": [
"ایجنٹس کو بتاتا ہے کہ اس مہارت کا استعمال کب کرنا ہے۔ آپ اسے بعد میں بدل سکتے ہیں۔"
],
+ "Tofsyo": ["Terminal کو نیچے منتقل کریں"],
"Tq3pcs": ["میری والی رکھیں"],
"Tq9kNX": ["کوئی کھلی چیٹ نہیں۔ پچھلی چیٹ دوبارہ کھولیں، یا + بٹن سے نئی شروع کریں۔"],
"TsZmgr": ["ڈسک پر موجود فائل، اور وہ شناخت جو ایجنٹس استعمال کرتے ہیں۔"],
@@ -2205,7 +2212,6 @@
"Wh0im4": ["[[", ["realCurrentDoc"], "]] میں ترمیم کر رہا ہے"],
"WhOsNE": ["درمیان سے کٹا ہوا"],
"Wi-VWy": ["رپورٹ نہیں بھیجی جا سکی"],
- "WiGqD8": ["نچلا پینل دکھائیں"],
"WkTLN7": ["صرف Markdown فائلیں دکھائیں"],
"WkyP2p": ["مہارتوں کا سیکشن"],
"WmPbvm": ["مصنوعات کی اپ ڈیٹس اپنے اِن باکس میں پائیں۔"],
@@ -2312,7 +2318,6 @@
"YJPN3F": ["بہت سست"],
"YKLP_-": ["ٹیمپلیٹ کا نام بدل گیا"],
"YLMBSd": ["مثلاً بڑا ٹیبل چسپاں کرنے کے بعد ایڈیٹر جم گیا"],
- "YM5oO0": ["نچلا پینل دکھائیں یا چھپائیں"],
"YMlS7s": ["ڈیفالٹ ایپ میں کھولیں"],
"YPFBfr": [["detail"], " - ", ["kind"], " «", ["createdPath"], "» اب بھی ڈسک پر موجود ہے"],
"YRavYS": [
@@ -2882,6 +2887,7 @@
["descriptorLabel"],
"> رینڈر نہیں ہو سکا (غالباً کوئی غلط پراپ)۔ خرابی دیکھنے کے لیے سورس کاپی کریں، یا بلاک حذف کر دیں۔"
],
+ "g5V4_P": ["ایجنٹ پینل سمیٹیں"],
"g5w1sF": [
["display"],
" میں ضم کرنے کے لیے کوئی فولڈر منتخب کریں۔ وہ فولڈر اس کا سِم لنک بن جاتا ہے، اس لیے اس کا ایجنٹ یہاں رکھی ہر چیز پڑھتا ہے۔ یہ فولڈر حقیقی رہتا ہے۔ متصادم مہارتیں ضم کرنے کا عمل روک دیتی ہیں۔"
@@ -3144,6 +3150,7 @@
"jZ_E5M": ["لانا ناکام رہا — تفصیلات کے لیے سرور کے لاگز دیکھیں۔"],
"j_Z6g7": ["مشترکہ طے شدہ"],
"jbSG8V": ["فائلیں دکھائیں (", ["sidebarShortcutLabel"], ")"],
+ "jcEoUi": ["دائیں پینل میں منتقل کریں"],
"jdGUeI": ["ٹیمپلیٹ نہیں بن سکا: ", ["error"]],
"jeCFV7": ["دائیں جانب نئے پین میں منتقل کریں"],
"jeJexw": [["0"], " کی تنصیب مکمل نہیں ہو سکی — نیچے دیکھیں۔"],
@@ -3511,7 +3518,6 @@
"o0bHtA": ["بذریعہ OpenKnowledge"],
"o2yoFu": ["Finder میں دکھائیں، کوئی ورک اسپیس نہیں"],
"o49mDZ": ["ٹائم لائن کی تاریخ لوڈ ہو رہی ہے"],
- "o5jB-D": ["پینل سکیڑیں"],
"o9CrsQ": ["research-note"],
"o9fPtM": ["ماخذ سے خودکار اپ ڈیٹ"],
"oAFVKX": ["پروجیکٹ کی طے شدہ مطابقت پذیری تازہ نہیں ہو سکی — ", ["detail"]],
@@ -3574,7 +3580,6 @@
"pAgkuZ": ["«", ["docName"], "» کو نئی مقامی اشتراکی کیشے کے ساتھ دوبارہ کھولا جا رہا ہے۔"],
"pBROkv": ["رکنیت لینے کا شکریہ۔ مصنوعات کی اپ ڈیٹس کے لیے اپنا اِن باکس دیکھتے رہیں۔"],
"pCralD": ["بائیں جانب نئے پین میں منتقل کریں"],
- "pDD2Hm": ["نچلا پینل چھپائیں"],
"pEQFsW": ["کوئی مماثل پروجیکٹ نہیں۔"],
"pFPzHA": ["ایموجی منتخب کنندہ"],
"pFRz_E": ["ان تبصروں کو اس پیغام سے باہر رکھیں"],
@@ -4140,6 +4145,7 @@
"xeXS4P": ["یا کوئی ابتدائی پیک استعمال کریں"],
"xeiujy": ["متن"],
"xhlFsx": ["وراثت میں ملا — اسے بدلنے کے لیے یہاں کوئی قدر مقرر کریں۔"],
+ "xi9KGG": ["Terminal دکھائیں"],
"xiv-dW": ["ابھی کوئی فائل نہیں۔"],
"xlQpTE": ["انکار کے مزید آپشنز"],
"xloBjn": ["نسبتی راستہ"],
diff --git a/packages/app/src/locales/ur/messages.po b/packages/app/src/locales/ur/messages.po
index 4444f74b7..c10269a1b 100644
--- a/packages/app/src/locales/ur/messages.po
+++ b/packages/app/src/locales/ur/messages.po
@@ -1365,6 +1365,10 @@ msgstr "ایجنٹ کی کنفیگریشن فائل"
msgid "Agent mode"
msgstr "ایجنٹ موڈ"
+#: src/components/EditorArea.tsx
+msgid "Agent panel closed to keep Terminal readable."
+msgstr "Terminal کو پڑھنے کے قابل رکھنے کے لیے ایجنٹ پینل بند کر دیا گیا۔"
+
#: src/components/acp/ThreadView.tsx
msgid "Agent settings"
msgstr "ایجنٹ کی ترتیبات"
@@ -2496,6 +2500,10 @@ msgstr "سکیڑیں"
msgid "Collapse {keyName}"
msgstr "{keyName} سکیڑیں"
+#: src/components/TerminalTabStrip.tsx
+msgid "Collapse agent panel"
+msgstr "ایجنٹ پینل سمیٹیں"
+
#: src/components/AppMenubar.tsx
#: src/components/command-palette-commands.ts
#: src/components/FileSidebar.tsx
@@ -2520,8 +2528,8 @@ msgid "Collapse graph"
msgstr "گراف سکیڑیں"
#: src/components/TerminalTabStrip.tsx
-msgid "Collapse panel"
-msgstr "پینل سکیڑیں"
+msgid "Collapse Terminal"
+msgstr "Terminal سمیٹیں"
#: src/editor/slash-command/component-items.tsx
msgid "Collapsible content block (Notion-style toggle)."
@@ -5738,10 +5746,6 @@ msgstr "اعلیٰ آپشنز چھپائیں"
msgid "Hide Agents"
msgstr "ایجنٹس چھپائیں"
-#: src/components/command-palette-commands.ts
-msgid "Hide Bottom Dock"
-msgstr "نچلا پینل چھپائیں"
-
#: src/components/acp/ThreadView.tsx
msgid "Hide details"
msgstr "تفصیلات چھپائیں"
@@ -5816,6 +5820,10 @@ msgstr "انتخاب کا پیش منظر چھپائیں"
msgid "Hide sidebar"
msgstr "سائیڈ بار چھپائیں"
+#: src/components/command-palette-commands.ts
+msgid "Hide Terminal"
+msgstr "Terminal چھپائیں"
+
#: src/comments/comment-chips.tsx
msgid "Hide these comments"
msgstr "یہ تبصرے چھپائیں"
@@ -7019,6 +7027,16 @@ msgstr "اس فائل کو مہارت کے اندر منتقل کریں یا ا
msgid "Move succeeded but the sidebar may be out of date — refresh to resync"
msgstr "منتقلی ہو گئی مگر سائیڈ بار پرانا ہو سکتا ہے — دوبارہ مطابقت کے لیے تازہ کریں"
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to bottom"
+msgstr "Terminal کو نیچے منتقل کریں"
+
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to right"
+msgstr "Terminal کو دائیں منتقل کریں"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move the current block up or down one position."
msgstr "موجودہ بلاک کو ایک درجہ اوپر یا نیچے لے جائیں۔"
@@ -7054,6 +7072,10 @@ msgstr "بائیں جانب نئے پین میں منتقل کریں"
msgid "Move to new pane right"
msgstr "دائیں جانب نئے پین میں منتقل کریں"
+#: src/components/TerminalTabStrip.tsx
+msgid "Move to right panel"
+msgstr "دائیں پینل میں منتقل کریں"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move to the next CodeMirror lint diagnostic."
msgstr "CodeMirror کی اگلی لِنٹ تشخیص پر جائیں۔"
@@ -10594,10 +10616,6 @@ msgstr "ایجنٹس دکھائیں"
msgid "Show All"
msgstr "سب دکھائیں"
-#: src/components/command-palette-commands.ts
-msgid "Show Bottom Dock"
-msgstr "نچلا پینل دکھائیں"
-
#: src/components/acp/ThreadView.tsx
msgid "Show details"
msgstr "تفصیلات دکھائیں"
@@ -10665,10 +10683,6 @@ msgstr "صرف Markdown فائلیں دکھائیں"
msgid "Show or hide agents"
msgstr "ایجنٹس دکھائیں یا چھپائیں"
-#: src/lib/keyboard-shortcuts.ts
-msgid "Show or hide bottom dock"
-msgstr "نچلا پینل دکھائیں یا چھپائیں"
-
#: src/lib/keyboard-shortcuts.ts
msgid "Show or hide document panel"
msgstr "دستاویز کا پینل دکھائیں یا چھپائیں"
@@ -10677,6 +10691,10 @@ msgstr "دستاویز کا پینل دکھائیں یا چھپائیں"
msgid "Show or hide Files"
msgstr "فائلیں دکھائیں یا چھپائیں"
+#: src/lib/keyboard-shortcuts.ts
+msgid "Show or hide Terminal"
+msgstr "Terminal دکھائیں یا چھپائیں"
+
#: src/components/AgentDiffPane.tsx
#: src/components/EditorToolbar.tsx
#: src/components/TimelineDiffPane.tsx
@@ -10717,6 +10735,10 @@ msgstr "سائیڈ بار دکھائیں"
msgid "Show source"
msgstr "سورس دکھائیں"
+#: src/components/command-palette-commands.ts
+msgid "Show Terminal"
+msgstr "Terminal دکھائیں"
+
#: src/comments/comment-chips.tsx
msgid "Show these comments"
msgstr "یہ تبصرے دکھائیں"
@@ -11540,6 +11562,10 @@ msgstr "ٹرمینل {0}"
msgid "Terminal access isn't enabled for this project."
msgstr "اس پروجیکٹ کے لیے ٹرمینل کی رسائی فعال نہیں۔"
+#: src/components/EditorArea.tsx
+msgid "Terminal closed to make room for the agent panel."
+msgstr "ایجنٹ پینل کے لیے جگہ بنانے کی خاطر Terminal بند کر دیا گیا۔"
+
#: src/components/TerminalGate.tsx
msgid "Terminal disabled"
msgstr "ٹرمینل بند"
@@ -12285,8 +12311,8 @@ msgid "Toggle strikethrough formatting."
msgstr "درمیان سے کٹی فارمیٹنگ بدلیں۔"
#: src/lib/keyboard-shortcuts.ts
-msgid "Toggle the bottom dock, where the terminal lives."
-msgstr "نچلا پینل دکھائیں یا چھپائیں، جہاں ٹرمینل ہوتا ہے۔"
+msgid "Toggle Terminal in its current dock."
+msgstr "Terminal کو اس کی موجودہ ڈاک میں دکھائیں یا چھپائیں۔"
#: src/lib/keyboard-shortcuts.ts
msgid "Toggle the left file sidebar."
diff --git a/packages/app/src/locales/zh-Hans/messages.json b/packages/app/src/locales/zh-Hans/messages.json
index 5b3f4dfb6..c8088203a 100644
--- a/packages/app/src/locales/zh-Hans/messages.json
+++ b/packages/app/src/locales/zh-Hans/messages.json
@@ -6,6 +6,7 @@
"-5jISU": [["0", "plural", { "other": ["#", " 个模板"] }]],
"-7s4fw": ["搜索智能体"],
"-8PP0T": ["区分大小写"],
+ "-Al4WQ": ["显示或隐藏 Terminal"],
"-FeyRg": ["保留原文件"],
"-K0AvT": ["断开连接"],
"-LHLx7": ["已编辑模板"],
@@ -172,6 +173,7 @@
"2RnFoM": ["无法恢复此对话:", ["0"]],
"2Snes1": ["这会把链接地址发送到你的电脑之外"],
"2UgoBZ": ["已消失"],
+ "2VSPan": ["已关闭 Terminal,为智能体面板腾出空间。"],
"2XQ8Ww": ["智能体编辑时打开预览"],
"2YOwme": ["已重启——现在运行的是 v", ["appRuntime"], "。"],
"2YZwPB": ["出链响应的结构与预期不符。"],
@@ -609,6 +611,7 @@
"9uI_rE": ["撤销"],
"9uRLEH": ["无法打开“", ["name"], "”——它还不在项目的技能里。"],
"9wQrUU": ["重构"],
+ "9xCnv8": ["隐藏 Terminal"],
"9zb2WA": ["正在连接"],
"A1taO8": ["搜索"],
"A50vr3": ["只能使用小写字母、数字和 <0>-</0>。"],
@@ -1168,6 +1171,7 @@
"KDuPiY": ["正在上传 ", ["fileName"]],
"KDw4GX": ["重试"],
"KFd4xz": ["不存在"],
+ "KGF42E": ["为保持 Terminal 清晰可读,已关闭智能体面板。"],
"KGJb9_": ["冲突"],
"KH5bQi": ["正在使用 <0>OK_EMBEDDINGS_API_KEY</0> 环境变量(在 OpenKnowledge 之外管理)。"],
"KIIamL": [
@@ -1312,6 +1316,7 @@
"符号链接是指向来源文件夹的指针,而不是独立的文件夹。每个位置读取的都是完全相同的字节,因此不会产生偏差;来源一旦被删除,该位置就会失效。"
],
"MTs6g3": ["服务器重启后无法重新连接"],
+ "MU_NVW": ["收起 Terminal"],
"MUrVEo": ["没有最近的项目。"],
"MV-Dkb": ["找到 ", ["countDisplay"], " 个 markdown 文件"],
"MVxpbf": ["查找并替换"],
@@ -1373,7 +1378,6 @@
"NRSLBe": [["diffMin"], " 分钟前"],
"NSnIUP": ["双页(偶数)"],
"NUr4kz": ["这个文件夹中新文档可复用的起点。"],
- "NUw7lo": ["显示或隐藏底部面板,终端就在那里。"],
"NYUhy5": ["子文件夹名"],
"NYn1cR": ["正在加载编辑器"],
"NYu2Pt": ["新建项目…"],
@@ -1527,6 +1531,7 @@
],
"PrJYSN": ["这个文件夹还不在 GitHub 上。在推送之前链接不会生效。"],
"PrVaZo": ["要卸载 OpenKnowledge 吗?"],
+ "PrWQiT": ["将 Terminal 移到右侧"],
"PrhzDE": ["向上平移"],
"Q-DKvr": ["从 ", ["source"], " 安装"],
"Q1mtyd": ["隐藏侧边栏"],
@@ -1648,6 +1653,7 @@
"S9Vnum": ["移除 ", ["patternText"]],
"S9t1PI": ["正在修复 ", ["0"], "/", ["1"]],
"SCoBBH": ["标签建议"],
+ "SCveu1": ["在当前停靠位置显示或隐藏 Terminal。"],
"SCzAbA": [["phase"], " — ", ["pct"], "%"],
"SF9qpO": ["留下你的邮箱以便我们跟进"],
"SFEWV6": ["无法加载 OpenKnowledge 技能。请重试。"],
@@ -1711,6 +1717,7 @@
"TiPvBP": ["选择颜色"],
"Tjc1pH": ["章节 <0>(可选的标题锚点)</0>"],
"Tn5sik": ["告诉智能体什么时候该用这个技能。之后可以再修改。"],
+ "Tofsyo": ["将 Terminal 移到底部"],
"Tq3pcs": ["保留我的"],
"Tq9kNX": ["没有打开的对话。重新打开之前的对话,或使用 + 按钮开始新对话。"],
"TsZmgr": ["磁盘上的文件,以及智能体使用的 id。"],
@@ -1901,7 +1908,6 @@
"Wh0im4": ["正在编辑 [[", ["realCurrentDoc"], "]]"],
"WhOsNE": ["删除线"],
"Wi-VWy": ["无法发送报告"],
- "WiGqD8": ["显示底部面板"],
"WkTLN7": ["只显示 markdown 文件"],
"WkyP2p": ["技能区"],
"WmPbvm": ["把产品动态发到你的邮箱。"],
@@ -2008,7 +2014,6 @@
"YJPN3F": ["太慢了"],
"YKLP_-": ["模板已重命名"],
"YLMBSd": ["例如:粘贴一个很大的表格后编辑器卡住了"],
- "YM5oO0": ["显示或隐藏底部面板"],
"YMlS7s": ["用默认应用打开"],
"YPFBfr": [["detail"], " - ", ["kind"], "“", ["createdPath"], "”在磁盘上仍然存在"],
"YRavYS": ["个人配色主题选择器——不与你的项目共享。开启后会出现在侧边栏的「插件」下。"],
@@ -2510,6 +2515,7 @@
["descriptorLabel"],
"> 渲染失败(很可能是属性有误)。复制源码看看哪里出了问题,或删除这个块。"
],
+ "g5V4_P": ["收起智能体面板"],
"g5w1sF": [
"选择一个文件夹,把它合并进 ",
["display"],
@@ -2739,6 +2745,7 @@
"jZ_E5M": ["获取失败——详情请查看服务器日志。"],
"j_Z6g7": ["共享的默认值"],
"jbSG8V": ["显示「文件」(", ["sidebarShortcutLabel"], ")"],
+ "jcEoUi": ["移到右侧面板"],
"jdGUeI": ["无法创建模板:", ["error"]],
"jeCFV7": ["移动到右侧新窗格"],
"jeJexw": ["无法完成 ", ["0"], " 的安装——详见下方。"],
@@ -3045,7 +3052,6 @@
"o0bHtA": ["来自 OpenKnowledge"],
"o2yoFu": ["在访达中显示,无工作区"],
"o49mDZ": ["正在加载时间线历史"],
- "o5jB-D": ["折叠面板"],
"o9CrsQ": ["research-note"],
"o9fPtM": ["从来源自动更新"],
"oAFVKX": ["更新项目同步默认值失败——", ["detail"]],
@@ -3104,7 +3110,6 @@
"pAgkuZ": ["正在用全新的本地协作缓存重新打开“", ["docName"], "”。"],
"pBROkv": ["感谢订阅。请留意你的邮箱,我们会发送产品动态。"],
"pCralD": ["移动到左侧新窗格"],
- "pDD2Hm": ["隐藏底部面板"],
"pEQFsW": ["没有匹配的项目。"],
"pFPzHA": ["表情符号选择器"],
"pFRz_E": ["不要把这些评论放进这条消息"],
@@ -3586,6 +3591,7 @@
"xeXS4P": ["或者使用入门包"],
"xeiujy": ["文本"],
"xhlFsx": ["继承而来——在这里设一个值即可覆盖它。"],
+ "xi9KGG": ["显示 Terminal"],
"xiv-dW": ["还没有文件。"],
"xlQpTE": ["更多拒绝选项"],
"xloBjn": ["相对路径"],
diff --git a/packages/app/src/locales/zh-Hans/messages.po b/packages/app/src/locales/zh-Hans/messages.po
index 3296bfbc0..974d27290 100644
--- a/packages/app/src/locales/zh-Hans/messages.po
+++ b/packages/app/src/locales/zh-Hans/messages.po
@@ -1365,6 +1365,10 @@ msgstr "智能体配置文件"
msgid "Agent mode"
msgstr "智能体模式"
+#: src/components/EditorArea.tsx
+msgid "Agent panel closed to keep Terminal readable."
+msgstr "为保持 Terminal 清晰可读,已关闭智能体面板。"
+
#: src/components/acp/ThreadView.tsx
msgid "Agent settings"
msgstr "智能体设置"
@@ -2496,6 +2500,10 @@ msgstr "折叠"
msgid "Collapse {keyName}"
msgstr "折叠 {keyName}"
+#: src/components/TerminalTabStrip.tsx
+msgid "Collapse agent panel"
+msgstr "收起智能体面板"
+
#: src/components/AppMenubar.tsx
#: src/components/command-palette-commands.ts
#: src/components/FileSidebar.tsx
@@ -2520,8 +2528,8 @@ msgid "Collapse graph"
msgstr "折叠关系图"
#: src/components/TerminalTabStrip.tsx
-msgid "Collapse panel"
-msgstr "折叠面板"
+msgid "Collapse Terminal"
+msgstr "收起 Terminal"
#: src/editor/slash-command/component-items.tsx
msgid "Collapsible content block (Notion-style toggle)."
@@ -5738,10 +5746,6 @@ msgstr "隐藏高级选项"
msgid "Hide Agents"
msgstr "隐藏「智能体」"
-#: src/components/command-palette-commands.ts
-msgid "Hide Bottom Dock"
-msgstr "隐藏底部面板"
-
#: src/components/acp/ThreadView.tsx
msgid "Hide details"
msgstr "隐藏详情"
@@ -5816,6 +5820,10 @@ msgstr "隐藏选区预览"
msgid "Hide sidebar"
msgstr "隐藏侧边栏"
+#: src/components/command-palette-commands.ts
+msgid "Hide Terminal"
+msgstr "隐藏 Terminal"
+
#: src/comments/comment-chips.tsx
msgid "Hide these comments"
msgstr "隐藏这些评论"
@@ -7019,6 +7027,16 @@ msgstr "在技能内部移动或重命名这个文件——路径仍保持在 re
msgid "Move succeeded but the sidebar may be out of date — refresh to resync"
msgstr "移动成功,但侧边栏可能不是最新的——请刷新以重新同步"
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to bottom"
+msgstr "将 Terminal 移到底部"
+
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to right"
+msgstr "将 Terminal 移到右侧"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move the current block up or down one position."
msgstr "把当前块上移或下移一个位置。"
@@ -7054,6 +7072,10 @@ msgstr "移动到左侧新窗格"
msgid "Move to new pane right"
msgstr "移动到右侧新窗格"
+#: src/components/TerminalTabStrip.tsx
+msgid "Move to right panel"
+msgstr "移到右侧面板"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move to the next CodeMirror lint diagnostic."
msgstr "跳到 CodeMirror 的下一条检查诊断。"
@@ -10594,10 +10616,6 @@ msgstr "显示「智能体」"
msgid "Show All"
msgstr "显示全部"
-#: src/components/command-palette-commands.ts
-msgid "Show Bottom Dock"
-msgstr "显示底部面板"
-
#: src/components/acp/ThreadView.tsx
msgid "Show details"
msgstr "显示详情"
@@ -10665,10 +10683,6 @@ msgstr "只显示 markdown 文件"
msgid "Show or hide agents"
msgstr "显示或隐藏智能体"
-#: src/lib/keyboard-shortcuts.ts
-msgid "Show or hide bottom dock"
-msgstr "显示或隐藏底部面板"
-
#: src/lib/keyboard-shortcuts.ts
msgid "Show or hide document panel"
msgstr "显示或隐藏文档面板"
@@ -10677,6 +10691,10 @@ msgstr "显示或隐藏文档面板"
msgid "Show or hide Files"
msgstr "显示或隐藏「文件」"
+#: src/lib/keyboard-shortcuts.ts
+msgid "Show or hide Terminal"
+msgstr "显示或隐藏 Terminal"
+
#: src/components/AgentDiffPane.tsx
#: src/components/EditorToolbar.tsx
#: src/components/TimelineDiffPane.tsx
@@ -10717,6 +10735,10 @@ msgstr "显示侧边栏"
msgid "Show source"
msgstr "显示源码"
+#: src/components/command-palette-commands.ts
+msgid "Show Terminal"
+msgstr "显示 Terminal"
+
#: src/comments/comment-chips.tsx
msgid "Show these comments"
msgstr "显示这些评论"
@@ -11540,6 +11562,10 @@ msgstr "终端 {0}"
msgid "Terminal access isn't enabled for this project."
msgstr "这个项目没有启用终端访问。"
+#: src/components/EditorArea.tsx
+msgid "Terminal closed to make room for the agent panel."
+msgstr "已关闭 Terminal,为智能体面板腾出空间。"
+
#: src/components/TerminalGate.tsx
msgid "Terminal disabled"
msgstr "终端已禁用"
@@ -12285,8 +12311,8 @@ msgid "Toggle strikethrough formatting."
msgstr "切换删除线格式。"
#: src/lib/keyboard-shortcuts.ts
-msgid "Toggle the bottom dock, where the terminal lives."
-msgstr "显示或隐藏底部面板,终端就在那里。"
+msgid "Toggle Terminal in its current dock."
+msgstr "在当前停靠位置显示或隐藏 Terminal。"
#: src/lib/keyboard-shortcuts.ts
msgid "Toggle the left file sidebar."
diff --git a/packages/app/src/locales/zh-Hant/messages.json b/packages/app/src/locales/zh-Hant/messages.json
index 6e414ca49..805cb6a4d 100644
--- a/packages/app/src/locales/zh-Hant/messages.json
+++ b/packages/app/src/locales/zh-Hant/messages.json
@@ -6,6 +6,7 @@
"-5jISU": [["0", "plural", { "other": ["#", " 個範本"] }]],
"-7s4fw": ["搜尋代理"],
"-8PP0T": ["區分大小寫"],
+ "-Al4WQ": ["顯示或隱藏 Terminal"],
"-FeyRg": ["保留原始檔案"],
"-K0AvT": ["中斷連接"],
"-LHLx7": ["已編輯範本"],
@@ -174,6 +175,7 @@
"2RnFoM": ["無法恢復此對話:", ["0"]],
"2Snes1": ["這會把連結的網址送出你的電腦"],
"2UgoBZ": ["已不存在"],
+ "2VSPan": ["已關閉 Terminal,為智慧代理面板騰出空間。"],
"2XQ8Ww": ["代理編輯時開啟預覽"],
"2YOwme": ["已重新啟動——現在執行的是 v", ["appRuntime"], "。"],
"2YZwPB": ["外連連結回應的結構與預期不符。"],
@@ -611,6 +613,7 @@
"9uI_rE": ["復原"],
"9uRLEH": ["無法開啟「", ["name"], "」——它還不在這個專案的技能裡。"],
"9wQrUU": ["重構"],
+ "9xCnv8": ["隱藏 Terminal"],
"9zb2WA": ["正在連線"],
"A1taO8": ["搜尋"],
"A50vr3": ["只能用小寫字母、數字和 <0>-</0>。"],
@@ -1178,6 +1181,7 @@
"KDuPiY": ["正在上傳 ", ["fileName"]],
"KDw4GX": ["再試一次"],
"KFd4xz": ["不存在"],
+ "KGF42E": ["為保持 Terminal 清晰可讀,已關閉智慧代理面板。"],
"KGJb9_": ["衝突"],
"KH5bQi": ["正在使用 <0>OK_EMBEDDINGS_API_KEY</0> 環境變數(在 OpenKnowledge 之外管理)。"],
"KIIamL": [
@@ -1332,6 +1336,7 @@
"符號連結是指向來源資料夾的指標,而不是自己獨立的資料夾。每個位置讀到的都是完全相同的位元組,因此不會產生偏差;來源一旦被刪除,該位置就會失效。"
],
"MTs6g3": ["伺服器重新啟動後無法重新連線"],
+ "MU_NVW": ["收合 Terminal"],
"MUrVEo": ["沒有最近的專案。"],
"MV-Dkb": ["找到 ", ["countDisplay"], " 個 markdown 檔案"],
"MVxpbf": ["尋找並取代"],
@@ -1393,7 +1398,6 @@
"NRSLBe": [["diffMin"], " 分鐘前"],
"NSnIUP": ["雙頁(偶數)"],
"NUr4kz": ["這個資料夾中新文件可重複使用的起點。"],
- "NUw7lo": ["顯示或隱藏底部面板,終端機就在那裡。"],
"NYUhy5": ["子資料夾名稱"],
"NYn1cR": ["正在載入編輯器"],
"NYu2Pt": ["新增專案…"],
@@ -1547,6 +1551,7 @@
],
"PrJYSN": ["這個資料夾還不在 GitHub 上。在推送之前連結不會生效。"],
"PrVaZo": ["要解除安裝 OpenKnowledge 嗎?"],
+ "PrWQiT": ["將 Terminal 移到右側"],
"PrhzDE": ["向上平移"],
"Q-DKvr": ["從 ", ["source"], " 安裝"],
"Q1mtyd": ["隱藏側邊欄"],
@@ -1668,6 +1673,7 @@
"S9Vnum": ["移除 ", ["patternText"]],
"S9t1PI": ["正在修正 ", ["0"], "/", ["1"]],
"SCoBBH": ["標籤建議"],
+ "SCveu1": ["在目前的停靠位置顯示或隱藏 Terminal。"],
"SCzAbA": [["phase"], " — ", ["pct"], "%"],
"SF9qpO": ["留下你的電子郵件以便我們跟進"],
"SFEWV6": ["無法載入 OpenKnowledge 技能。請再試一次。"],
@@ -1731,6 +1737,7 @@
"TiPvBP": ["選擇顏色"],
"Tjc1pH": ["章節 <0>(選填的標題錨點)</0>"],
"Tn5sik": ["告訴代理什麼時候該用這個技能。之後還可以再改。"],
+ "Tofsyo": ["將 Terminal 移到底部"],
"Tq3pcs": ["保留我的"],
"Tq9kNX": ["沒有開啟的對話。重新開啟先前的對話,或使用 + 按鈕開始新對話。"],
"TsZmgr": ["磁碟上的檔案,以及代理使用的 id。"],
@@ -1923,7 +1930,6 @@
"Wh0im4": ["正在編輯 [[", ["realCurrentDoc"], "]]"],
"WhOsNE": ["刪除線"],
"Wi-VWy": ["無法送出回報"],
- "WiGqD8": ["顯示底部面板"],
"WkTLN7": ["只顯示 markdown 檔案"],
"WkyP2p": ["技能區"],
"WmPbvm": ["把產品動態寄到你的信箱。"],
@@ -2030,7 +2036,6 @@
"YJPN3F": ["太慢了"],
"YKLP_-": ["範本已重新命名"],
"YLMBSd": ["例如:貼上一個很大的表格之後編輯器卡住了"],
- "YM5oO0": ["顯示或隱藏底部面板"],
"YMlS7s": ["用預設應用程式打開"],
"YPFBfr": [["detail"], " - ", ["kind"], "「", ["createdPath"], "」在磁碟上仍然存在"],
"YRavYS": ["個人配色主題選擇器——不會和你的專案共享。開啟後會出現在側邊欄的「外掛」下。"],
@@ -2530,6 +2535,7 @@
["descriptorLabel"],
"> 顯示失敗(很可能是屬性有誤)。複製原始碼看看哪裡出了問題,或刪除這個區塊。"
],
+ "g5V4_P": ["收合智慧代理面板"],
"g5w1sF": [
"挑一個資料夾,把它併進 ",
["display"],
@@ -2763,6 +2769,7 @@
"jZ_E5M": ["取得失敗——詳情請看伺服器記錄。"],
"j_Z6g7": ["分享的預設值"],
"jbSG8V": ["顯示「檔案」(", ["sidebarShortcutLabel"], ")"],
+ "jcEoUi": ["移到右側面板"],
"jdGUeI": ["無法建立範本:", ["error"]],
"jeCFV7": ["移動到右側新窗格"],
"jeJexw": ["無法完成 ", ["0"], " 的安裝——詳見下方。"],
@@ -3071,7 +3078,6 @@
"o0bHtA": ["由 OpenKnowledge 提供"],
"o2yoFu": ["在 Finder 中顯示,沒有工作區"],
"o49mDZ": ["正在載入時間軸記錄"],
- "o5jB-D": ["摺疊面板"],
"o9CrsQ": ["research-note"],
"o9fPtM": ["從來源自動更新"],
"oAFVKX": ["更新專案同步預設值失敗——", ["detail"]],
@@ -3130,7 +3136,6 @@
"pAgkuZ": ["正在用全新的本機協作快取重新開啟「", ["docName"], "」。"],
"pBROkv": ["謝謝訂閱。請留意你的信箱,我們會寄出產品動態。"],
"pCralD": ["移動到左側新窗格"],
- "pDD2Hm": ["隱藏底部面板"],
"pEQFsW": ["沒有相符的專案。"],
"pFPzHA": ["表情符號選擇器"],
"pFRz_E": ["不要把這些註解放進這則訊息"],
@@ -3616,6 +3621,7 @@
"xeXS4P": ["或者用入門套件"],
"xeiujy": ["文字"],
"xhlFsx": ["繼承而來——在這裡設一個值就能取代它。"],
+ "xi9KGG": ["顯示 Terminal"],
"xiv-dW": ["還沒有檔案。"],
"xlQpTE": ["更多拒絕選項"],
"xloBjn": ["相對路徑"],
diff --git a/packages/app/src/locales/zh-Hant/messages.po b/packages/app/src/locales/zh-Hant/messages.po
index 72eed422e..cbb5b31ba 100644
--- a/packages/app/src/locales/zh-Hant/messages.po
+++ b/packages/app/src/locales/zh-Hant/messages.po
@@ -1365,6 +1365,10 @@ msgstr "代理設定檔"
msgid "Agent mode"
msgstr "代理模式"
+#: src/components/EditorArea.tsx
+msgid "Agent panel closed to keep Terminal readable."
+msgstr "為保持 Terminal 清晰可讀,已關閉智慧代理面板。"
+
#: src/components/acp/ThreadView.tsx
msgid "Agent settings"
msgstr "代理設定"
@@ -2496,6 +2500,10 @@ msgstr "摺疊"
msgid "Collapse {keyName}"
msgstr "摺疊 {keyName}"
+#: src/components/TerminalTabStrip.tsx
+msgid "Collapse agent panel"
+msgstr "收合智慧代理面板"
+
#: src/components/AppMenubar.tsx
#: src/components/command-palette-commands.ts
#: src/components/FileSidebar.tsx
@@ -2520,8 +2528,8 @@ msgid "Collapse graph"
msgstr "摺疊關係圖"
#: src/components/TerminalTabStrip.tsx
-msgid "Collapse panel"
-msgstr "摺疊面板"
+msgid "Collapse Terminal"
+msgstr "收合 Terminal"
#: src/editor/slash-command/component-items.tsx
msgid "Collapsible content block (Notion-style toggle)."
@@ -5738,10 +5746,6 @@ msgstr "隱藏進階選項"
msgid "Hide Agents"
msgstr "隱藏「代理」"
-#: src/components/command-palette-commands.ts
-msgid "Hide Bottom Dock"
-msgstr "隱藏底部面板"
-
#: src/components/acp/ThreadView.tsx
msgid "Hide details"
msgstr "隱藏詳細資料"
@@ -5816,6 +5820,10 @@ msgstr "隱藏選取範圍預覽"
msgid "Hide sidebar"
msgstr "隱藏側邊欄"
+#: src/components/command-palette-commands.ts
+msgid "Hide Terminal"
+msgstr "隱藏 Terminal"
+
#: src/comments/comment-chips.tsx
msgid "Hide these comments"
msgstr "隱藏這些註解"
@@ -7019,6 +7027,16 @@ msgstr "在技能內部移動或重新命名這個檔案——路徑仍會留在
msgid "Move succeeded but the sidebar may be out of date — refresh to resync"
msgstr "移動成功,但側邊欄可能不是最新的——請重新整理以重新同步"
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to bottom"
+msgstr "將 Terminal 移到底部"
+
+#: src/components/command-palette-commands.ts
+#: src/components/TerminalTabStrip.tsx
+msgid "Move Terminal to right"
+msgstr "將 Terminal 移到右側"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move the current block up or down one position."
msgstr "把目前的區塊往上或往下移一個位置。"
@@ -7054,6 +7072,10 @@ msgstr "移動到左側新窗格"
msgid "Move to new pane right"
msgstr "移動到右側新窗格"
+#: src/components/TerminalTabStrip.tsx
+msgid "Move to right panel"
+msgstr "移到右側面板"
+
#: src/lib/keyboard-shortcuts.ts
msgid "Move to the next CodeMirror lint diagnostic."
msgstr "跳到 CodeMirror 的下一則檢查診斷。"
@@ -10594,10 +10616,6 @@ msgstr "顯示「代理」"
msgid "Show All"
msgstr "顯示全部"
-#: src/components/command-palette-commands.ts
-msgid "Show Bottom Dock"
-msgstr "顯示底部面板"
-
#: src/components/acp/ThreadView.tsx
msgid "Show details"
msgstr "顯示詳細資料"
@@ -10665,10 +10683,6 @@ msgstr "只顯示 markdown 檔案"
msgid "Show or hide agents"
msgstr "顯示或隱藏代理"
-#: src/lib/keyboard-shortcuts.ts
-msgid "Show or hide bottom dock"
-msgstr "顯示或隱藏底部面板"
-
#: src/lib/keyboard-shortcuts.ts
msgid "Show or hide document panel"
msgstr "顯示或隱藏文件面板"
@@ -10677,6 +10691,10 @@ msgstr "顯示或隱藏文件面板"
msgid "Show or hide Files"
msgstr "顯示或隱藏「檔案」"
+#: src/lib/keyboard-shortcuts.ts
+msgid "Show or hide Terminal"
+msgstr "顯示或隱藏 Terminal"
+
#: src/components/AgentDiffPane.tsx
#: src/components/EditorToolbar.tsx
#: src/components/TimelineDiffPane.tsx
@@ -10717,6 +10735,10 @@ msgstr "顯示側邊欄"
msgid "Show source"
msgstr "顯示原始碼"
+#: src/components/command-palette-commands.ts
+msgid "Show Terminal"
+msgstr "顯示 Terminal"
+
#: src/comments/comment-chips.tsx
msgid "Show these comments"
msgstr "顯示這些註解"
@@ -11540,6 +11562,10 @@ msgstr "終端機 {0}"
msgid "Terminal access isn't enabled for this project."
msgstr "這個專案沒有啟用終端機存取。"
+#: src/components/EditorArea.tsx
+msgid "Terminal closed to make room for the agent panel."
+msgstr "已關閉 Terminal,為智慧代理面板騰出空間。"
+
#: src/components/TerminalGate.tsx
msgid "Terminal disabled"
msgstr "終端機已停用"
@@ -12285,8 +12311,8 @@ msgid "Toggle strikethrough formatting."
msgstr "切換刪除線格式。"
#: src/lib/keyboard-shortcuts.ts
-msgid "Toggle the bottom dock, where the terminal lives."
-msgstr "顯示或隱藏底部面板,終端機就在那裡。"
+msgid "Toggle Terminal in its current dock."
+msgstr "在目前的停靠位置顯示或隱藏 Terminal。"
#: src/lib/keyboard-shortcuts.ts
msgid "Toggle the left file sidebar."
diff --git a/packages/app/tests/stress/fixtures/handoff-mocks.ts b/packages/app/tests/stress/fixtures/handoff-mocks.ts
index 3d8c1982f..0e0c11e7a 100644
--- a/packages/app/tests/stress/fixtures/handoff-mocks.ts
+++ b/packages/app/tests/stress/fixtures/handoff-mocks.ts
@@ -627,7 +627,7 @@ export async function installHandoffMocks(page: Page, cfg: HandoffMockConfig): P
setMeta: () => {},
setOrder: () => {},
getDockState: async () => ({ terminalVisible: false, agentPanelVisible: false }),
- setDockState: () => {},
+ setDockState: async () => ({ ok: true as const }),
onData: () => () => {},
onExit: () => () => {},
claudePreflight: async () => ({ claude: 'present' as const, mcp: 'wired' as const }),
diff --git a/packages/app/tests/stress/qa-sidebar-responsive.e2e.ts b/packages/app/tests/stress/qa-sidebar-responsive.e2e.ts
index 8395e0f0e..7f8499739 100644
--- a/packages/app/tests/stress/qa-sidebar-responsive.e2e.ts
+++ b/packages/app/tests/stress/qa-sidebar-responsive.e2e.ts
@@ -239,13 +239,10 @@ test.describe('non-embedded UA', () => {
await page.goto('/#/qa-doc-handle-collapse');
await waitForActiveProviderSynced(page);
- // The sessions dock's bottom shell renders on every host now, so its
- // (disabled, horizontal) handle coexists with the doc-panel handle.
- // The doc panel's is the only VERTICAL separator while the right dock
- // column is hidden, so scope by orientation.
- const docPanelHandle = page.locator(
- '[data-slot="resizable-handle"][aria-orientation="vertical"]',
- );
+ // The permanent right-rail topology keeps hidden terminal and agent handles
+ // in the DOM, so scope to the document panel's explicit hook rather than
+ // counting every vertical separator.
+ const docPanelHandle = page.locator('[data-doc-panel-handle]');
await expect(docPanelHandle).toHaveCount(1);
// Expanded (default at WIDE): interactive — focusable and not disabled.
diff --git a/packages/core/src/commands/command-identity.test.ts b/packages/core/src/commands/command-identity.test.ts
index fc3f2f83e..b48a3d6f7 100644
--- a/packages/core/src/commands/command-identity.test.ts
+++ b/packages/core/src/commands/command-identity.test.ts
@@ -11,6 +11,7 @@ function ctx(overrides: Partial<CommandContext> = {}): CommandContext {
host: 'desktop',
activeTargetKind: 'doc',
singleFile: false,
+ terminalCapable: true,
terminalLive: false,
canExpandAll: true,
canCollapseAll: true,
@@ -76,6 +77,21 @@ describe('evaluateCommandAvailability', () => {
).toBe(false);
});
+ test('requiresTerminalCapability gates on actual PTY support', () => {
+ expect(
+ evaluateCommandAvailability(
+ { requiresTerminalCapability: true },
+ ctx({ terminalCapable: false }),
+ ),
+ ).toBe(false);
+ expect(
+ evaluateCommandAvailability(
+ { requiresTerminalCapability: true },
+ ctx({ terminalCapable: true }),
+ ),
+ ).toBe(true);
+ });
+
// Real commands combine gates (e.g. rename is host:desktop + requiresTargetKinds).
// Pin the multi-gate path so a reorder or short-circuit interaction can't pass.
test('compound gates: host AND target-kind must both pass', () => {
@@ -93,6 +109,19 @@ describe('evaluateCommandAvailability', () => {
});
describe('COMMAND_IDENTITIES registry invariants', () => {
+ test('every PTY-backed palette command declares the terminal capability gate', () => {
+ const gatedIds = COMMAND_IDENTITIES.filter(
+ (command) => command.palette && command.availability.requiresTerminalCapability,
+ ).map((command) => command.id);
+
+ expect(gatedIds).toEqual(['toggle-terminal', 'new-terminal', 'move-terminal', 'kill-terminal']);
+ });
+
+ test('the menu-only terminal window command declares the terminal capability gate', () => {
+ const command = COMMAND_IDENTITIES.find((entry) => entry.id === 'new-terminal-window');
+ expect(command?.availability.requiresTerminalCapability).toBe(true);
+ });
+
test('command ids are unique', () => {
const ids = COMMAND_IDENTITIES.map((c) => c.id);
expect(new Set(ids).size).toBe(ids.length);
@@ -111,12 +140,16 @@ describe('COMMAND_IDENTITIES registry invariants', () => {
}
});
- test('every menu placement labelKey / stateToggle key resolves in MENU_LABELS', () => {
+ test('every menu placement and dynamic label key resolves in MENU_LABELS', () => {
for (const cmd of COMMAND_IDENTITIES) {
if (cmd.stateToggle) {
expect(MENU_LABELS[cmd.stateToggle.showKey]).toBeDefined();
expect(MENU_LABELS[cmd.stateToggle.hideKey]).toBeDefined();
}
+ if (cmd.placementToggle) {
+ expect(MENU_LABELS[cmd.placementToggle.bottomKey]).toBeDefined();
+ expect(MENU_LABELS[cmd.placementToggle.rightKey]).toBeDefined();
+ }
for (const placement of cmd.menu ?? []) {
if (placement.menuLabelKey) expect(MENU_LABELS[placement.menuLabelKey]).toBeDefined();
// A menu leaf must resolve to SOME label: an explicit literal, a menu
@@ -125,6 +158,7 @@ describe('COMMAND_IDENTITIES registry invariants', () => {
placement.menuLabelText !== undefined ||
placement.menuLabelKey !== undefined ||
cmd.stateToggle !== undefined ||
+ cmd.placementToggle !== undefined ||
cmd.labelKey !== undefined;
expect({ id: cmd.id, resolvable }).toEqual({ id: cmd.id, resolvable: true });
}
diff --git a/packages/core/src/commands/command-identity.ts b/packages/core/src/commands/command-identity.ts
index 1d1b1d25f..5cc6a8625 100644
--- a/packages/core/src/commands/command-identity.ts
+++ b/packages/core/src/commands/command-identity.ts
@@ -50,6 +50,8 @@ export interface CommandAvailabilitySpec {
readonly requiresTargetKinds?: readonly ContextualTargetKind[];
/** Hidden in a no-project single-file session. */
readonly singleFileHidden?: boolean;
+ /** Requires the current surface to expose working PTY support. */
+ readonly requiresTerminalCapability?: boolean;
/** Requires a live (mounted) terminal session. */
readonly requiresTerminalLive?: boolean;
/** Requires an expandable tree (smart-hide when everything is expanded). */
@@ -73,6 +75,7 @@ export interface CommandContext {
readonly host: 'desktop' | 'web';
readonly activeTargetKind: ContextualTargetKind;
readonly singleFile: boolean;
+ readonly terminalCapable: boolean;
readonly terminalLive: boolean;
readonly canExpandAll: boolean;
readonly canCollapseAll: boolean;
@@ -87,6 +90,7 @@ export function evaluateCommandAvailability(
): boolean {
if (spec.host === 'desktop' && ctx.host !== 'desktop') return false;
if (spec.singleFileHidden && ctx.singleFile) return false;
+ if (spec.requiresTerminalCapability && !ctx.terminalCapable) return false;
if (spec.requiresTerminalLive && !ctx.terminalLive) return false;
if (spec.requiresCanExpandAll && !ctx.canExpandAll) return false;
if (spec.requiresCanCollapseAll && !ctx.canCollapseAll) return false;
@@ -190,6 +194,12 @@ export interface CommandStateToggle {
readonly overrideField?: 'hasEditorSelection';
}
+/** Terminal-placement labels (one row whose destination flips with its current home). */
+interface CommandPlacementToggle {
+ readonly bottomKey: MenuLabelKey;
+ readonly rightKey: MenuLabelKey;
+}
+
/** View-menu-state checkbox field a command's check indicator reads. */
export type CommandCheckField =
| 'showHiddenFiles'
@@ -223,6 +233,8 @@ export interface CommandIdentity {
readonly shortcutDesktopOnly?: boolean;
/** Show/Hide toggle metadata (sidebar / document panel / terminal). */
readonly stateToggle?: CommandStateToggle;
+ /** Terminal placement metadata (bottom means offer right, and vice versa). */
+ readonly placementToggle?: CommandPlacementToggle;
/** Checkbox check-state field (palette check indicator + menu checked source). */
readonly checkField?: CommandCheckField;
readonly availability: CommandAvailabilitySpec;
@@ -590,17 +602,12 @@ export const COMMAND_IDENTITIES: readonly CommandIdentity[] = [
id: 'toggle-terminal',
menuActionId: 'toggle-terminal',
labelKey: 'terminalShow',
- // The label says "Bottom Dock", not "terminal", so the terminal words have
- // to live here or ⌘K search for the thing in the dock stops finding the
- // dock. `matchesCommandQuery` substring-matches the query against
- // label+keywords JOINED, so a multi-word query only hits a contiguous run:
- // the phrases below are what keep "show terminal" / "hide terminal" queries
- // working and admit Zed's own name for the command.
keywords: [
'terminal',
'shell',
'console',
'panel',
+ 'toggle terminal',
'toggle bottom dock',
'show terminal',
'hide terminal',
@@ -612,7 +619,7 @@ export const COMMAND_IDENTITIES: readonly CommandIdentity[] = [
stateField: 'terminalVisible',
defaultVisible: false,
},
- availability: { host: 'desktop' },
+ availability: { host: 'desktop', requiresTerminalCapability: true },
palette: { group: 'view', visibility: 'search-only' },
menu: [{ section: 'view-panels', order: 2, accelerator: 'CmdOrCtrl+J' }],
},
@@ -703,7 +710,7 @@ export const COMMAND_IDENTITIES: readonly CommandIdentity[] = [
menuActionId: 'new-terminal',
labelKey: 'newTerminal',
keywords: ['terminal', 'shell', 'new', 'tab'],
- availability: { host: 'desktop' },
+ availability: { host: 'desktop', requiresTerminalCapability: true },
palette: { group: 'terminal', visibility: 'search-only' },
menu: [{ section: 'terminal', order: 0 }],
},
@@ -711,17 +718,34 @@ export const COMMAND_IDENTITIES: readonly CommandIdentity[] = [
// Menu-only leaf; opens a dedicated terminal window in main (no renderer handler).
id: 'new-terminal-window',
keywords: [],
- availability: { host: 'desktop' },
+ availability: { host: 'desktop', requiresTerminalCapability: true },
menu: [{ section: 'terminal', order: 1, menuLabelText: 'New Terminal Window' }],
},
+ {
+ id: 'move-terminal',
+ menuActionId: 'move-terminal',
+ labelKey: 'terminalMoveRight',
+ keywords: ['terminal', 'move', 'dock', 'right', 'bottom', 'placement'],
+ placementToggle: {
+ bottomKey: 'terminalMoveRight',
+ rightKey: 'terminalMoveBottom',
+ },
+ availability: { host: 'desktop', requiresTerminalCapability: true },
+ palette: { group: 'terminal', visibility: 'search-only' },
+ menu: [{ section: 'terminal', order: 2 }],
+ },
{
id: 'kill-terminal',
menuActionId: 'kill-terminal',
labelKey: 'killTerminal',
keywords: ['terminal', 'kill', 'close', 'session'],
- availability: { host: 'desktop', requiresTerminalLive: true },
+ availability: {
+ host: 'desktop',
+ requiresTerminalCapability: true,
+ requiresTerminalLive: true,
+ },
palette: { group: 'terminal', visibility: 'search-only' },
- menu: [{ section: 'terminal', order: 2 }],
+ menu: [{ section: 'terminal', order: 3 }],
},
// ── Application group (palette) / App + Edit + Help (menu) ───────────────────
{
diff --git a/packages/core/src/constants/menu-labels.ts b/packages/core/src/constants/menu-labels.ts
index f86497d5c..c1b4cdf14 100644
--- a/packages/core/src/constants/menu-labels.ts
+++ b/packages/core/src/constants/menu-labels.ts
@@ -98,10 +98,10 @@ export const MENU_LABELS = {
docPanelHide: 'Hide document panel',
back: 'Back',
forward: 'Forward',
- // Named for the surface, not its contents: ⌘J toggles the bottom dock, which
- // currently hosts the terminal. The Terminal menu's own leaves stay terminal-named.
- terminalShow: 'Show Bottom Dock',
- terminalHide: 'Hide Bottom Dock',
+ terminalShow: 'Show Terminal',
+ terminalHide: 'Hide Terminal',
+ terminalMoveRight: 'Move Terminal to right',
+ terminalMoveBottom: 'Move Terminal to bottom',
agentPanelShow: 'Show Agents',
agentPanelHide: 'Hide Agents',
// ⌘L stages a selection rather than toggling when one exists, so the item
diff --git a/packages/core/src/desktop-bridge.ts b/packages/core/src/desktop-bridge.ts
index 1762055af..14f0ca958 100644
--- a/packages/core/src/desktop-bridge.ts
+++ b/packages/core/src/desktop-bridge.ts
@@ -37,10 +37,50 @@ import type {
ShareTargetStatusResponse,
} from './schemas/api/share.ts';
import type { RecentProjectEntry } from './sharing/index.ts';
+import type { TerminalPlacement } from './terminal-layout.ts';
export type { OkFolderState } from './constants/folder-state.ts';
export type { BridgeWorktreeEntry } from './git/worktree-list-parser.ts';
export type { RecentProjectEntry } from './sharing/index.ts';
+export type { TerminalPlacement } from './terminal-layout.ts';
+
+export interface OkTerminalRestartTab {
+ ordinal: number;
+ customLabel: string | null;
+}
+
+export interface OkTerminalRestartSnapshot {
+ tabs: OkTerminalRestartTab[];
+ activeOrdinal: number | null;
+}
+
+export interface OkTerminalDockState {
+ terminalVisible: boolean;
+ agentPanelVisible: boolean;
+ terminal?: { order: string[]; activeKey: string | null };
+ terminalSnapshot?: OkTerminalRestartSnapshot;
+ agents?: { order: string[]; activeKey: string | null };
+}
+
+export type OkTerminalDockStateUpdate =
+ | {
+ surface: 'terminal';
+ order: string[];
+ activeKey: string | null;
+ terminalSnapshot: OkTerminalRestartSnapshot;
+ }
+ | {
+ surface: 'agents';
+ order: string[];
+ activeKey: string | null;
+ };
+
+export type OkTerminalDockStateWriteResult =
+ | { ok: true }
+ | {
+ ok: false;
+ reason: 'invalid-request' | 'no-window-context' | 'persist-failed' | 'ipc-unavailable';
+ };
/** Render mode picked by the main process when creating a BrowserWindow. */
export type OkDesktopMode = 'editor' | 'navigator' | 'terminal';
@@ -128,6 +168,7 @@ export type OkMenuAction =
| 'collapse-all-tree'
| 'toggle-doc-panel'
| 'toggle-terminal'
+ | 'move-terminal'
// Right agents-panel visibility. Unlike the terminal, agent threads are
// server-hosted and the panel is available outside the desktop PTY host.
| 'toggle-agent-panel'
@@ -846,6 +887,7 @@ export interface OkEditorViewMenuStateSnapshot {
readonly sidebarVisible: boolean;
readonly docPanelVisible?: boolean;
readonly terminalVisible?: boolean;
+ readonly terminalPlacement?: TerminalPlacement;
readonly terminalLive?: boolean;
readonly agentPanelVisible?: boolean;
readonly canViewInSource?: boolean;
@@ -1800,7 +1842,7 @@ export interface OkDesktopBridge {
collapseAll(cb: () => void): OkUnsubscribe;
};
- /** Bottom-docked terminal panel surface. */
+ /** Docked terminal panel surface (bottom or right). */
terminal: {
create(opts: {
cols: number;
@@ -1827,18 +1869,9 @@ export interface OkDesktopBridge {
*/
setOrder(orderedPtyIds: readonly string[]): void;
/** Per-window state for the independent terminal and agents panels. */
- getDockState(): Promise<{
- terminalVisible: boolean;
- agentPanelVisible: boolean;
- terminal?: { order: string[]; activeKey: string | null };
- agents?: { order: string[]; activeKey: string | null };
- }>;
- /** Persist one panel's tab order and active key per window. */
- setDockState(state: {
- surface: 'terminal' | 'agents';
- order: string[];
- activeKey: string | null;
- }): void;
+ getDockState(): Promise<OkTerminalDockState>;
+ /** Persist one panel's session state per window and report durable-write failures. */
+ setDockState(state: OkTerminalDockStateUpdate): Promise<OkTerminalDockStateWriteResult>;
onData(cb: (msg: OkPtyData) => void): OkUnsubscribe;
onExit(cb: (msg: OkPtyExit) => void): OkUnsubscribe;
claudePreflight(): Promise<ClaudeReadiness>;
diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts
index 6b779f3fa..b15cd7d12 100644
--- a/packages/core/src/index.ts
+++ b/packages/core/src/index.ts
@@ -1725,6 +1725,19 @@ export {
type TemplateIdentity,
type TemplateModel,
} from './templates/template-format.ts';
+export {
+ DEFAULT_TERMINAL_PLACEMENT,
+ MIN_TERMINAL_RIGHT_WIDTH,
+ normalizeTerminalPlacement,
+ normalizeTerminalRightWidth,
+ PREFERRED_TERMINAL_RIGHT_WIDTH,
+ RIGHT_TERMINAL_CELL_WIDTH_PX,
+ RIGHT_TERMINAL_CHROME_WIDTH_PX,
+ RIGHT_TERMINAL_MIN_COLUMNS,
+ RIGHT_TERMINAL_PREFERRED_COLUMNS,
+ TERMINAL_PLACEMENTS,
+ type TerminalPlacement,
+} from './terminal-layout.ts';
// Types
export type { Actor, PrincipalId, SessionId } from './types/actor.ts';
export type {
diff --git a/packages/core/src/terminal-layout.test.ts b/packages/core/src/terminal-layout.test.ts
new file mode 100644
index 000000000..78abfda53
--- /dev/null
+++ b/packages/core/src/terminal-layout.test.ts
@@ -0,0 +1,42 @@
+import { describe, expect, test } from 'vitest';
+import {
+ MIN_TERMINAL_RIGHT_WIDTH,
+ normalizeTerminalRightWidth,
+ PREFERRED_TERMINAL_RIGHT_WIDTH,
+ RIGHT_TERMINAL_CELL_WIDTH_PX,
+ RIGHT_TERMINAL_CHROME_WIDTH_PX,
+} from './terminal-layout';
+
+const columnsIn = (width: number) =>
+ Math.floor((width - RIGHT_TERMINAL_CHROME_WIDTH_PX) / RIGHT_TERMINAL_CELL_WIDTH_PX);
+
+describe('terminal right-panel width contract', () => {
+ test('the preferred width preserves 92 columns plus xterm chrome', () => {
+ expect(PREFERRED_TERMINAL_RIGHT_WIDTH).toBe(740);
+ expect(columnsIn(PREFERRED_TERMINAL_RIGHT_WIDTH)).toBeGreaterThanOrEqual(92);
+ });
+
+ test('the drag floor sits at parity with the other rail columns', () => {
+ // Agents floor 320px, document pane 300px. The terminal is allowed to be
+ // narrower than its preferred width so the rail stays balanceable; a floor
+ // heavier than both peers combined is what made it unresizable.
+ expect(MIN_TERMINAL_RIGHT_WIDTH).toBe(324);
+ expect(MIN_TERMINAL_RIGHT_WIDTH).toBeLessThan(PREFERRED_TERMINAL_RIGHT_WIDTH);
+ });
+
+ test('an absent width opens at the preferred width, not the floor', () => {
+ expect(normalizeTerminalRightWidth(undefined)).toBe(PREFERRED_TERMINAL_RIGHT_WIDTH);
+ expect(normalizeTerminalRightWidth(Number.NaN)).toBe(PREFERRED_TERMINAL_RIGHT_WIDTH);
+ });
+
+ test('a width the user dragged narrow survives normalization', () => {
+ // The regression this guards: clamping every stored width up to the
+ // preferred width silently undid any narrow terminal on reload.
+ expect(normalizeTerminalRightWidth(420)).toBe(420);
+ expect(normalizeTerminalRightWidth(MIN_TERMINAL_RIGHT_WIDTH)).toBe(MIN_TERMINAL_RIGHT_WIDTH);
+ });
+
+ test('a width below the floor clamps up to it', () => {
+ expect(normalizeTerminalRightWidth(120)).toBe(MIN_TERMINAL_RIGHT_WIDTH);
+ });
+});
diff --git a/packages/core/src/terminal-layout.ts b/packages/core/src/terminal-layout.ts
new file mode 100644
index 000000000..200f49327
--- /dev/null
+++ b/packages/core/src/terminal-layout.ts
@@ -0,0 +1,40 @@
+export const TERMINAL_PLACEMENTS = ['bottom', 'right'] as const;
+
+export type TerminalPlacement = (typeof TERMINAL_PLACEMENTS)[number];
+
+export const DEFAULT_TERMINAL_PLACEMENT: TerminalPlacement = 'bottom';
+export const RIGHT_TERMINAL_CELL_WIDTH_PX = 8;
+export const RIGHT_TERMINAL_CHROME_WIDTH_PX = 4;
+
+/**
+ * Columns the column opens at. An agent CLI transcript wraps into unreadability
+ * below this, so it is what the terminal is worth by default — not what the user
+ * is held to.
+ */
+export const RIGHT_TERMINAL_PREFERRED_COLUMNS = 92;
+
+/**
+ * Columns the drag floor allows. Set for parity with the other rail columns
+ * (agents 320px, document pane 300px) rather than for transcript readability:
+ * a terminal narrower than the preferred width is a deliberate user choice, and
+ * a floor that outweighs both peers combined makes the rail unbalanceable.
+ */
+export const RIGHT_TERMINAL_MIN_COLUMNS = 40;
+
+const widthForColumns = (columns: number) =>
+ columns * RIGHT_TERMINAL_CELL_WIDTH_PX + RIGHT_TERMINAL_CHROME_WIDTH_PX;
+
+export const PREFERRED_TERMINAL_RIGHT_WIDTH = widthForColumns(RIGHT_TERMINAL_PREFERRED_COLUMNS);
+export const MIN_TERMINAL_RIGHT_WIDTH = widthForColumns(RIGHT_TERMINAL_MIN_COLUMNS);
+
+export function normalizeTerminalPlacement(value: unknown): TerminalPlacement {
+ return value === 'right' || value === 'bottom' ? value : DEFAULT_TERMINAL_PLACEMENT;
+}
+
+export function normalizeTerminalRightWidth(value: unknown): number {
+ // A missing width has never been sized by anyone, so it opens at the preferred
+ // width; a real one is only clamped to the floor. Clamping to the preferred
+ // width instead would silently undo every narrow width a user dragged.
+ if (typeof value !== 'number' || !Number.isFinite(value)) return PREFERRED_TERMINAL_RIGHT_WIDTH;
+ return Math.max(MIN_TERMINAL_RIGHT_WIDTH, Math.round(value));
+}
diff --git a/packages/desktop/src/main/index.ts b/packages/desktop/src/main/index.ts
index 625853511..68f74b87b 100644
--- a/packages/desktop/src/main/index.ts
+++ b/packages/desktop/src/main/index.ts
@@ -87,6 +87,10 @@ import {
type UninstallIntent,
type UninstallScreenSpec,
} from '@inkeep/open-knowledge-core';
+import type {
+ OkTerminalDockStateWriteResult,
+ OkTerminalRestartSnapshot,
+} from '@inkeep/open-knowledge-core/desktop-bridge';
import {
assertGitAvailable,
BUNDLE_SKILL_NAME,
@@ -147,7 +151,6 @@ import type {
import { type EntryPoint, isEntryPoint } from '../shared/entry-point.ts';
import type {
EditorActiveTargetSnapshot,
- EditorViewMenuStateSnapshot,
McpWiringEditorId,
MenuDispatchCommand,
MenuDispatchRole,
@@ -378,7 +381,9 @@ import {
emptyState,
evaluateSchemaCompatibility,
getProjectSessionState,
+ getTerminalDockState,
MAX_SUPPORTED_SCHEMA_VERSION,
+ normalizeTerminalRestartSnapshot,
type PersistedWindowBounds,
parseAppState,
removeRecentProject,
@@ -391,6 +396,7 @@ import {
type UpdateChannel,
} from './state-store.ts';
import { isTerminalConsented, isTerminalConsentedWithGrace } from './terminal-consent.ts';
+import { commitTerminalDockState } from './terminal-dock-persistence.ts';
import { type TerminalReaper, wireWindowTerminalReap } from './terminal-lifecycle.ts';
import {
clampPtyDimension,
@@ -399,6 +405,7 @@ import {
DEFAULT_PTY_ROWS,
type PtyUtilityLike,
} from './terminal-manager.ts';
+import { terminalStateKeyForContext } from './terminal-state-key.ts';
import {
recordConcurrentSessions,
recordShellExit,
@@ -435,11 +442,7 @@ import {
import { migrateLegacyUserDataDir } from './userdata-migration.ts';
import { buildUtilityForkEnv } from './utility-fork-env.ts';
import { computeFirstLaunchAfterUpgrade } from './version-drift.ts';
-import {
- buildViewMenuStateDeps,
- createDefaultEditorViewMenuState,
- mergeViewMenuState,
-} from './view-menu-state.ts';
+import { buildViewMenuStateDeps, EditorViewMenuStateRegistry } from './view-menu-state.ts';
import { applyThemeToWindow, buildNonDarwinChromeOpts } from './window-chrome.ts';
import {
type BrowserWindowLike,
@@ -684,6 +687,8 @@ function recordWindowFocusSeq(key: string): void {
function trackProjectWindowFocus(win: BrowserWindow, projectPath: string): void {
win.on('focus', () => {
if (focusTrackingFrozen) return;
+ editorViewMenuStates.select(win.id);
+ refreshApplicationMenu();
recordWindowFocusSeq(projectPath);
if (appState.lastOpenedProject !== projectPath) {
appState = { ...appState, lastOpenedProject: projectPath };
@@ -700,6 +705,8 @@ function trackProjectWindowFocus(win: BrowserWindow, projectPath: string): void
function trackEphemeralWindowFocus(win: BrowserWindow, fileKey: string): void {
win.on('focus', () => {
if (focusTrackingFrozen) return;
+ editorViewMenuStates.select(win.id);
+ refreshApplicationMenu();
recordWindowFocusSeq(fileKey);
});
}
@@ -887,7 +894,7 @@ function attachSpellcheckMenuToWindow(win: BrowserWindow): void {
// The native menu attaches to every editable field in the window, so the
// view-in-source row needs the renderer's answer for whether the jump is
// live. Read per right-click, like the spell-check flag above.
- canViewInSource: () => editorViewMenuState.canViewInSource === true,
+ canViewInSource: () => editorViewMenuStates.get(win.id).canViewInSource === true,
setSpellCheckEnabled: setSpellCheckEnabledAppWide,
addToDictionary: (word) => {
session.defaultSession.addWordToSpellCheckerDictionary(word);
@@ -930,10 +937,8 @@ let terminalReaper: TerminalReaper | null = null;
const slidesDeckRegistry = createSlidesDeckRegistry();
/**
* Per-window docked-terminal visibility, recorded from the renderer's view-menu
- * push so a reloaded renderer can restore an expanded dock. Keyed by windowId
- * (multi-window safe) with the same lifetime as the window's PTY sessions —
- * cleared on window-close and app-quit, so a fresh launch with no surviving
- * sessions restores nothing and the dock correctly stays hidden.
+ * push so a reloaded renderer can restore an expanded dock. The durable
+ * project-or-loose-file-keyed copy in AppState carries it across a full restart.
*/
const dockVisibleForWindow = new Map<number, boolean>();
/**
@@ -948,13 +953,40 @@ const agentPanelVisibleForWindow = new Map<number, boolean>();
* arrangement. Keyed by surface because the terminal dock and agents panel write
* independently — one shared record would let each write erase the other's keys
* and clobber the shared active tab. Same windowId-keyed lifetime as
- * {@link dockVisibleForWindow} — cleared on window-close and app-quit.
+ * {@link dockVisibleForWindow} — cleared on window-close and app-quit. Terminal
+ * order also has a state-keyed restart snapshot because PTY ids cannot survive a
+ * process exit; agent-thread ids remain server-owned and reload-only here.
*/
type DockOrderRecord = { order: string[]; activeKey: string | null };
const dockOrderForWindow = new Map<
number,
Partial<Record<'terminal' | 'agents', DockOrderRecord>>
>();
+const terminalSnapshotForWindow = new Map<number, OkTerminalRestartSnapshot>();
+
+function terminalStateKey(win: BrowserWindow): string | null {
+ const context = wm?.getContextForBrowserWindow(win as unknown as BrowserWindowLike) ?? null;
+ return terminalStateKeyForContext(context);
+}
+
+function persistTerminalDockForWindow(
+ win: BrowserWindow,
+ update: Partial<{
+ terminalVisible: boolean;
+ terminalSnapshot: OkTerminalRestartSnapshot;
+ }>,
+): OkTerminalDockStateWriteResult {
+ const stateKey = terminalStateKey(win);
+ if (stateKey === null) return { ok: false, reason: 'no-window-context' };
+ const committed = commitTerminalDockState({
+ current: appState,
+ stateKey,
+ update,
+ save: saveAppState,
+ });
+ appState = committed.state;
+ return committed.result;
+}
/**
* Singleton show-gate registry — coordinates window.show() against the
* dual-signal contract (`ready-to-show` + `ok:theme:applied`). Module-level
@@ -1277,12 +1309,12 @@ let editorActiveTarget: EditorActiveTargetSnapshot = { kind: null };
* View-menu state pushed by the renderer via
* `ok:editor:view-menu-state-changed`. Drives the View menu's checkbox
* reflection for the visibility toggles and the smart-hide on Expand All /
- * Collapse All, plus the editor context menu's view-in-source row. Module-scope
- * rather than per-window for the same reason `editorActiveTarget` is — the menu
- * is a singleton. Pre-push defaults (and their rationale) live with
- * `createDefaultEditorViewMenuState`.
+ * Collapse All, plus the editor context menu's view-in-source row. The native
+ * menu is a singleton, but its state belongs to the focused BrowserWindow.
+ * Per-window snapshots prevent a background renderer push from changing the
+ * focused window's checkmarks or terminal-placement label.
*/
-let editorViewMenuState: EditorViewMenuStateSnapshot = createDefaultEditorViewMenuState();
+const editorViewMenuStates = new EditorViewMenuStateRegistry();
/**
* electron-vite dev-server URL. Set by `electron-vite dev` at launch time.
@@ -1443,6 +1475,7 @@ function ensureWindowManager() {
trackEphemeralWindowFocus(win, opts.focusKey);
}
attachSpellcheckMenuToWindow(win);
+ win.on('closed', () => editorViewMenuStates.delete(win.id));
// Per-window PTY reap: closing the window kills its shell (no orphan).
// Idempotent — the manager no-ops for a window that never opened one. The
// onReap clears the window's retained dock-visibility so it can't restore
@@ -1452,6 +1485,7 @@ function ensureWindowManager() {
dockVisibleForWindow.delete(windowId);
agentPanelVisibleForWindow.delete(windowId);
dockOrderForWindow.delete(windowId);
+ terminalSnapshotForWindow.delete(windowId);
});
return win as unknown as BrowserWindowLike;
},
@@ -2807,6 +2841,8 @@ function applyMenuDispatchRole(role: MenuDispatchRole, sender: Electron.WebConte
}
async function runApplicationMenuRefresh(): Promise<void> {
+ const focusedWindowId = BrowserWindow.getFocusedWindow()?.id ?? null;
+ const editorViewMenuState = editorViewMenuStates.current(focusedWindowId);
// installApplicationMenu is async because it dynamically imports
// `electron.Menu` (see menu.ts header — keeps `buildMenuTemplate`
// unit-testable under Bun). Failures are logged; an uninstallable menu
@@ -2963,6 +2999,7 @@ async function runApplicationMenuRefresh(): Promise<void> {
? { onNewTerminalWindow: () => openTerminalWindow() }
: {
onToggleTerminal: undefined,
+ onMoveTerminal: undefined,
onNewTerminal: undefined,
onKillTerminal: undefined,
onNewTerminalWindow: undefined,
@@ -4524,34 +4561,73 @@ function registerIpcHandlers() {
handle('ok:terminal:dock-state', async (event) => {
const win = BrowserWindow.fromWebContents(event.sender);
- if (!win) return { terminalVisible: false, agentPanelVisible: false };
+ if (!win)
+ return {
+ terminalVisible: false,
+ agentPanelVisible: false,
+ };
+ const stateKey = terminalStateKey(win);
+ const persisted = stateKey === null ? null : getTerminalDockState(appState, stateKey);
const orders = dockOrderForWindow.get(win.id);
return {
- terminalVisible: dockVisibleForWindow.get(win.id) ?? false,
+ terminalVisible: dockVisibleForWindow.get(win.id) ?? persisted?.terminalVisible ?? false,
+ // Agent-panel visibility is intentionally scoped to this renderer
+ // session. Only Terminal placement, width, tabs, and visibility are part
+ // of the full-restart restoration contract.
agentPanelVisible: agentPanelVisibleForWindow.get(win.id) ?? false,
terminal: orders?.terminal,
+ terminalSnapshot: terminalSnapshotForWindow.get(win.id) ?? persisted?.terminalSnapshot,
agents: orders?.agents,
};
});
handle('ok:terminal:set-dock-state', async (event, req) => {
- // Same untrusted-discriminant problem as cli-preflight above: `req.surface`
- // is a compile-time union that `createHandler` casts without runtime
- // enforcement, and here it indexes straight into the per-window order map.
- // An out-of-registry value would store a phantom key that `getDockState`
- // never reads back, so the panel silently cold-starts with the wrong order.
- if (req.surface !== 'terminal' && req.surface !== 'agents') {
- getLogger('terminal').warn({ surface: req.surface }, 'set-dock-state: unknown surface');
- return undefined;
+ // createHandler's typed request has crossed IPC without runtime validation.
+ // Read the raw discriminant before using it as a map key so a forged value
+ // cannot create a phantom surface that the renderer will never restore.
+ const surface = Reflect.get(req, 'surface');
+ if (surface !== 'terminal' && surface !== 'agents') {
+ logIpcError({
+ event: 'ipc.error',
+ channel: 'ok:terminal:set-dock-state',
+ reason: 'invalid-request',
+ handler: 'setTerminalDockState',
+ });
+ return { ok: false, reason: 'invalid-request' } as const;
}
const win = BrowserWindow.fromWebContents(event.sender);
- if (win) {
- dockOrderForWindow.set(win.id, {
- ...dockOrderForWindow.get(win.id),
- [req.surface]: { order: req.order, activeKey: req.activeKey },
+ if (!win) {
+ logIpcError({
+ event: 'ipc.error',
+ channel: 'ok:terminal:set-dock-state',
+ reason: 'no-window-context',
+ handler: 'setTerminalDockState',
});
+ return { ok: false, reason: 'no-window-context' } as const;
}
- return undefined;
+ const order = Reflect.get(req, 'order');
+ const activeKey = Reflect.get(req, 'activeKey');
+ if (!Array.isArray(order) || (typeof activeKey !== 'string' && activeKey !== null)) {
+ logIpcError({
+ event: 'ipc.error',
+ channel: 'ok:terminal:set-dock-state',
+ reason: 'invalid-request',
+ handler: 'setTerminalDockState',
+ });
+ return { ok: false, reason: 'invalid-request' } as const;
+ }
+ const validOrder = order.filter((key): key is string => typeof key === 'string');
+ dockOrderForWindow.set(win.id, {
+ ...dockOrderForWindow.get(win.id),
+ [surface]: { order: validOrder, activeKey },
+ });
+ if (surface === 'agents') return { ok: true } as const;
+
+ const terminalSnapshot = Reflect.get(req, 'terminalSnapshot');
+ if (terminalSnapshot === undefined) return { ok: true } as const;
+ const normalizedSnapshot = normalizeTerminalRestartSnapshot(terminalSnapshot);
+ terminalSnapshotForWindow.set(win.id, normalizedSnapshot);
+ return persistTerminalDockForWindow(win, { terminalSnapshot: normalizedSnapshot });
});
handle('ok:dialog:open-folder', async (_event, opts) => {
@@ -4910,18 +4986,25 @@ function registerIpcHandlers() {
});
handle('ok:editor:view-menu-state-changed', async (event, state) => {
- // Sibling of the active-target push. Stored in module scope so the
- // next `refreshApplicationMenu` rebuild reads the latest snapshot.
- // Last-write-wins across windows matches the singleton menu model.
- editorViewMenuState = mergeViewMenuState(editorViewMenuState, state);
- // The menu snapshot is a singleton, but panel visibility must recover
- // per-window after a reload — record each panel keyed by the sender window
- // so the reloaded renderer reads back its own state, not another window's.
+ const win = BrowserWindow.fromWebContents(event.sender);
+ if (win) editorViewMenuStates.update(win.id, state);
+ // Panel visibility must recover per-window after a reload — record each
+ // panel keyed by the sender window so the reloaded renderer reads back its
+ // own state, not another window's.
if (state.terminalVisible !== undefined || state.agentPanelVisible !== undefined) {
- const win = BrowserWindow.fromWebContents(event.sender);
if (win) {
- if (state.terminalVisible !== undefined)
+ if (state.terminalVisible !== undefined) {
dockVisibleForWindow.set(win.id, state.terminalVisible);
+ const result = persistTerminalDockForWindow(win, {
+ terminalVisible: state.terminalVisible,
+ });
+ if (!result.ok) {
+ getLogger('terminal').warn(
+ { reason: result.reason },
+ 'terminal visibility persistence failed',
+ );
+ }
+ }
if (state.agentPanelVisible !== undefined)
agentPanelVisibleForWindow.set(win.id, state.agentPanelVisible);
}
@@ -5022,7 +5105,10 @@ function registerIpcHandlers() {
canCheckForUpdates: autoUpdaterHandle != null,
canReconfigureMcpWiring: app.isPackaged && supportedPackagedInstall(),
activeTarget: editorActiveTarget ?? { kind: null },
- viewMenuState: editorViewMenuState,
+ viewMenuState: (() => {
+ const win = BrowserWindow.fromWebContents(event.sender);
+ return win ? editorViewMenuStates.get(win.id) : editorViewMenuStates.current();
+ })(),
};
case 'menu-action':
sendMenuActionToFocused(request.action);
@@ -7801,6 +7887,7 @@ function bootPrimaryInstance(): void {
dockVisibleForWindow.clear();
agentPanelVisibleForWindow.clear();
dockOrderForWindow.clear();
+ terminalSnapshotForWindow.clear();
autoUpdaterHandle?.destroy();
autoUpdaterHandle = null;
bundleReplaceWatcherHandle?.stop();
diff --git a/packages/desktop/src/main/menu.ts b/packages/desktop/src/main/menu.ts
index 362f9df74..69f5722bd 100644
--- a/packages/desktop/src/main/menu.ts
+++ b/packages/desktop/src/main/menu.ts
@@ -44,6 +44,7 @@ import {
NATIVE_MENU_LABELS,
OPEN_KNOWLEDGE_GITHUB_URL,
SHOW_INSTALL_SKILL,
+ type TerminalPlacement,
} from '@inkeep/open-knowledge-core';
import type { Dialog, MenuItemConstructorOptions } from 'electron';
import type { EntryPoint } from '../shared/entry-point.ts';
@@ -296,12 +297,14 @@ export interface MenuDeps {
docPanelVisible?: boolean;
onToggleDocPanel?(): void;
/**
- * Bottom-dock visibility — drives the View → Show/Hide Bottom Dock label.
- * Unlike the sidebar/doc-panel (visible by default), the dock starts hidden,
- * so `undefined`/`false` reads as "Show Bottom Dock".
+ * Terminal visibility drives the View → Show/Hide Terminal label. Unlike the
+ * sidebar/doc-panel (visible by default), Terminal starts hidden, so
+ * `undefined`/`false` reads as "Show Terminal".
*/
terminalVisible?: boolean;
onToggleTerminal?(): void;
+ terminalPlacement?: TerminalPlacement;
+ onMoveTerminal?(): void;
/**
* Right agents-panel visibility — drives the View → Show/Hide Agents label.
* Starts hidden like the terminal, so `undefined`/`false` reads as "Show
@@ -603,6 +606,10 @@ const MENU_BINDINGS: Record<string, MenuCommandBinding> = {
click: (d) => () => d.onToggleTerminal?.(),
enabled: (d) => d.onToggleTerminal !== undefined,
},
+ 'move-terminal': {
+ click: (d) => () => d.onMoveTerminal?.(),
+ enabled: (d) => d.onMoveTerminal !== undefined,
+ },
'toggle-agent-panel': {
click: (d) => () => d.onToggleAgentPanel?.(),
enabled: (d) => d.onToggleAgentPanel !== undefined,
@@ -670,6 +677,7 @@ function menuCommandContext(deps: MenuDeps): CommandContext {
activeTargetKind: menuTargetKind(deps.activeTarget),
// The native menu has no single-file concept; those commands never gate here.
singleFile: false,
+ terminalCapable: process.platform === 'darwin',
terminalLive: deps.terminalLive === true,
canExpandAll: deps.canExpandAll ?? true,
canCollapseAll: deps.canCollapseAll ?? true,
@@ -700,6 +708,13 @@ function menuLeafLabel(
const visible = deps[stateField] ?? defaultVisible;
return translate(MENU_LABELS[visible ? hideKey : showKey]);
}
+ if (cmd.placementToggle) {
+ const key =
+ deps.terminalPlacement === 'right'
+ ? cmd.placementToggle.rightKey
+ : cmd.placementToggle.bottomKey;
+ return translate(MENU_LABELS[key]);
+ }
const key = placement.menuLabelKey ?? cmd.labelKey;
if (key === undefined) {
throw new Error(`command ${cmd.id} menu leaf has no resolvable label`);
diff --git a/packages/desktop/src/main/state-store.ts b/packages/desktop/src/main/state-store.ts
index 888da2441..85b411080 100644
--- a/packages/desktop/src/main/state-store.ts
+++ b/packages/desktop/src/main/state-store.ts
@@ -12,6 +12,7 @@
import { existsSync, mkdirSync, renameSync, unlinkSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
+import type { OkTerminalRestartSnapshot } from '@inkeep/open-knowledge-core/desktop-bridge';
interface RecentProject {
path: string;
@@ -104,6 +105,11 @@ export interface ProjectSessionState {
focusedPaneId: string;
}
+export interface PersistedTerminalDockState {
+ terminalVisible: boolean;
+ terminalSnapshot: OkTerminalRestartSnapshot;
+}
+
/**
* Auto-update channel. The build's version string is the sole source of
* truth (`channelFromVersion` in `auto-updater.ts`) — `'beta'` for a
@@ -274,6 +280,8 @@ export interface AppState {
* recents.
*/
projectWindowBounds: Record<string, PersistedWindowBounds>;
+ /** Full-restart terminal visibility + tab snapshot, keyed by project or loose-file identity. */
+ terminalDockStates: Record<string, PersistedTerminalDockState>;
/**
* Schema version of the persisted state, written by whichever build last
* touched it. Reads default to `1` when the field is missing. The boot
@@ -354,6 +362,7 @@ export function emptyState(): AppState {
dismissedRepairForBundle: null,
projectSessions: {},
projectWindowBounds: {},
+ terminalDockStates: {},
schemaVersion: CURRENT_SCHEMA_VERSION,
lastUsedProjectParent: null,
pendingWindowRestore: null,
@@ -644,12 +653,15 @@ export function removeRecentProject(state: AppState, projectPath: string): AppSt
delete projectSessions[projectPath];
const projectWindowBounds = { ...state.projectWindowBounds };
delete projectWindowBounds[projectPath];
+ const terminalDockStates = { ...state.terminalDockStates };
+ delete terminalDockStates[projectPath];
return {
...state,
recentProjects: state.recentProjects.filter((p) => p.path !== projectPath),
lastOpenedProject: state.lastOpenedProject === projectPath ? null : state.lastOpenedProject,
projectSessions,
projectWindowBounds,
+ terminalDockStates,
};
}
@@ -690,6 +702,90 @@ export function setProjectSessionState(
};
}
+function emptyTerminalDockState(): PersistedTerminalDockState {
+ return {
+ terminalVisible: false,
+ terminalSnapshot: { tabs: [], activeOrdinal: null },
+ };
+}
+
+export function normalizeTerminalRestartSnapshot(raw: unknown): OkTerminalRestartSnapshot {
+ if (typeof raw !== 'object' || raw === null || Array.isArray(raw)) {
+ return { tabs: [], activeOrdinal: null };
+ }
+ const obj = raw as Record<string, unknown>;
+ const seenOrdinals = new Set<number>();
+ const tabs = Array.isArray(obj.tabs)
+ ? obj.tabs.flatMap((rawTab) => {
+ if (typeof rawTab !== 'object' || rawTab === null || Array.isArray(rawTab)) return [];
+ const tab = rawTab as Record<string, unknown>;
+ if (
+ typeof tab.ordinal !== 'number' ||
+ !Number.isInteger(tab.ordinal) ||
+ tab.ordinal < 1 ||
+ seenOrdinals.has(tab.ordinal)
+ ) {
+ return [];
+ }
+ seenOrdinals.add(tab.ordinal);
+ return [
+ {
+ ordinal: tab.ordinal,
+ customLabel: typeof tab.customLabel === 'string' ? tab.customLabel : null,
+ },
+ ];
+ })
+ : [];
+ const activeOrdinal =
+ typeof obj.activeOrdinal === 'number' &&
+ Number.isInteger(obj.activeOrdinal) &&
+ seenOrdinals.has(obj.activeOrdinal)
+ ? obj.activeOrdinal
+ : null;
+ return { tabs, activeOrdinal };
+}
+
+function parsePersistedTerminalDockState(raw: unknown): PersistedTerminalDockState {
+ if (typeof raw !== 'object' || raw === null || Array.isArray(raw)) {
+ return emptyTerminalDockState();
+ }
+ const obj = raw as Record<string, unknown>;
+ return {
+ terminalVisible: obj.terminalVisible === true,
+ terminalSnapshot: normalizeTerminalRestartSnapshot(obj.terminalSnapshot),
+ };
+}
+
+function parseTerminalDockStates(raw: unknown): Record<string, PersistedTerminalDockState> {
+ if (typeof raw !== 'object' || raw === null || Array.isArray(raw)) return {};
+ const states: Record<string, PersistedTerminalDockState> = {};
+ for (const [projectPath, value] of Object.entries(raw)) {
+ if (projectPath.length > 0) states[projectPath] = parsePersistedTerminalDockState(value);
+ }
+ return states;
+}
+
+export function getTerminalDockState(
+ state: AppState,
+ projectPath: string,
+): PersistedTerminalDockState {
+ return state.terminalDockStates[projectPath] ?? emptyTerminalDockState();
+}
+
+export function setTerminalDockState(
+ state: AppState,
+ projectPath: string,
+ dockState: PersistedTerminalDockState,
+): AppState {
+ return {
+ ...state,
+ terminalDockStates: {
+ ...state.terminalDockStates,
+ [projectPath]: parsePersistedTerminalDockState(dockState),
+ },
+ };
+}
+
/**
* Annotate the recent list with `missing: true` for projects whose folder
* no longer exists. Pure read; doesn't mutate state.
@@ -893,6 +989,7 @@ export function parseAppState(raw: unknown): AppState | null {
// Additive field: a state.json predating window-bounds memory (or a
// corrupted per-entry blob) coerces to the empty map — cascade placement.
const projectWindowBounds = parseProjectWindowBounds(obj.projectWindowBounds);
+ const terminalDockStates = parseTerminalDockStates(obj.terminalDockStates);
// Defensive: only string values survive; everything else (null, undefined,
// wrong type from a corrupted state.json) coerces to null and the read
// handler falls back to the platform default.
@@ -926,6 +1023,7 @@ export function parseAppState(raw: unknown): AppState | null {
dismissedRepairForBundle,
projectSessions,
projectWindowBounds,
+ terminalDockStates,
schemaVersion,
lastUsedProjectParent,
pendingWindowRestore,
diff --git a/packages/desktop/src/main/terminal-dock-persistence.test.ts b/packages/desktop/src/main/terminal-dock-persistence.test.ts
new file mode 100644
index 000000000..5fdbbff4d
--- /dev/null
+++ b/packages/desktop/src/main/terminal-dock-persistence.test.ts
@@ -0,0 +1,63 @@
+import { describe, expect, test, vi } from 'vitest';
+import { emptyState, getTerminalDockState, setTerminalDockState } from './state-store';
+import { commitTerminalDockState } from './terminal-dock-persistence';
+
+describe('commitTerminalDockState', () => {
+ test('publishes the new state only after the durable write succeeds', () => {
+ const current = emptyState();
+ const save = vi.fn(() => false);
+ const outcome = commitTerminalDockState({
+ current,
+ stateKey: '/project',
+ update: {
+ terminalVisible: true,
+ terminalSnapshot: {
+ tabs: [{ ordinal: 1, customLabel: 'Build' }],
+ activeOrdinal: 1,
+ },
+ },
+ save,
+ });
+
+ expect(save).toHaveBeenCalledOnce();
+ expect(outcome).toEqual({ state: current, result: { ok: false, reason: 'persist-failed' } });
+ expect(getTerminalDockState(outcome.state, '/project')).toEqual({
+ terminalVisible: false,
+ terminalSnapshot: { tabs: [], activeOrdinal: null },
+ });
+ });
+
+ test('returns the committed state and explicit success after the write succeeds', () => {
+ const outcome = commitTerminalDockState({
+ current: emptyState(),
+ stateKey: '/project',
+ update: { terminalVisible: true },
+ save: () => true,
+ });
+
+ expect(outcome.result).toEqual({ ok: true });
+ expect(getTerminalDockState(outcome.state, '/project').terminalVisible).toBe(true);
+ });
+
+ test('skips the durable write when the normalized dock state is unchanged', () => {
+ const terminalSnapshot = {
+ tabs: [{ ordinal: 1, customLabel: 'Build' }],
+ activeOrdinal: 1,
+ };
+ const current = setTerminalDockState(emptyState(), '/project', {
+ terminalVisible: true,
+ terminalSnapshot,
+ });
+ const save = vi.fn(() => true);
+
+ const outcome = commitTerminalDockState({
+ current,
+ stateKey: '/project',
+ update: { terminalSnapshot: structuredClone(terminalSnapshot) },
+ save,
+ });
+
+ expect(save).not.toHaveBeenCalled();
+ expect(outcome).toEqual({ state: current, result: { ok: true } });
+ });
+});
diff --git a/packages/desktop/src/main/terminal-dock-persistence.ts b/packages/desktop/src/main/terminal-dock-persistence.ts
new file mode 100644
index 000000000..fc967f531
--- /dev/null
+++ b/packages/desktop/src/main/terminal-dock-persistence.ts
@@ -0,0 +1,34 @@
+import { isDeepStrictEqual } from 'node:util';
+import type {
+ OkTerminalDockStateWriteResult,
+ OkTerminalRestartSnapshot,
+} from '@inkeep/open-knowledge-core/desktop-bridge';
+import { type AppState, getTerminalDockState, setTerminalDockState } from './state-store';
+
+interface CommitTerminalDockStateInput {
+ readonly current: AppState;
+ readonly stateKey: string;
+ readonly update: Partial<{
+ terminalVisible: boolean;
+ terminalSnapshot: OkTerminalRestartSnapshot;
+ }>;
+ readonly save: (state: AppState) => boolean;
+}
+
+export function commitTerminalDockState({
+ current,
+ stateKey,
+ update,
+ save,
+}: CommitTerminalDockStateInput): {
+ readonly state: AppState;
+ readonly result: OkTerminalDockStateWriteResult;
+} {
+ const retained = getTerminalDockState(current, stateKey);
+ const next = setTerminalDockState(current, stateKey, { ...retained, ...update });
+ if (isDeepStrictEqual(getTerminalDockState(next, stateKey), retained)) {
+ return { state: current, result: { ok: true } };
+ }
+ if (!save(next)) return { state: current, result: { ok: false, reason: 'persist-failed' } };
+ return { state: next, result: { ok: true } };
+}
diff --git a/packages/desktop/src/main/terminal-state-key.test.ts b/packages/desktop/src/main/terminal-state-key.test.ts
new file mode 100644
index 000000000..9725a005c
--- /dev/null
+++ b/packages/desktop/src/main/terminal-state-key.test.ts
@@ -0,0 +1,31 @@
+import { describe, expect, test } from 'vitest';
+import { terminalStateKeyForContext } from './terminal-state-key';
+
+describe('terminalStateKeyForContext', () => {
+ test('uses each loose file identity instead of its shared parent directory', () => {
+ expect(
+ terminalStateKeyForContext({
+ projectPath: '/notes',
+ canonicalKey: '/notes/one.md',
+ ephemeral: {},
+ }),
+ ).toBe('/notes/one.md');
+ expect(
+ terminalStateKeyForContext({
+ projectPath: '/notes',
+ canonicalKey: '/notes/two.md',
+ ephemeral: {},
+ }),
+ ).toBe('/notes/two.md');
+ });
+
+ test('keeps normal projects keyed by their user-facing project path', () => {
+ expect(
+ terminalStateKeyForContext({
+ projectPath: '/symlink/project',
+ canonicalKey: '/real/project',
+ }),
+ ).toBe('/symlink/project');
+ expect(terminalStateKeyForContext(null)).toBeNull();
+ });
+});
diff --git a/packages/desktop/src/main/terminal-state-key.ts b/packages/desktop/src/main/terminal-state-key.ts
new file mode 100644
index 000000000..1695c388e
--- /dev/null
+++ b/packages/desktop/src/main/terminal-state-key.ts
@@ -0,0 +1,10 @@
+interface TerminalStateContext {
+ readonly projectPath: string;
+ readonly canonicalKey: string;
+ readonly ephemeral?: unknown;
+}
+
+export function terminalStateKeyForContext(context: TerminalStateContext | null): string | null {
+ if (context === null) return null;
+ return context.ephemeral === undefined ? context.projectPath : context.canonicalKey;
+}
diff --git a/packages/desktop/src/main/view-menu-state.test.ts b/packages/desktop/src/main/view-menu-state.test.ts
index ea5033def..67d8d7864 100644
--- a/packages/desktop/src/main/view-menu-state.test.ts
+++ b/packages/desktop/src/main/view-menu-state.test.ts
@@ -2,9 +2,35 @@ import { describe, expect, test } from 'vitest';
import {
buildViewMenuStateDeps,
createDefaultEditorViewMenuState,
+ EditorViewMenuStateRegistry,
mergeViewMenuState,
} from './view-menu-state';
+describe('EditorViewMenuStateRegistry — focused-window ownership', () => {
+ test('keeps two window snapshots independent and selects the focused one', () => {
+ const registry = new EditorViewMenuStateRegistry();
+ registry.update(11, { terminalPlacement: 'bottom', terminalVisible: true });
+ registry.update(22, { terminalPlacement: 'right', terminalVisible: false });
+
+ registry.select(11);
+ expect(registry.current().terminalPlacement).toBe('bottom');
+ expect(registry.current().terminalVisible).toBe(true);
+
+ registry.select(22);
+ expect(registry.current().terminalPlacement).toBe('right');
+ expect(registry.current().terminalVisible).toBe(false);
+ });
+
+ test('deleting a closed selected window falls back to safe defaults', () => {
+ const registry = new EditorViewMenuStateRegistry();
+ registry.update(11, { terminalPlacement: 'right', terminalVisible: true });
+ registry.select(11);
+ registry.delete(11);
+
+ expect(registry.current()).toEqual(createDefaultEditorViewMenuState());
+ });
+});
+
describe('mergeViewMenuState — multi-publisher non-clobbering contract', () => {
const initial = {
showHiddenFiles: false,
@@ -155,6 +181,7 @@ describe('createDefaultEditorViewMenuState — pre-first-push menu state', () =>
sidebarVisible: true,
docPanelVisible: true,
terminalVisible: false,
+ terminalPlacement: 'bottom',
terminalLive: false,
agentPanelVisible: false,
// Restrictive by design: this one gates a context-menu row, and a row
@@ -181,6 +208,7 @@ describe('buildViewMenuStateDeps — snapshot → menu-deps wiring', () => {
sidebarVisible: false,
docPanelVisible: false,
terminalVisible: true,
+ terminalPlacement: 'right',
terminalLive: true,
agentPanelVisible: true,
hasEditorSelection: true,
@@ -197,6 +225,7 @@ describe('buildViewMenuStateDeps — snapshot → menu-deps wiring', () => {
expect(deps.sidebarVisible).toBe(false);
expect(deps.docPanelVisible).toBe(false);
expect(deps.terminalVisible).toBe(true);
+ expect(deps.terminalPlacement).toBe('right');
expect(deps.terminalLive).toBe(true);
expect(deps.agentPanelVisible).toBe(true);
expect(deps.hasEditorSelection).toBe(true);
@@ -215,6 +244,7 @@ describe('buildViewMenuStateDeps — snapshot → menu-deps wiring', () => {
deps.onToggleSidebar?.();
deps.onToggleDocPanel?.();
deps.onToggleTerminal?.();
+ deps.onMoveTerminal?.();
deps.onToggleAgentPanel?.();
deps.onNewTerminal?.();
deps.onKillTerminal?.();
@@ -229,6 +259,7 @@ describe('buildViewMenuStateDeps — snapshot → menu-deps wiring', () => {
'toggle-sidebar',
'toggle-doc-panel',
'toggle-terminal',
+ 'move-terminal',
'toggle-agent-panel',
'new-terminal',
'kill-terminal',
diff --git a/packages/desktop/src/main/view-menu-state.ts b/packages/desktop/src/main/view-menu-state.ts
index 38d1ad162..ff31e551d 100644
--- a/packages/desktop/src/main/view-menu-state.ts
+++ b/packages/desktop/src/main/view-menu-state.ts
@@ -9,6 +9,35 @@ export function mergeViewMenuState(
return { ...prev, ...partial };
}
+export class EditorViewMenuStateRegistry {
+ readonly #states = new Map<number, EditorViewMenuStateSnapshot>();
+ #selectedWindowId: number | null = null;
+
+ update(windowId: number, partial: Partial<EditorViewMenuStateSnapshot>): void {
+ const previous = this.#states.get(windowId) ?? createDefaultEditorViewMenuState();
+ this.#states.set(windowId, mergeViewMenuState(previous, partial));
+ this.#selectedWindowId ??= windowId;
+ }
+
+ select(windowId: number): void {
+ this.#selectedWindowId = windowId;
+ }
+
+ get(windowId: number): EditorViewMenuStateSnapshot {
+ return this.#states.get(windowId) ?? createDefaultEditorViewMenuState();
+ }
+
+ current(focusedWindowId: number | null = null): EditorViewMenuStateSnapshot {
+ const windowId = focusedWindowId ?? this.#selectedWindowId;
+ return windowId === null ? createDefaultEditorViewMenuState() : this.get(windowId);
+ }
+
+ delete(windowId: number): void {
+ this.#states.delete(windowId);
+ if (this.#selectedWindowId === windowId) this.#selectedWindowId = null;
+ }
+}
+
/**
* The View-menu state main holds before the first renderer push lands.
* Defaults match the renderer's resolved config defaults so the menu
@@ -34,6 +63,7 @@ export function createDefaultEditorViewMenuState(): EditorViewMenuStateSnapshot
sidebarVisible: true,
docPanelVisible: true,
terminalVisible: false,
+ terminalPlacement: 'bottom',
terminalLive: false,
agentPanelVisible: false,
canViewInSource: false,
@@ -59,6 +89,7 @@ type ViewMenuStateDeps = Pick<
| 'sidebarVisible'
| 'docPanelVisible'
| 'terminalVisible'
+ | 'terminalPlacement'
| 'terminalLive'
| 'agentPanelVisible'
| 'hasEditorSelection'
@@ -69,6 +100,7 @@ type ViewMenuStateDeps = Pick<
| 'onToggleSidebar'
| 'onToggleDocPanel'
| 'onToggleTerminal'
+ | 'onMoveTerminal'
| 'onToggleAgentPanel'
| 'onNewTerminal'
| 'onKillTerminal'
@@ -97,6 +129,7 @@ export function buildViewMenuStateDeps(
sidebarVisible: state.sidebarVisible,
docPanelVisible: state.docPanelVisible,
terminalVisible: state.terminalVisible,
+ terminalPlacement: state.terminalPlacement,
terminalLive: state.terminalLive,
agentPanelVisible: state.agentPanelVisible,
hasEditorSelection: state.hasEditorSelection,
@@ -107,6 +140,7 @@ export function buildViewMenuStateDeps(
onToggleSidebar: () => sendMenuAction('toggle-sidebar'),
onToggleDocPanel: () => sendMenuAction('toggle-doc-panel'),
onToggleTerminal: () => sendMenuAction('toggle-terminal'),
+ onMoveTerminal: () => sendMenuAction('move-terminal'),
onToggleAgentPanel: () => sendMenuAction('toggle-agent-panel'),
onNewTerminal: () => sendMenuAction('new-terminal'),
onKillTerminal: () => sendMenuAction('kill-terminal'),
diff --git a/packages/desktop/src/preload/bridge-forwarding.test.ts b/packages/desktop/src/preload/bridge-forwarding.test.ts
index 66e456078..7962d0194 100644
--- a/packages/desktop/src/preload/bridge-forwarding.test.ts
+++ b/packages/desktop/src/preload/bridge-forwarding.test.ts
@@ -43,6 +43,20 @@ type BridgeProbe = {
}): Promise<unknown>;
create(request: Record<string, unknown>): Promise<unknown>;
};
+ terminal: {
+ setDockState(state: {
+ surface: 'terminal';
+ order: string[];
+ activeKey: string | null;
+ terminalSnapshot: { tabs: []; activeOrdinal: null };
+ }): Promise<{ ok: true } | { ok: false; reason: string }>;
+ };
+ editor: {
+ notifyViewMenuStateChanged(state: {
+ terminalVisible?: boolean;
+ terminalPlacement?: 'bottom' | 'right';
+ }): void;
+ };
};
async function loadBridge(): Promise<BridgeProbe> {
@@ -65,6 +79,22 @@ beforeEach(() => {
invokeMock.mockClear();
});
+describe('preload editor view-menu state marshalling', () => {
+ it('forwards terminal placement through the existing view-state channel', async () => {
+ const bridge = await loadBridge();
+
+ bridge.editor.notifyViewMenuStateChanged({
+ terminalVisible: true,
+ terminalPlacement: 'right',
+ });
+
+ expect(dispatchedPayload('ok:editor:view-menu-state-changed')).toEqual({
+ terminalVisible: true,
+ terminalPlacement: 'right',
+ });
+ });
+});
+
describe('preload bugReport.send marshalling', () => {
it('forwards the screenshot consent flag to main', async () => {
// Absent means "reporter declined" on the main side, so dropping the flag
@@ -157,3 +187,52 @@ describe('preload bugReport.create marshalling', () => {
});
});
});
+
+describe('preload terminal dock-state marshalling', () => {
+ it('forwards terminal tab state and returns the main-process persistence result', async () => {
+ const bridge = await loadBridge();
+
+ const result = await bridge.terminal.setDockState({
+ surface: 'terminal',
+ order: ['pty-a', 'pty-b'],
+ activeKey: 'pty-b',
+ terminalSnapshot: { tabs: [], activeOrdinal: null },
+ });
+
+ expect(result).toEqual({ ok: true });
+ expect(dispatchedPayload('ok:terminal:set-dock-state')).toEqual({
+ surface: 'terminal',
+ order: ['pty-a', 'pty-b'],
+ activeKey: 'pty-b',
+ terminalSnapshot: { tabs: [], activeOrdinal: null },
+ });
+ });
+
+ it('propagates an unrecognized invoke failure instead of reporting false success', async () => {
+ invokeMock.mockRejectedValueOnce(new Error('serialization bug'));
+ const bridge = await loadBridge();
+
+ await expect(
+ bridge.terminal.setDockState({
+ surface: 'terminal',
+ order: [],
+ activeKey: null,
+ terminalSnapshot: { tabs: [], activeOrdinal: null },
+ }),
+ ).rejects.toThrow('serialization bug');
+ });
+
+ it('classifies a destroyed IPC endpoint as an unavailable write', async () => {
+ invokeMock.mockRejectedValueOnce(new Error('Object has been destroyed'));
+ const bridge = await loadBridge();
+
+ await expect(
+ bridge.terminal.setDockState({
+ surface: 'terminal',
+ order: [],
+ activeKey: null,
+ terminalSnapshot: { tabs: [], activeOrdinal: null },
+ }),
+ ).resolves.toEqual({ ok: false, reason: 'ipc-unavailable' });
+ });
+});
diff --git a/packages/desktop/src/preload/index.ts b/packages/desktop/src/preload/index.ts
index d7b86eda9..fa98b0f44 100644
--- a/packages/desktop/src/preload/index.ts
+++ b/packages/desktop/src/preload/index.ts
@@ -74,6 +74,11 @@ import { createUninstallBridge } from './uninstall.ts';
const invoke = createInvoker(ipcRenderer);
+function isDockStateIpcTeardown(error: unknown): boolean {
+ if (!(error instanceof Error)) return false;
+ return /destroyed|disposed|closed|no handler registered/i.test(error.message);
+}
+
/**
* Async-iterable stream over a streamId-keyed IPC event channel. The
* factory subscribes to `eventChannel` immediately so events that arrive
@@ -824,12 +829,29 @@ const bridge: OkDesktopBridge = {
invoke('ok:pty:set-order', { orderedPtyIds: [...orderedPtyIds] }).catch(() => {});
},
getDockState: () => invoke('ok:terminal:dock-state'),
- setDockState: (state) => {
- invoke('ok:terminal:set-dock-state', {
- surface: state.surface,
- order: [...state.order],
- activeKey: state.activeKey,
- }).catch(() => {});
+ setDockState: async (state) => {
+ const request =
+ state.surface === 'terminal'
+ ? {
+ surface: state.surface,
+ order: [...state.order],
+ activeKey: state.activeKey,
+ terminalSnapshot: {
+ tabs: state.terminalSnapshot.tabs.map((tab) => ({ ...tab })),
+ activeOrdinal: state.terminalSnapshot.activeOrdinal,
+ },
+ }
+ : {
+ surface: state.surface,
+ order: [...state.order],
+ activeKey: state.activeKey,
+ };
+ try {
+ return await invoke('ok:terminal:set-dock-state', request);
+ } catch (error) {
+ if (isDockStateIpcTeardown(error)) return { ok: false, reason: 'ipc-unavailable' };
+ throw error;
+ }
},
onData(cb) {
const listener = (_event: IpcRendererEvent, msg: OkPtyData) => cb(msg);
diff --git a/packages/desktop/src/shared/ipc-channels.ts b/packages/desktop/src/shared/ipc-channels.ts
index 93a4ebfde..3501f368c 100644
--- a/packages/desktop/src/shared/ipc-channels.ts
+++ b/packages/desktop/src/shared/ipc-channels.ts
@@ -128,6 +128,9 @@ import type {
OkSharePayloadFields,
OkSharingSetModeResult,
OkSharingStatusResult,
+ OkTerminalDockState,
+ OkTerminalDockStateUpdate,
+ OkTerminalDockStateWriteResult,
OkThemeSource,
OkUpdateChannel,
OkSeedApplyOptions as SeedApplyOptions,
@@ -1681,16 +1684,11 @@ export interface RequestChannels {
/** Per-window state for the independent terminal and agents panels. */
'ok:terminal:dock-state': {
args: [];
- result: {
- terminalVisible: boolean;
- agentPanelVisible: boolean;
- terminal?: { order: string[]; activeKey: string | null };
- agents?: { order: string[]; activeKey: string | null };
- };
+ result: OkTerminalDockState;
};
- /** Persist one panel's tab order and active key per window. */
+ /** Persist one panel's tab state and report whether any durable write succeeded. */
'ok:terminal:set-dock-state': {
- args: [req: { surface: 'terminal' | 'agents'; order: string[]; activeKey: string | null }];
- result: undefined;
+ args: [req: OkTerminalDockStateUpdate];
+ result: OkTerminalDockStateWriteResult;
};
}
diff --git a/packages/desktop/tests/integration/m1-smoke.test.ts b/packages/desktop/tests/integration/m1-smoke.test.ts
index 8a51d96a2..a5458fc87 100644
--- a/packages/desktop/tests/integration/m1-smoke.test.ts
+++ b/packages/desktop/tests/integration/m1-smoke.test.ts
@@ -363,8 +363,9 @@ describe('M1 smoke', () => {
const coreMembers = extractLiteralUnion(readFileSync(corePath, 'utf-8'), 'OkMenuAction');
expect(coreMembers.size).toBeGreaterThan(0);
- // 26 baseline + 2 worktree + 2 Help + 3 sidebar + 2 navigation + 1 agents panel.
- expect(coreMembers.size).toBe(36);
+ // 26 baseline + 2 worktree + 2 Help + 3 sidebar + 2 navigation + 1 agents panel
+ // + 1 terminal placement action.
+ expect(coreMembers.size).toBe(37);
// Pin the visibility toggles explicitly: a bare count check wouldn't
// notice a simultaneous add+remove that nets to the same size.
expect(coreMembers.has('toggle-show-hidden-files')).toBe(true);
@@ -377,6 +378,7 @@ describe('M1 smoke', () => {
expect(coreMembers.has('navigate-back')).toBe(true);
expect(coreMembers.has('navigate-forward')).toBe(true);
expect(coreMembers.has('toggle-agent-panel')).toBe(true);
+ expect(coreMembers.has('move-terminal')).toBe(true);
});
test('M1 invariant: EntryPoint / OkProjectEntryPoint literal-union drift catcher', async () => {
diff --git a/packages/desktop/tests/main/menu.test.ts b/packages/desktop/tests/main/menu.test.ts
index 4ee52a9a5..9abe4552d 100644
--- a/packages/desktop/tests/main/menu.test.ts
+++ b/packages/desktop/tests/main/menu.test.ts
@@ -1196,31 +1196,31 @@ describe('buildMenuTemplate — View → Show/Hide sidebar', () => {
});
});
-describe('buildMenuTemplate — View → Show/Hide Bottom Dock', () => {
- // The bottom-dock toggle mirrors the sidebar/doc-panel single-row pattern
- // but inverts the default: the dock starts HIDDEN, so undefined/false reads
- // "Show Bottom Dock" (the sidebar/doc-panel start visible, so they default
+describe('buildMenuTemplate — View → Show/Hide Terminal', () => {
+ // The Terminal toggle mirrors the sidebar/doc-panel single-row pattern but
+ // inverts the default: the Terminal starts HIDDEN, so undefined/false reads
+ // "Show Terminal" (the sidebar/doc-panel start visible, so they default
// to "Hide"). ⌘J / Ctrl+J is OS-captured before the renderer, matching the
// sidebar item's accelerator model.
- test('renders "Show Bottom Dock" when terminalVisible is unset or false', () => {
+ test('renders "Show Terminal" when terminalVisible is unset or false', () => {
const unsetDeps = buildMenuTemplate(makeDeps({ onToggleTerminal: vi.fn(() => {}) }));
- expect(findByLabel(unsetDeps, 'Show Bottom Dock')).toBeDefined();
- expect(findByLabel(unsetDeps, 'Hide Bottom Dock')).toBeUndefined();
+ expect(findByLabel(unsetDeps, 'Show Terminal')).toBeDefined();
+ expect(findByLabel(unsetDeps, 'Hide Terminal')).toBeUndefined();
const hidden = buildMenuTemplate(
makeDeps({ onToggleTerminal: vi.fn(() => {}), terminalVisible: false }),
);
- expect(findByLabel(hidden, 'Show Bottom Dock')).toBeDefined();
- expect(findByLabel(hidden, 'Hide Bottom Dock')).toBeUndefined();
+ expect(findByLabel(hidden, 'Show Terminal')).toBeDefined();
+ expect(findByLabel(hidden, 'Hide Terminal')).toBeUndefined();
});
- test('renders "Hide Bottom Dock" when terminalVisible is true', () => {
+ test('renders "Hide Terminal" when terminalVisible is true', () => {
const visible = buildMenuTemplate(
makeDeps({ onToggleTerminal: vi.fn(() => {}), terminalVisible: true }),
);
- expect(findByLabel(visible, 'Hide Bottom Dock')).toBeDefined();
- expect(findByLabel(visible, 'Show Bottom Dock')).toBeUndefined();
+ expect(findByLabel(visible, 'Hide Terminal')).toBeDefined();
+ expect(findByLabel(visible, 'Show Terminal')).toBeUndefined();
});
test('Terminal binds CmdOrCtrl+J accelerator (⌘J on macOS, VS Code panel convention)', () => {
@@ -1231,30 +1231,30 @@ describe('buildMenuTemplate — View → Show/Hide Bottom Dock', () => {
// renderer-delivered, and a menu item may hold only one. ⌃` is also distinct
// from the ⌘` this comment warns about — Control, not Command.
const hidden = buildMenuTemplate(makeDeps({ onToggleTerminal: vi.fn(() => {}) }));
- expect(findByLabel(hidden, 'Show Bottom Dock')?.accelerator).toBe('CmdOrCtrl+J');
+ expect(findByLabel(hidden, 'Show Terminal')?.accelerator).toBe('CmdOrCtrl+J');
const visible = buildMenuTemplate(
makeDeps({ onToggleTerminal: vi.fn(() => {}), terminalVisible: true }),
);
- expect(findByLabel(visible, 'Hide Bottom Dock')?.accelerator).toBe('CmdOrCtrl+J');
+ expect(findByLabel(visible, 'Hide Terminal')?.accelerator).toBe('CmdOrCtrl+J');
});
test('Terminal DISABLED when toggle handler missing (unit-test default)', () => {
const template = buildMenuTemplate(makeDeps());
- expect(findByLabel(template, 'Show Bottom Dock')?.enabled).toBe(false);
+ expect(findByLabel(template, 'Show Terminal')?.enabled).toBe(false);
});
test('Terminal click dispatches deps.onToggleTerminal', () => {
const onToggleTerminal = vi.fn(() => {});
const template = buildMenuTemplate(makeDeps({ onToggleTerminal }));
- (findByLabel(template, 'Show Bottom Dock')?.click as (() => void) | undefined)?.();
+ (findByLabel(template, 'Show Terminal')?.click as (() => void) | undefined)?.();
expect(onToggleTerminal).toHaveBeenCalledTimes(1);
const onToggleTerminal2 = vi.fn(() => {});
const visible = buildMenuTemplate(
makeDeps({ onToggleTerminal: onToggleTerminal2, terminalVisible: true }),
);
- (findByLabel(visible, 'Hide Bottom Dock')?.click as (() => void) | undefined)?.();
+ (findByLabel(visible, 'Hide Terminal')?.click as (() => void) | undefined)?.();
expect(onToggleTerminal2).toHaveBeenCalledTimes(1);
});
@@ -1266,7 +1266,7 @@ describe('buildMenuTemplate — View → Show/Hide Bottom Dock', () => {
const sub = view?.submenu as MenuItemConstructorOptions[] | undefined;
const labels = sub?.map((i) => (i.role ? `[role:${i.role}]` : (i.label ?? '[sep]'))) ?? [];
const docPanelIdx = labels.indexOf('Hide document panel');
- const terminalIdx = labels.indexOf('Show Bottom Dock');
+ const terminalIdx = labels.indexOf('Show Terminal');
const resetZoomIdx = labels.indexOf('[role:resetZoom]');
expect(terminalIdx).toBeGreaterThan(docPanelIdx);
expect(resetZoomIdx).toBeGreaterThan(terminalIdx);
@@ -1302,7 +1302,7 @@ describe('buildMenuTemplate — View → Show/Hide Agents', () => {
makeDeps({ onToggleAgentPanel: vi.fn(() => {}), onToggleTerminal: vi.fn(() => {}) }),
);
expect(findByLabel(template, 'Show Agents')?.accelerator).toBe('CmdOrCtrl+L');
- expect(findByLabel(template, 'Show Bottom Dock')?.accelerator).toBe('CmdOrCtrl+J');
+ expect(findByLabel(template, 'Show Terminal')?.accelerator).toBe('CmdOrCtrl+J');
});
test('Agents click dispatches deps.onToggleAgentPanel', () => {
@@ -1324,12 +1324,14 @@ describe('buildMenuTemplate — View → Show/Hide Agents', () => {
makeDeps({
onToggleAgentPanel: vi.fn(() => {}),
onToggleTerminal: undefined,
+ onMoveTerminal: undefined,
onNewTerminal: undefined,
onKillTerminal: undefined,
}),
);
expect(findByLabel(template, 'Show Agents')?.enabled).toBe(true);
- expect(findByLabel(template, 'Show Bottom Dock')?.enabled).toBe(false);
+ expect(findByLabel(template, 'Show Terminal')?.enabled).toBe(false);
+ expect(findByLabel(template, 'Move Terminal to right')?.enabled).toBe(false);
});
test('Agents follows the Terminal toggle in the View panel cluster', () => {
@@ -1338,13 +1340,13 @@ describe('buildMenuTemplate — View → Show/Hide Agents', () => {
);
const sub = findByLabel(template, 'View')?.submenu as MenuItemConstructorOptions[] | undefined;
const labels = sub?.map((i) => (i.role ? `[role:${i.role}]` : (i.label ?? '[sep]'))) ?? [];
- expect(labels.indexOf('Show Agents')).toBeGreaterThan(labels.indexOf('Show Bottom Dock'));
+ expect(labels.indexOf('Show Agents')).toBeGreaterThan(labels.indexOf('Show Terminal'));
});
});
-describe('buildMenuTemplate — top-level Terminal menu (New / Kill)', () => {
+describe('buildMenuTemplate — top-level Terminal menu', () => {
// VS Code-style top-level Terminal menu, placed between View and Window. The
- // View → Show/Hide Bottom Dock toggle is kept too (⌘J muscle memory); this menu
+ // View → Show/Hide Terminal toggle is kept too (⌘J muscle memory); this menu
// is the discoverable home. New Terminal is click-only (no accelerator — ⌘J
// belongs to the View toggle); Kill Terminal gates on a live session.
@@ -1357,11 +1359,12 @@ describe('buildMenuTemplate — top-level Terminal menu (New / Kill)', () => {
expect(windowIdx).toBeGreaterThan(terminalIdx);
});
- test('contains New Terminal, New Terminal Window, then Kill Terminal; New Terminal is click-only (no ⌘J)', () => {
+ test('contains new, window, placement, and kill actions in order', () => {
const template = buildMenuTemplate(
makeDeps({
onNewTerminal: vi.fn(() => {}),
onNewTerminalWindow: vi.fn(() => {}),
+ onMoveTerminal: vi.fn(() => {}),
onKillTerminal: vi.fn(() => {}),
}),
);
@@ -1371,44 +1374,95 @@ describe('buildMenuTemplate — top-level Terminal menu (New / Kill)', () => {
expect(sub?.map((i) => i.label)).toEqual([
'New Terminal',
'New Terminal Window',
+ 'Move Terminal to right',
'Kill Terminal',
]);
- // No accelerator: ⌘J belongs to the View → Show/Hide Bottom Dock toggle, so
+ // No accelerator: ⌘J belongs to the View → Show/Hide Terminal toggle, so
// advertising it here too would only mislabel this item.
expect(findByLabel(template, 'New Terminal')?.accelerator).toBeUndefined();
});
+ test('placement label inverts with current home and dispatches the shared action', () => {
+ const onMoveTerminal = vi.fn(() => {});
+ const bottom = buildMenuTemplateForPlatform(
+ 'darwin',
+ makeDeps({ terminalPlacement: 'bottom', onMoveTerminal }),
+ );
+ const moveRight = findByLabel(bottom, 'Move Terminal to right');
+ expect(moveRight?.enabled).toBe(true);
+ (moveRight?.click as (() => void) | undefined)?.();
+ expect(onMoveTerminal).toHaveBeenCalledTimes(1);
+
+ const right = buildMenuTemplateForPlatform(
+ 'darwin',
+ makeDeps({ terminalPlacement: 'right', onMoveTerminal }),
+ );
+ expect(findByLabel(right, 'Move Terminal to bottom')).toBeDefined();
+ expect(findByLabel(right, 'Move Terminal to right')).toBeUndefined();
+ });
+
test('New Terminal dispatches onNewTerminal; disabled when the handler is unwired', () => {
const onNewTerminal = vi.fn(() => {});
- const item = findByLabel(buildMenuTemplate(makeDeps({ onNewTerminal })), 'New Terminal');
+ const item = findByLabel(
+ buildMenuTemplateForPlatform('darwin', makeDeps({ onNewTerminal })),
+ 'New Terminal',
+ );
expect(item?.enabled).toBe(true);
(item?.click as (() => void) | undefined)?.();
expect(onNewTerminal).toHaveBeenCalledTimes(1);
- expect(findByLabel(buildMenuTemplate(makeDeps()), 'New Terminal')?.enabled).toBe(false);
+ expect(
+ findByLabel(buildMenuTemplateForPlatform('darwin', makeDeps()), 'New Terminal')?.enabled,
+ ).toBe(false);
});
test('Kill Terminal is disabled with no live session, enabled + kills when one is live', () => {
// Wired handler but no live session → disabled (spec: disable when no session).
- const offline = buildMenuTemplate(makeDeps({ onKillTerminal: vi.fn(() => {}) }));
+ const offline = buildMenuTemplateForPlatform(
+ 'darwin',
+ makeDeps({ onKillTerminal: vi.fn(() => {}) }),
+ );
expect(findByLabel(offline, 'Kill Terminal')?.enabled).toBe(false);
// A live session but no wired handler (unit-test default) → still disabled.
- const unwired = buildMenuTemplate(makeDeps({ terminalLive: true }));
+ const unwired = buildMenuTemplateForPlatform('darwin', makeDeps({ terminalLive: true }));
expect(findByLabel(unwired, 'Kill Terminal')?.enabled).toBe(false);
// Live + wired → enabled; clicking runs the kill path.
const onKillTerminal = vi.fn(() => {});
- const live = buildMenuTemplate(makeDeps({ onKillTerminal, terminalLive: true }));
+ const live = buildMenuTemplateForPlatform(
+ 'darwin',
+ makeDeps({ onKillTerminal, terminalLive: true }),
+ );
const killItem = findByLabel(live, 'Kill Terminal');
expect(killItem?.enabled).toBe(true);
(killItem?.click as (() => void) | undefined)?.();
expect(onKillTerminal).toHaveBeenCalledTimes(1);
});
- test('the View → Show/Hide Bottom Dock toggle is preserved alongside the Terminal menu', () => {
+ test('PTY-backed commands stay disabled off macOS even when handlers are wired', () => {
+ const template = buildMenuTemplateForPlatform(
+ 'linux',
+ makeDeps({
+ onToggleTerminal: vi.fn(() => {}),
+ onMoveTerminal: vi.fn(() => {}),
+ onNewTerminal: vi.fn(() => {}),
+ onNewTerminalWindow: vi.fn(() => {}),
+ onKillTerminal: vi.fn(() => {}),
+ terminalLive: true,
+ }),
+ );
+
+ expect(findByLabel(template, 'Show Terminal')?.enabled).toBe(false);
+ expect(findByLabel(template, 'Move Terminal to right')?.enabled).toBe(false);
+ expect(findByLabel(template, 'New Terminal')?.enabled).toBe(false);
+ expect(findByLabel(template, 'New Terminal Window')?.enabled).toBe(false);
+ expect(findByLabel(template, 'Kill Terminal')?.enabled).toBe(false);
+ });
+
+ test('the View → Show/Hide Terminal toggle is preserved alongside the Terminal menu', () => {
const template = buildMenuTemplate(makeDeps({ onToggleTerminal: vi.fn(() => {}) }));
- expect(findByLabel(template, 'Show Bottom Dock')).toBeDefined();
+ expect(findByLabel(template, 'Show Terminal')).toBeDefined();
expect(findByLabel(template, 'Terminal')).toBeDefined();
});
});
@@ -1488,7 +1542,10 @@ describe('buildMenuTemplate — Edit → Check spelling while typing', () => {
describe('Terminal menu — New Terminal Window', () => {
test('appears in the Terminal submenu beside New Terminal', () => {
- const template = buildMenuTemplate(makeDeps({ onNewTerminalWindow: vi.fn(() => {}) }));
+ const template = buildMenuTemplateForPlatform(
+ 'darwin',
+ makeDeps({ onNewTerminalWindow: vi.fn(() => {}) }),
+ );
const terminalMenu = template.find((i) => i.label === 'Terminal');
const sub = terminalMenu?.submenu as MenuItemConstructorOptions[] | undefined;
if (!sub) throw new Error('Terminal submenu missing');
@@ -1499,7 +1556,7 @@ describe('Terminal menu — New Terminal Window', () => {
test('renders with no keyboard accelerator', () => {
const item = findByLabel(
- buildMenuTemplate(makeDeps({ onNewTerminalWindow: vi.fn(() => {}) })),
+ buildMenuTemplateForPlatform('darwin', makeDeps({ onNewTerminalWindow: vi.fn(() => {}) })),
'New Terminal Window',
);
expect(item).toBeDefined();
@@ -1509,7 +1566,7 @@ describe('Terminal menu — New Terminal Window', () => {
test('click invokes onNewTerminalWindow', () => {
const onNewTerminalWindow = vi.fn(() => {});
const item = findByLabel(
- buildMenuTemplate(makeDeps({ onNewTerminalWindow })),
+ buildMenuTemplateForPlatform('darwin', makeDeps({ onNewTerminalWindow })),
'New Terminal Window',
);
(item?.click as (() => void) | undefined)?.();
@@ -1517,9 +1574,12 @@ describe('Terminal menu — New Terminal Window', () => {
});
test('disabled when the dep is omitted, enabled when wired', () => {
- expect(findByLabel(buildMenuTemplate(makeDeps()), 'New Terminal Window')?.enabled).toBe(false);
+ expect(
+ findByLabel(buildMenuTemplateForPlatform('darwin', makeDeps()), 'New Terminal Window')
+ ?.enabled,
+ ).toBe(false);
const wired = findByLabel(
- buildMenuTemplate(makeDeps({ onNewTerminalWindow: vi.fn(() => {}) })),
+ buildMenuTemplateForPlatform('darwin', makeDeps({ onNewTerminalWindow: vi.fn(() => {}) })),
'New Terminal Window',
);
expect(wired?.enabled).toBe(true);
diff --git a/packages/desktop/tests/main/state-store.test.ts b/packages/desktop/tests/main/state-store.test.ts
index e3226919f..961e0920e 100644
--- a/packages/desktop/tests/main/state-store.test.ts
+++ b/packages/desktop/tests/main/state-store.test.ts
@@ -8,6 +8,7 @@ import {
annotateMissing,
emptyState,
getProjectSessionState,
+ getTerminalDockState,
type PersistedWindowBounds,
parseAppState,
removeRecentProject,
@@ -17,6 +18,7 @@ import {
setProjectSessionState,
setProjectWindowBounds,
setSpellCheckEnabled,
+ setTerminalDockState,
} from '../../src/main/state-store.ts';
function persistedWorkspace(
@@ -260,6 +262,71 @@ describe('state-store (recent projects + LRU)', () => {
});
});
+describe('state-store (terminal full-restart state)', () => {
+ test('defaults legacy state to a hidden dock with no tabs', () => {
+ const parsed = parseAppState({ recentProjects: [] });
+ expect(parsed?.terminalDockStates).toEqual({});
+ expect(getTerminalDockState(parsed ?? emptyState(), '/tmp/project')).toEqual({
+ terminalVisible: false,
+ terminalSnapshot: { tabs: [], activeOrdinal: null },
+ });
+ });
+
+ test('round-trips project-scoped visibility, tab order, and active tab', () => {
+ const state = setTerminalDockState(emptyState(), '/tmp/project', {
+ terminalVisible: true,
+ terminalSnapshot: {
+ tabs: [
+ { ordinal: 2, customLabel: 'Build' },
+ { ordinal: 1, customLabel: null },
+ ],
+ activeOrdinal: 1,
+ },
+ });
+ const parsed = parseAppState(JSON.parse(JSON.stringify(state)));
+ expect(getTerminalDockState(parsed ?? emptyState(), '/tmp/project')).toEqual(
+ state.terminalDockStates['/tmp/project'],
+ );
+ });
+
+ test('drops legacy layout fields while coercing tab metadata at the persistence boundary', () => {
+ const parsed = parseAppState({
+ recentProjects: [],
+ terminalDockStates: {
+ '/tmp/project': {
+ terminalVisible: 'yes',
+ placement: 'sideways',
+ rightWidth: 100,
+ terminalSnapshot: {
+ tabs: [
+ { ordinal: 2, customLabel: 'Build' },
+ { ordinal: 2, customLabel: 'duplicate' },
+ { ordinal: -1, customLabel: null },
+ ],
+ activeOrdinal: 99,
+ },
+ },
+ },
+ });
+ expect(getTerminalDockState(parsed ?? emptyState(), '/tmp/project')).toEqual({
+ terminalVisible: false,
+ terminalSnapshot: {
+ tabs: [{ ordinal: 2, customLabel: 'Build' }],
+ activeOrdinal: null,
+ },
+ });
+ });
+
+ test('removing a recent project also removes its terminal state', () => {
+ let state = addRecentProject(emptyState(), '/tmp/project', 'project');
+ state = setTerminalDockState(state, '/tmp/project', {
+ terminalVisible: true,
+ terminalSnapshot: { tabs: [{ ordinal: 1, customLabel: null }], activeOrdinal: 1 },
+ });
+ expect(removeRecentProject(state, '/tmp/project').terminalDockStates).toEqual({});
+ });
+});
+
describe('state-store (gitRemoteUrl field on RecentProject)', () => {
test('addRecentProject persists the optional gitRemoteUrl when provided', () => {
const next = addRecentProject(
diff --git a/packages/desktop/tests/smoke/terminal-dock-state.e2e.ts b/packages/desktop/tests/smoke/terminal-dock-state.e2e.ts
new file mode 100644
index 000000000..6eb6b363f
--- /dev/null
+++ b/packages/desktop/tests/smoke/terminal-dock-state.e2e.ts
@@ -0,0 +1,127 @@
+import { mkdirSync, mkdtempSync, writeFileSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import { join } from 'node:path';
+import type { Page } from '@playwright/test';
+import { _electron as electron } from '@playwright/test';
+import { desktopLaunchOptions, resolveDesktopTarget } from './_helpers/launch-desktop';
+import { expect, test } from './_helpers/smoke-test';
+
+const TARGET = resolveDesktopTarget();
+const SMOKE_ENABLED = process.env.OK_DESKTOP_E2E_SMOKE === '1';
+
+test.describe('terminal dock-state IPC', () => {
+ test.skip(!SMOKE_ENABLED, 'Set OK_DESKTOP_E2E_SMOKE=1 to run Electron smoke tests.');
+ test.skip(!TARGET.exists, TARGET.missingReason);
+
+ test('terminal tab snapshot survives renderer reload together', async ({ captureStderrFor }) => {
+ const testRoot = mkdtempSync(join(tmpdir(), 'ok-terminal-dock-state-'));
+ const projectDir = join(testRoot, 'project');
+ mkdirSync(join(projectDir, '.ok'), { recursive: true });
+ writeFileSync(join(projectDir, '.ok', 'config.yml'), "content:\n dir: '.'\n");
+ writeFileSync(join(projectDir, 'start.md'), '# Start\n');
+ const userDataDir = join(testRoot, 'user-data');
+ mkdirSync(userDataDir, { recursive: true });
+ writeFileSync(
+ join(userDataDir, 'state.json'),
+ JSON.stringify({
+ recentProjects: [
+ { path: projectDir, name: 'Dock State Smoke', lastOpenedAt: new Date().toISOString() },
+ ],
+ lastOpenedProject: projectDir,
+ versionPendingInstall: null,
+ lastSeenVersion: null,
+ lastSuccessfulCheckAt: null,
+ stuckHintShown: false,
+ }),
+ );
+ const app = await electron.launch(
+ desktopLaunchOptions({
+ target: TARGET,
+ args: [`--user-data-dir=${userDataDir}`],
+ timeout: 30_000,
+ env: { ...process.env, OK_RECLAIM_DISABLE: '1' },
+ }),
+ );
+ captureStderrFor(app, { cleanupDirs: [testRoot] });
+ let page: Page | undefined;
+ await expect(async () => {
+ for (const candidate of app.windows()) {
+ const mode = await candidate
+ .evaluate(() => window.okDesktop?.config?.mode)
+ .catch(() => undefined);
+ if (mode === 'editor') {
+ page = candidate;
+ return;
+ }
+ }
+ throw new Error('no editor window yet');
+ }).toPass({ timeout: 25_000 });
+ const editorPage = page;
+ if (editorPage == null) throw new Error('editor window vanished after readiness poll');
+
+ const agents = await editorPage.evaluate(() =>
+ window.okDesktop?.terminal.setDockState({
+ surface: 'agents',
+ order: ['thread-a', 'thread-b'],
+ activeKey: 'thread-a',
+ }),
+ );
+ expect(agents).toEqual({ ok: true });
+ await expect
+ .poll(() =>
+ editorPage.evaluate(() =>
+ window.okDesktop?.terminal.setDockState({
+ surface: 'terminal',
+ order: ['pty-a', 'pty-b'],
+ activeKey: 'pty-b',
+ terminalSnapshot: {
+ tabs: [
+ { ordinal: 1, customLabel: null },
+ { ordinal: 2, customLabel: 'Build' },
+ ],
+ activeOrdinal: 2,
+ },
+ }),
+ ),
+ )
+ .toEqual({ ok: true });
+
+ const expectedBeforeReload = {
+ terminal: { order: ['pty-a', 'pty-b'], activeKey: 'pty-b' },
+ terminalSnapshot: {
+ tabs: [
+ { ordinal: 1, customLabel: null },
+ { ordinal: 2, customLabel: 'Build' },
+ ],
+ activeOrdinal: 2,
+ },
+ agents: { order: ['thread-a', 'thread-b'], activeKey: 'thread-a' },
+ };
+ await expect
+ .poll(() => editorPage.evaluate(() => window.okDesktop?.terminal.getDockState()))
+ .toMatchObject(expectedBeforeReload);
+ const dockState = await editorPage.evaluate(() => window.okDesktop?.terminal.getDockState());
+ expect(dockState).not.toHaveProperty('placement');
+ expect(dockState).not.toHaveProperty('rightWidth');
+
+ await editorPage.reload({ waitUntil: 'domcontentloaded' });
+ await expect
+ .poll(() =>
+ editorPage.evaluate(async () => {
+ const state = await window.okDesktop?.terminal.getDockState();
+ return {
+ agents: state?.agents,
+ terminalCount: state?.terminal?.order.length,
+ activeIndex: state?.terminal?.order.indexOf(state.terminal.activeKey ?? ''),
+ terminalSnapshot: state?.terminalSnapshot,
+ };
+ }),
+ )
+ .toEqual({
+ agents: { order: [], activeKey: null },
+ terminalCount: 2,
+ activeIndex: 1,
+ terminalSnapshot: expectedBeforeReload.terminalSnapshot,
+ });
+ });
+});
diff --git a/packages/desktop/tests/smoke/terminal-dock.e2e.ts b/packages/desktop/tests/smoke/terminal-dock.e2e.ts
index dc92cc412..114e98dc5 100644
--- a/packages/desktop/tests/smoke/terminal-dock.e2e.ts
+++ b/packages/desktop/tests/smoke/terminal-dock.e2e.ts
@@ -10,14 +10,6 @@
*
* Skip gates mirror the sibling smokes: opt-in via OK_DESKTOP_E2E_SMOKE=1,
* darwin-only, and the electron-vite build must exist (out/main/index.js).
- *
- * QUARANTINED ON CI (test.skip(IS_CI)): the suite degrades on the 6-vCPU runner
- * (shells exit before "running" after a few launches) though it passes locally.
- * The skip is tracked, not invisible — it is allowlisted in the CI no-skip guard
- * (QUARANTINE_ALLOWLIST), which fails if the entry goes stale, and the rest of
- * the desktop-smoke gate stays non-vacuous via its smoke-not-vacuous check.
- * Re-enable: drop the allowlist entry and this test.skip(IS_CI) once the runner
- * degradation is fixed.
*/
import {
@@ -41,9 +33,6 @@ const TARGET = resolveDesktopTarget();
const SMOKE_ENABLED = process.env.OK_DESKTOP_E2E_SMOKE === '1';
const DARWIN = process.platform === 'darwin';
-// Quarantine gate — see the header. Allowlisted in the CI no-skip guard so the
-// skip stays gate-visible.
-const IS_CI = process.env.CI === 'true' || process.env.GITHUB_ACTIONS === 'true';
const DESKTOP_PRODUCT_NAME = '@inkeep/open-knowledge-desktop';
interface SeedOpts {
@@ -203,31 +192,68 @@ async function findEditorWindow(app: ElectronApplication, timeoutMs = 25_000): P
return page;
}
-/** Click the View → Show/Hide Bottom Dock application-menu item (real toggle path
+/** Click the View → Show/Hide Terminal application-menu item (real toggle path
* on desktop — ⌘J is its OS-captured accelerator). Returns the item label. */
-async function clickViewTerminalItem(app: ElectronApplication): Promise<string | false> {
+async function clickViewTerminalItem(app: ElectronApplication): Promise<string> {
return app.evaluate(async ({ Menu }) => {
const menu = Menu.getApplicationMenu();
- if (!menu) return false;
+ if (!menu) throw new Error('application menu is unavailable');
const view = menu.items.find((i) => i.label === 'View');
const item = view?.submenu?.items.find(
- (i) => i.label === 'Show Bottom Dock' || i.label === 'Hide Bottom Dock',
+ (i) => i.label === 'Show Terminal' || i.label === 'Hide Terminal',
);
- if (!item) return false;
+ if (!item) throw new Error('View menu is missing the required Terminal visibility item');
const label = item.label;
item.click();
return label;
});
}
-async function viewTerminalLabel(app: ElectronApplication): Promise<string | null> {
+async function viewTerminalLabel(app: ElectronApplication): Promise<string> {
return app.evaluate(async ({ Menu }) => {
const menu = Menu.getApplicationMenu();
+ if (!menu) throw new Error('application menu is unavailable');
const view = menu?.items.find((i) => i.label === 'View');
const item = view?.submenu?.items.find(
- (i) => i.label === 'Show Bottom Dock' || i.label === 'Hide Bottom Dock',
+ (i) => i.label === 'Show Terminal' || i.label === 'Hide Terminal',
);
- return item?.label ?? null;
+ if (!item) throw new Error('View menu is missing the required Terminal visibility item');
+ return item.label;
+ });
+}
+
+async function terminalPlacementLabel(app: ElectronApplication): Promise<string> {
+ return app.evaluate(async ({ Menu }) => {
+ const menu = Menu.getApplicationMenu();
+ if (!menu) throw new Error('application menu is unavailable');
+ const terminal = menu.items.find((i) => i.label === 'Terminal');
+ const item = terminal?.submenu?.items.find(
+ (i) => i.label === 'Move Terminal to right' || i.label === 'Move Terminal to bottom',
+ );
+ if (!item) throw new Error('Terminal menu is missing the required placement item');
+ return item.label;
+ });
+}
+
+async function clickTerminalPlacementItem(app: ElectronApplication): Promise<void> {
+ await app.evaluate(async ({ Menu }) => {
+ const terminal = Menu.getApplicationMenu()?.items.find((i) => i.label === 'Terminal');
+ const item = terminal?.submenu?.items.find(
+ (i) => i.label === 'Move Terminal to right' || i.label === 'Move Terminal to bottom',
+ );
+ if (!item) throw new Error('Terminal menu is missing the required placement item');
+ item.click();
+ });
+}
+
+async function clickViewAgentsItem(app: ElectronApplication): Promise<void> {
+ await app.evaluate(async ({ Menu }) => {
+ const view = Menu.getApplicationMenu()?.items.find((item) => item.label === 'View');
+ const item = view?.submenu?.items.find(
+ (candidate) => candidate.label === 'Show Agents' || candidate.label === 'Hide Agents',
+ );
+ if (!item) throw new Error('View menu is missing the required Agents visibility item');
+ item.click();
});
}
@@ -238,13 +264,17 @@ const terminalStatus = (page: Page) => page.locator('[data-terminal-status]');
// strict mode. Scope the claude-readiness banner by its stable test seam instead.
const readinessBanner = (page: Page) => page.getByTestId('terminal-readiness-banner');
+async function expectCollapsedRailColumn(page: Page, selector: string): Promise<void> {
+ const column = page.locator(selector);
+ await expect(column).toHaveCount(1);
+ await expect
+ .poll(() => column.evaluate((element) => element.getBoundingClientRect().width))
+ .toBe(0);
+}
+
/** Open the dock (via the real menu toggle) and wait for the panel to mount. */
async function openTerminal(app: ElectronApplication, page: Page): Promise<void> {
- const clicked = await clickViewTerminalItem(app);
- // Fail loud when the menu item is missing — otherwise the click silently
- // no-ops and the failure surfaces 15s later as an unrelated-looking
- // "Terminal section not visible" timeout.
- expect(clicked, 'View menu should expose a Show/Hide Bottom Dock item').not.toBe(false);
+ await clickViewTerminalItem(app);
await expect(terminalSection(page)).toBeVisible({ timeout: 15_000 });
}
@@ -286,14 +316,6 @@ test.describe('Docked terminal — live Electron', () => {
test.skip(!SMOKE_ENABLED, 'Set OK_DESKTOP_E2E_SMOKE=1 to run Electron smoke tests.');
test.skip(!DARWIN, 'Desktop is darwin-only.');
test.skip(!TARGET.exists, TARGET.missingReason);
- // Quarantined on CI (shells exit before "running" on the constrained 6-vCPU
- // runner; passes locally). Tracked via the QUARANTINE_ALLOWLIST in the CI
- // no-skip guard, not hidden.
- test.skip(
- IS_CI,
- 'Quarantined on CI: terminal-dock degrades on the constrained runner — see inkeep/agents-private#2187.',
- );
-
test.afterEach(() => {
for (const target of cleanup.splice(0)) {
try {
@@ -381,17 +403,136 @@ test.describe('Docked terminal — live Electron', () => {
captureStderrFor(app, { cleanupDirs: [s.tmpHome, s.projectDir] });
const page = await findEditorWindow(app);
- expect(await viewTerminalLabel(app)).toBe('Show Bottom Dock');
+ expect(await viewTerminalLabel(app)).toBe('Show Terminal');
await clickViewTerminalItem(app);
await expect(terminalSection(page)).toBeVisible({ timeout: 15_000 });
- await expect.poll(() => viewTerminalLabel(app), { timeout: 8_000 }).toBe('Hide Bottom Dock');
+ await expect.poll(() => viewTerminalLabel(app), { timeout: 8_000 }).toBe('Hide Terminal');
await clickViewTerminalItem(app);
- await expect.poll(() => viewTerminalLabel(app), { timeout: 8_000 }).toBe('Show Bottom Dock');
+ await expect.poll(() => viewTerminalLabel(app), { timeout: 8_000 }).toBe('Show Terminal');
+ });
+
+ test('native Terminal placement action follows the current home', async ({
+ captureStderrFor,
+ }) => {
+ const s = seed('placement-menu', { consent: true });
+ track(s.tmpHome, s.projectDir);
+ const app = await launchApp(s);
+ captureStderrFor(app, { cleanupDirs: [s.tmpHome, s.projectDir] });
+ await findEditorWindow(app);
+
+ expect(await terminalPlacementLabel(app)).toBe('Move Terminal to right');
+ await clickTerminalPlacementItem(app);
+ await expect
+ .poll(() => terminalPlacementLabel(app), { timeout: 8_000 })
+ .toBe('Move Terminal to bottom');
+
+ await clickTerminalPlacementItem(app);
+ await expect
+ .poll(() => terminalPlacementLabel(app), { timeout: 8_000 })
+ .toBe('Move Terminal to right');
});
- // Toggle completes within the perceptual-instant budget.
- test('QA-022 toggle flips visibility within 150ms budget', async ({ captureStderrFor }) => {
+ test('Terminal header placement is symmetric and clears the Agents reveal tab', async ({
+ captureStderrFor,
+ }) => {
+ const s = seed('header-placement', { consent: true });
+ track(s.tmpHome, s.projectDir);
+ const app = await launchApp(s);
+ captureStderrFor(app, { cleanupDirs: [s.tmpHome, s.projectDir] });
+ const page = await findEditorWindow(app);
+
+ const editorWindow = await app.browserWindow(page);
+ await editorWindow.evaluate((win: unknown) => {
+ const target = win as { setSize: (width: number, height: number, animate: boolean) => void };
+ target.setSize(1900, 900, false);
+ });
+ await expect.poll(() => page.evaluate(() => window.innerWidth)).toBeGreaterThanOrEqual(1800);
+ await openTerminal(app, page);
+
+ const moveRightButton = page.getByRole('button', { name: 'Move Terminal to right' });
+ await expect(moveRightButton).toBeVisible();
+ await moveRightButton.click();
+ await expect(page.locator('#terminal-column section[aria-label="Terminal"]')).toBeVisible({
+ timeout: 10_000,
+ });
+
+ const moveBottomButton = page.getByRole('button', { name: 'Move Terminal to bottom' });
+ const collapseButton = page.getByRole('button', { name: 'Collapse Terminal' });
+ const revealAgentsButton = page.getByRole('button', { name: 'Open agents panel' });
+ await expect(moveBottomButton).toBeVisible();
+ await expect(collapseButton).toBeVisible();
+ await expect(revealAgentsButton).toBeVisible();
+ const [moveBottomBox, collapseBox, revealAgentsBox] = await Promise.all([
+ moveBottomButton.boundingBox(),
+ collapseButton.boundingBox(),
+ revealAgentsButton.boundingBox(),
+ ]);
+ if (!moveBottomBox || !collapseBox || !revealAgentsBox) {
+ throw new Error('terminal rail controls did not produce measurable geometry');
+ }
+ expect(
+ Math.max(moveBottomBox.x + moveBottomBox.width, collapseBox.x + collapseBox.width),
+ ).toBeLessThanOrEqual(revealAgentsBox.x);
+ });
+
+ test('right Terminal and Agents exclude each other only when the window is infeasible', async ({
+ captureStderrFor,
+ }) => {
+ const s = seed('rail-admission', { consent: true, skipRestoreState: true });
+ track(s.tmpHome, s.projectDir);
+ const app = await launchApp(s);
+ captureStderrFor(app, { cleanupDirs: [s.tmpHome, s.projectDir] });
+ const page = await findEditorWindow(app);
+
+ const editorWindow = await app.browserWindow(page);
+ await editorWindow.evaluate((win: unknown) => {
+ const target = win as { setSize: (width: number, height: number, animate: boolean) => void };
+ target.setSize(1900, 900, false);
+ });
+ await expect.poll(() => page.evaluate(() => window.innerWidth)).toBeGreaterThanOrEqual(1800);
+ await openTerminal(app, page);
+ await clickTerminalPlacementItem(app);
+ await expect(page.locator('#terminal-column section[aria-label="Terminal"]')).toBeVisible({
+ timeout: 10_000,
+ });
+ await clickViewAgentsItem(app);
+ await expect(page.locator('#agents-column')).toBeVisible({ timeout: 10_000 });
+ await expect
+ .poll(() =>
+ page
+ .locator('#terminal-column')
+ .evaluate((element) => element.getBoundingClientRect().width),
+ )
+ .toBeGreaterThan(739);
+ await waitForStatus(page, 'running', 25_000);
+ await typeInTerminal(page, 'echo RAIL_COLS=$(tput cols)\r');
+ await expect.poll(() => readTerminalText(page), { timeout: 15_000 }).toMatch(/RAIL_COLS=\d+/);
+ const columns = (await readTerminalText(page)).match(/RAIL_COLS=(\d+)/)?.[1];
+ expect(Number(columns)).toBeGreaterThanOrEqual(92);
+
+ await editorWindow.evaluate((win: unknown) => {
+ const target = win as { setSize: (width: number, height: number, animate: boolean) => void };
+ target.setSize(900, 900, false);
+ });
+ await expect.poll(() => page.evaluate(() => window.innerWidth)).toBeLessThan(1000);
+ await expectCollapsedRailColumn(page, '#agents-column');
+ await expect(page.locator('#terminal-column section[aria-label="Terminal"]')).toBeVisible();
+ await expect(page.getByText('Agent panel closed to keep Terminal readable.')).toBeVisible();
+
+ await clickViewAgentsItem(app);
+ await expect(page.locator('#agents-column')).toBeVisible({ timeout: 10_000 });
+ await expect(page.getByText('Terminal closed to make room for the agent panel.')).toBeVisible();
+ await expectCollapsedRailColumn(page, '#terminal-column');
+
+ await clickViewAgentsItem(app);
+ await expectCollapsedRailColumn(page, '#agents-column');
+ await expectCollapsedRailColumn(page, '#terminal-column');
+ });
+
+ // The menu-to-mount path stays responsive; the 150ms visual transition is
+ // cosmetic and is not part of this assertion.
+ test('QA-022 toggle mounts within 2 seconds', async ({ captureStderrFor }) => {
const s = seed('perf', { consent: true });
track(s.tmpHome, s.projectDir);
const app = await launchApp(s);
@@ -408,7 +549,7 @@ test.describe('Docked terminal — live Electron', () => {
const elapsed = await page.evaluate((start) => performance.now() - start, t0);
// Generous ceiling: IPC round-trip (menu→main→renderer) + synchronous flip.
// The visual transition (150ms) is cosmetic; we measure mount, not animation.
- expect(elapsed).toBeLessThan(1000);
+ expect(elapsed).toBeLessThan(2000);
});
// Terminal opens at the project root and runs an arbitrary command.
@@ -479,10 +620,10 @@ test.describe('Docked terminal — live Electron', () => {
.toContain(`AFTER_COLS=${before}`);
});
- // Dock controls in the live build: collapse is the only chrome. The terminal
- // owns the bottom edge, so there is no dock-toggle (and the older drag grip
- // stays gone).
- test('terminal tab strip exposes the collapse button and no way to move the dock', async ({
+ // Dock controls in the live build keep the explicit Terminal collapse name.
+ // Placement now lives in the contextual/native actions, while the old direct
+ // dock-toggle and drag grip stay gone.
+ test('terminal tab strip exposes collapse without legacy dock chrome', async ({
captureStderrFor,
}) => {
const s = seed('dock-controls', { consent: true });
@@ -492,7 +633,7 @@ test.describe('Docked terminal — live Electron', () => {
const page = await findEditorWindow(app);
await openTerminal(app, page);
await waitForStatus(page, 'running', 25_000);
- await expect(page.getByRole('button', { name: 'Collapse panel' })).toBeVisible({
+ await expect(page.getByRole('button', { name: 'Collapse Terminal' })).toBeVisible({
timeout: 10_000,
});
await expect(page.getByRole('button', { name: /Dock terminal to the/ })).toHaveCount(0);
@@ -541,7 +682,7 @@ test.describe('Docked terminal — live Electron', () => {
// Escape is delivered to the terminal (NOT swallowed): terminal apps
// (vim, the `claude` TUI) need it. The no-keyboard-trap exit (WCAG 2.1.2) is
- // ⌘J — the View → Hide Bottom Dock toggle — which collapses the dock and returns
+ // ⌘J — the View → Hide Terminal toggle — which collapses the dock and returns
// focus to the editor.
test('QA-019 Escape reaches the terminal; ⌘J is the no-trap exit', async ({
captureStderrFor,
@@ -602,17 +743,17 @@ test.describe('Docked terminal — live Electron', () => {
await page.locator('section[aria-label="Terminal"] .xterm').click();
await expect.poll(focusInTerminal).toBe(true);
- expect(await viewTerminalLabel(app)).toBe('Hide Bottom Dock');
+ expect(await viewTerminalLabel(app)).toBe('Hide Terminal');
// The chord under test, pressed with the pty holding focus.
await page.keyboard.press('Control+Backquote');
- await expect.poll(() => viewTerminalLabel(app), { timeout: 8_000 }).toBe('Show Bottom Dock');
+ await expect.poll(() => viewTerminalLabel(app), { timeout: 8_000 }).toBe('Show Terminal');
await expect.poll(focusInTerminal).toBe(false);
// It toggles rather than open-only (VS Code / Zed convention), so the same
// chord brings the dock back.
await page.keyboard.press('Control+Backquote');
- await expect.poll(() => viewTerminalLabel(app), { timeout: 8_000 }).toBe('Hide Bottom Dock');
+ await expect.poll(() => viewTerminalLabel(app), { timeout: 8_000 }).toBe('Hide Terminal');
});
// Collapsed panel is inert and focus returns to the editor on collapse.
@@ -657,40 +798,41 @@ test.describe('Docked terminal — live Electron', () => {
await waitForStatus(page, 'running', 25_000);
await ensureBottomDock(page);
- const heightBefore = await page
- .locator('#terminal-dock-panel')
- .evaluate((el) => el.getBoundingClientRect().height);
+ const panel = page.locator('#terminal-dock-panel');
+ const heightBefore = await panel.evaluate((el) => el.getBoundingClientRect().height);
// Drag the resize handle upward to grow the panel.
- const handle = page.locator('[data-panel-resize-handle-id], [role="separator"]').last();
+ const handle = panel.locator('xpath=preceding-sibling::*[@role="separator"][1]');
+ await expect(handle).toBeVisible();
const box = await handle.boundingBox();
- if (box) {
- await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2);
- await page.mouse.down();
- await page.mouse.move(box.x + box.width / 2, box.y - 120, { steps: 8 });
- await page.mouse.up();
- }
- await page.waitForTimeout(300); // debounced persist (100ms) + settle
+ if (box == null) throw new Error('bottom terminal resize handle has no bounding box');
+ await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2);
+ await page.mouse.down();
+ await page.mouse.move(box.x + box.width / 2, box.y - 160, { steps: 12 });
+ await page.mouse.up();
- const heightAfter = await page
- .locator('#terminal-dock-panel')
- .evaluate((el) => el.getBoundingClientRect().height);
- expect(heightAfter).toBeGreaterThan(heightBefore);
+ await expect
+ .poll(() => panel.evaluate((el) => el.getBoundingClientRect().height))
+ .toBeGreaterThan(heightBefore);
+
+ const heightAfter = await panel.evaluate((el) => el.getBoundingClientRect().height);
// localStorage carries the persisted height.
- const stored = await page.evaluate(() => localStorage.getItem('ok-terminal-height-v1'));
- expect(stored).not.toBeNull();
+ await expect
+ .poll(() => page.evaluate(() => Number(localStorage.getItem('ok-terminal-height-v1') ?? 0)))
+ .toBeGreaterThan(heightBefore);
// Hide + reopen: reopens at the persisted (grown) height.
await clickViewTerminalItem(app);
- await page.waitForTimeout(200);
+ await expect(panel).toHaveAttribute('inert', '', { timeout: 10_000 });
await clickViewTerminalItem(app);
await expect(terminalSection(page)).toBeVisible({ timeout: 10_000 });
- await page.waitForTimeout(300);
- const heightReopen = await page
- .locator('#terminal-dock-panel')
- .evaluate((el) => el.getBoundingClientRect().height);
- expect(Math.abs(heightReopen - heightAfter)).toBeLessThan(40);
+ await expect
+ .poll(async () => {
+ const heightReopen = await panel.evaluate((el) => el.getBoundingClientRect().height);
+ return Math.abs(heightReopen - heightAfter);
+ })
+ .toBeLessThan(40);
});
// Shell exit shows a visible state + Restart respawns; the
@@ -819,21 +961,16 @@ test.describe('Docked terminal — live Electron', () => {
.toContain('marker=[OKRELOAD_SURVIVED_351]');
});
- // ⌘J/⇧⌘J selection-send at the live-Electron rung: a REAL editor
- // selection is staged into a REAL CLI PTY — the composed flow the dom tests
- // pin only in slices (EditorPane decides against a mocked host; the host
- // stages against a mocked TerminalGate; here every layer between the keydown
- // and the PTY bytes is real). The fake `claude` is a TUI stand-in (`exec cat`)
- // that holds the PTY open reading stdin, so the staged bytes stay observable
- // in xterm. Residual only a live-claude run can pin: the real TUI treating
- // the trailing soft newlines as caret-move, not submit.
- test('⇧⌘J stages the editor selection into a new CLI tab; ⌘J (menu route) reuses it', async ({
+ // Shortcut behavior at the live-Electron rung: ⇧⌘J stages a REAL editor
+ // selection into a REAL CLI PTY, then the View-menu route proves ⌘J remains a
+ // pure visibility toggle even while another selection is live. The fake
+ // `claude` is a TUI stand-in (`exec cat`) that holds the PTY open reading
+ // stdin, so staged bytes and session survival stay observable in xterm.
+ test('⇧⌘J stages into a new CLI tab; ⌘J stays a pure visibility toggle', async ({
captureStderrFor,
}) => {
- // Two-phase scenario (stage into a NEW CLI tab, then reuse the running one
- // via the menu route) walks doc-load + launch + two staged writes, so its
- // cumulative inner timeouts (~170s) exceed the suite's 150s CI outer budget
- // — opt into a per-test budget per the calibration invariant's mechanism.
+ // This composed flow walks doc-load + launch + staged write + menu delivery,
+ // so opt into a budget above the suite's 150s default.
test.setTimeout(200_000);
// skipRestoreState: with a state.json restore the cold-start window wins and
// lands on the empty state, dropping the deep-link's `doc=` (and its collab
@@ -845,6 +982,14 @@ test.describe('Docked terminal — live Electron', () => {
captureStderrFor(app, { cleanupDirs: [s.tmpHome, s.projectDir] });
const page = await findEditorWindow(app);
+ // The shortcut targets the user's preferred AI. Pin that preference to the
+ // fake Claude CLI supplied by this fixture so host-machine agent settings
+ // cannot redirect the request into the Agents panel.
+ await page.evaluate(() => {
+ localStorage.setItem('ok-ask-ai-agent-v2', 'terminal-cli:claude');
+ window.dispatchEvent(new StorageEvent('storage', { key: 'ok-ask-ai-agent-v2' }));
+ });
+
// Select the seeded doc's body in the real editor (ProseMirror select-all).
// The selection-context registry publishes on a 120ms debounce
// (SELECTION_STATS_DEBOUNCE_MS) — wait it out before firing the chord, or
@@ -877,10 +1022,8 @@ test.describe('Docked terminal — live Electron', () => {
// Grow the doc with a distinguishing marker and re-select, then take the ⌘J
// route via its View-menu accelerator item (the real menu→IPC→renderer
- // chain; the raw OS key capture itself is not synthesizable from Playwright,
- // same class as the deep-link Apple-Event limitation). With a selection and
- // the active tab a running CLI, the passage is written INTO that CLI —
- // the dock must not toggle away and no second tab may open.
+ // chain; raw OS key capture is not synthesizable from Playwright). A live
+ // selection must not change the toggle contract or leak into the PTY.
await editor.click();
await page.keyboard.press('Meta+a');
await page.keyboard.type('Reuse marker OKSTAGE_REUSE_742 body');
@@ -889,11 +1032,16 @@ test.describe('Docked terminal — live Electron', () => {
.poll(() => page.evaluate(() => String(window.getSelection() ?? '')))
.toContain('OKSTAGE_REUSE_742');
await page.waitForTimeout(500);
- await clickViewTerminalItem(app);
- await expect
- .poll(() => readTerminalText(page), { timeout: 15_000 })
- .toContain('OKSTAGE_REUSE_742');
+
+ expect(await clickViewTerminalItem(app)).toBe('Hide Terminal');
+ await expect(terminalSection(page)).toBeHidden();
+ await expect.poll(() => viewTerminalLabel(app), { timeout: 8_000 }).toBe('Show Terminal');
+
+ expect(await clickViewTerminalItem(app)).toBe('Show Terminal');
await expect(terminalSection(page)).toBeVisible();
+ await waitForStatus(page, 'running', 25_000);
expect(await terminalTabs().count()).toBe(tabsAfterLaunch);
+ expect(await readTerminalText(page)).toContain('Seed document');
+ expect(await readTerminalText(page)).not.toContain('OKSTAGE_REUSE_742');
});
});
diff --git a/packages/desktop/tests/smoke/terminal-links.e2e.ts b/packages/desktop/tests/smoke/terminal-links.e2e.ts
index 8244e5065..aa7ae1ee9 100644
--- a/packages/desktop/tests/smoke/terminal-links.e2e.ts
+++ b/packages/desktop/tests/smoke/terminal-links.e2e.ts
@@ -13,11 +13,6 @@
*
* Skip gates mirror the sibling terminal smokes: opt-in via OK_DESKTOP_E2E_SMOKE=1,
* darwin-only, and the electron-vite build must exist (out/main/index.js).
- *
- * QUARANTINED ON CI (test.skip(IS_CI)): same live-Electron terminal surface +
- * constrained-runner degradation as terminal-dock (shells exit before "running"
- * after a few launches on the 6-vCPU runner). Allowlisted in the CI no-skip guard
- * (QUARANTINE_ALLOWLIST); tracked in inkeep/agents-private#2187.
*/
import { chmodSync, mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
@@ -32,7 +27,6 @@ const TARGET = resolveDesktopTarget();
const SMOKE_ENABLED = process.env.OK_DESKTOP_E2E_SMOKE === '1';
const DARWIN = process.platform === 'darwin';
-const IS_CI = process.env.CI === 'true' || process.env.GITHUB_ACTIONS === 'true';
const DESKTOP_PRODUCT_NAME = '@inkeep/open-knowledge-desktop';
interface Seed {
@@ -114,18 +108,18 @@ async function findEditorWindow(app: ElectronApplication, timeoutMs = 25_000): P
return page;
}
-/** Open the terminal via the View menu, bottom-dock it, and wait for a live shell. */
+/** Open the terminal via the View menu and wait for a live shell. */
async function openRunningTerminal(app: ElectronApplication, page: Page): Promise<void> {
const label = await app.evaluate(async ({ Menu }) => {
const view = Menu.getApplicationMenu()?.items.find((i) => i.label === 'View');
const item = view?.submenu?.items.find(
- (i) => i.label === 'Show Bottom Dock' || i.label === 'Hide Bottom Dock',
+ (i) => i.label === 'Show Terminal' || i.label === 'Hide Terminal',
);
- if (!item) return false;
- if (item.label === 'Show Bottom Dock') item.click();
+ if (!item) throw new Error('View menu is missing the required Terminal visibility item');
+ if (item.label === 'Show Terminal') item.click();
return item.label;
});
- expect(label).toBeTruthy();
+ expect(label).toMatch(/^(Show|Hide) Terminal$/);
await expect(page.locator('section[aria-label="Terminal"]')).toBeVisible({ timeout: 15_000 });
// The terminal is bottom-docked outright now, so it is already wide enough for
// a printed URL to render on one row — which the link-click assertions need.
@@ -153,16 +147,21 @@ async function runInTerminal(page: Page, command: string, marker: string): Promi
/**
* Click the last rendered occurrence of `linkText` in the terminal. xterm's DOM
* renderer paints each glyph run as a span; the printed token (URL / path) is a
- * contiguous run, so clicking that span's box lands on the link's cells and
- * triggers xterm's link activation.
+ * contiguous run, so its box identifies the link's cells. Pointer events land
+ * on xterm's screen element rather than the paint-only span, so drive the mouse
+ * at the physical coordinates instead of asking Playwright to click the span.
*/
async function clickTerminalLink(page: Page, linkText: string): Promise<void> {
const span = page
.locator('section[aria-label="Terminal"] .xterm-rows span', { hasText: linkText })
.last();
await span.scrollIntoViewIfNeeded();
- await span.hover();
- await span.click();
+ const box = await span.boundingBox();
+ if (box == null) throw new Error(`terminal link ${JSON.stringify(linkText)} has no layout box`);
+ const x = box.x + box.width / 2;
+ const y = box.y + box.height / 2;
+ await page.mouse.move(x, y);
+ await page.mouse.click(x, y);
}
/** Replace `shell.openExternal` in main with a recorder (no real browser opens). */
@@ -192,11 +191,6 @@ test.describe('Terminal clickable links — live Electron', () => {
!SMOKE_ENABLED || !DARWIN || !TARGET.exists,
`Live-Electron smoke: set OK_DESKTOP_E2E_SMOKE=1 on darwin. ${TARGET.missingReason}`,
);
- test.skip(
- IS_CI,
- 'Quarantined on CI: live-Electron terminal smoke degrades on the constrained runner (see inkeep/agents-private#2187).',
- );
-
test.afterAll(() => {
for (const p of cleanup.splice(0)) rmSync(p, { recursive: true, force: true });
});
diff --git a/packages/desktop/tests/smoke/terminal-movement.e2e.ts b/packages/desktop/tests/smoke/terminal-movement.e2e.ts
new file mode 100644
index 000000000..509a68345
--- /dev/null
+++ b/packages/desktop/tests/smoke/terminal-movement.e2e.ts
@@ -0,0 +1,520 @@
+import { randomUUID } from 'node:crypto';
+import { mkdirSync, mkdtempSync, realpathSync, writeFileSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import { join } from 'node:path';
+import type { ElectronApplication, Page } from '@playwright/test';
+import { _electron as electron } from '@playwright/test';
+import { desktopLaunchOptions, resolveDesktopTarget } from './_helpers/launch-desktop';
+import { expect, test } from './_helpers/smoke-test';
+
+const TARGET = resolveDesktopTarget();
+const SMOKE_ENABLED = process.env.OK_DESKTOP_E2E_SMOKE === '1';
+const DARWIN = process.platform === 'darwin';
+const DESKTOP_PRODUCT_NAME = '@inkeep/open-knowledge-desktop';
+
+type TerminalHome = 'bottom' | 'right';
+
+interface Seed {
+ tmpHome: string;
+ userDataDir: string;
+ projectDir: string;
+}
+
+function seed({ skipRestoreState = false }: { skipRestoreState?: boolean } = {}): Seed {
+ const tmpHome = realpathSync(mkdtempSync(join(tmpdir(), 'ok-terminal-movement-home-')));
+ const projectDir = realpathSync(mkdtempSync(join(tmpdir(), 'ok-terminal-movement-project-')));
+ mkdirSync(join(projectDir, '.ok', 'local'), { recursive: true });
+ writeFileSync(join(projectDir, '.ok', 'config.yml'), "content:\n dir: '.'\n");
+ writeFileSync(join(projectDir, '.ok', 'local', 'config.yml'), 'terminal:\n enabled: true\n');
+ writeFileSync(join(projectDir, 'start.md'), '# Start\n\nTerminal movement smoke.\n');
+ writeFileSync(join(tmpHome, '.zprofile'), 'export PATH="/usr/bin:/bin:/usr/sbin:/sbin"\n');
+ writeFileSync(join(tmpHome, '.zshrc'), 'export PATH="/usr/bin:/bin:/usr/sbin:/sbin"\n');
+
+ const userDataDir = join(tmpHome, 'Library', 'Application Support', DESKTOP_PRODUCT_NAME);
+ mkdirSync(userDataDir, { recursive: true });
+ if (!skipRestoreState) {
+ writeFileSync(
+ join(userDataDir, 'state.json'),
+ JSON.stringify({
+ recentProjects: [
+ {
+ path: projectDir,
+ name: 'Terminal Movement Smoke',
+ lastOpenedAt: new Date().toISOString(),
+ },
+ ],
+ lastOpenedProject: projectDir,
+ versionPendingInstall: null,
+ lastSeenVersion: null,
+ lastSuccessfulCheckAt: null,
+ stuckHintShown: false,
+ }),
+ );
+ }
+
+ return { tmpHome, userDataDir, projectDir };
+}
+
+async function launchApp(s: Seed): Promise<ElectronApplication> {
+ const deepLink = `openknowledge://open?project=${encodeURIComponent(s.projectDir)}&doc=start`;
+ return electron.launch(
+ desktopLaunchOptions({
+ target: TARGET,
+ args: [`--user-data-dir=${s.userDataDir}`, deepLink],
+ timeout: 30_000,
+ env: {
+ ...process.env,
+ HOME: s.tmpHome,
+ PATH: '/usr/bin:/bin:/usr/sbin:/sbin',
+ SHELL: '/bin/zsh',
+ OK_DESKTOP_E2E_SMOKE: '1',
+ OK_RECLAIM_DISABLE: '1',
+ },
+ }),
+ );
+}
+
+async function findEditorWindow(app: ElectronApplication, timeoutMs = 25_000): Promise<Page> {
+ let page: Page | undefined;
+ await expect(async () => {
+ for (const candidate of app.windows()) {
+ const mode = await candidate
+ .evaluate(() => window.okDesktop?.config?.mode)
+ .catch(() => undefined);
+ if (mode === 'editor') {
+ page = candidate;
+ return;
+ }
+ }
+ throw new Error('no editor window yet');
+ }).toPass({ timeout: timeoutMs });
+ if (!page) throw new Error('editor window vanished after readiness poll');
+ return page;
+}
+
+async function clickViewTerminalItem(app: ElectronApplication): Promise<void> {
+ await app.evaluate(async ({ Menu }) => {
+ const view = Menu.getApplicationMenu()?.items.find((item) => item.label === 'View');
+ const terminal = view?.submenu?.items.find(
+ (item) => item.label === 'Show Terminal' || item.label === 'Hide Terminal',
+ );
+ if (!terminal) throw new Error('View menu is missing the required Terminal visibility item');
+ terminal.click();
+ });
+}
+
+async function clickViewAgentsItem(app: ElectronApplication): Promise<void> {
+ await app.evaluate(async ({ Menu }) => {
+ const view = Menu.getApplicationMenu()?.items.find((item) => item.label === 'View');
+ const item = view?.submenu?.items.find(
+ (candidate) => candidate.label === 'Show Agents' || candidate.label === 'Hide Agents',
+ );
+ if (!item) throw new Error('View menu is missing the required Agents visibility item');
+ item.click();
+ });
+}
+
+async function clickTerminalPlacementItem(app: ElectronApplication): Promise<void> {
+ await app.evaluate(async ({ Menu }) => {
+ const terminal = Menu.getApplicationMenu()?.items.find((item) => item.label === 'Terminal');
+ const placement = terminal?.submenu?.items.find(
+ (item) => item.label === 'Move Terminal to right' || item.label === 'Move Terminal to bottom',
+ );
+ if (!placement) throw new Error('Terminal menu is missing the required placement item');
+ placement.click();
+ });
+}
+
+async function clickTerminalPlacementItemRapidly(
+ app: ElectronApplication,
+ count: number,
+): Promise<void> {
+ await app.evaluate(async ({ Menu }, clickCount) => {
+ const terminal = Menu.getApplicationMenu()?.items.find((item) => item.label === 'Terminal');
+ const placement = terminal?.submenu?.items.find(
+ (item) => item.label === 'Move Terminal to right' || item.label === 'Move Terminal to bottom',
+ );
+ if (!placement) throw new Error('Terminal menu is missing the required placement item');
+ for (let index = 0; index < clickCount; index += 1) placement.click();
+ }, count);
+}
+
+const visibleTerminal = (page: Page) => page.locator('section[aria-label="Terminal"]:visible');
+const terminalTabs = (page: Page) =>
+ page.getByRole('tablist', { name: 'Terminal sessions' }).getByRole('tab');
+
+async function openTerminal(app: ElectronApplication, page: Page): Promise<void> {
+ await clickViewTerminalItem(app);
+ await expect(visibleTerminal(page)).toBeVisible({ timeout: 15_000 });
+ await expect(visibleTerminal(page).locator('[data-terminal-status]')).toHaveAttribute(
+ 'data-terminal-status',
+ 'running',
+ { timeout: 25_000 },
+ );
+}
+
+async function openBareTab(page: Page): Promise<void> {
+ await page.getByTestId('terminal-new-chat-menu').click();
+ await page.getByRole('menuitem', { name: 'Terminal' }).click();
+ await expect(visibleTerminal(page).locator('[data-terminal-status]')).toHaveAttribute(
+ 'data-terminal-status',
+ 'running',
+ { timeout: 25_000 },
+ );
+}
+
+async function typeInActiveTerminal(page: Page, text: string): Promise<void> {
+ await visibleTerminal(page).locator('.xterm').click();
+ await page.keyboard.type(text);
+}
+
+async function readActiveTerminal(page: Page): Promise<string> {
+ return visibleTerminal(page).evaluate((section) => {
+ const accessibility = section.querySelector('.xterm-accessibility')?.textContent ?? '';
+ const rows = section.querySelector('.xterm-rows')?.textContent ?? '';
+ return `${accessibility}\n${rows}`;
+ });
+}
+
+async function readScrollbackContaining(page: Page, marker: string): Promise<string> {
+ const terminal = visibleTerminal(page).locator('.xterm');
+ await terminal.hover();
+ for (let pageIndex = 0; pageIndex < 20; pageIndex += 1) {
+ const text = await readActiveTerminal(page);
+ if (text.includes(marker)) return text;
+ await page.mouse.wheel(0, -10_000);
+ }
+ const text = await readActiveTerminal(page);
+ if (text.includes(marker)) return text;
+ throw new Error(`Terminal scrollback is missing ${marker}: ${text}`);
+}
+
+function waitForTerminalHome(page: Page, home: TerminalHome): Promise<number> {
+ return page.evaluate((targetHome) => {
+ return new Promise<number>((resolve, reject) => {
+ const startedAt = performance.now();
+ const activeSelector =
+ targetHome === 'right'
+ ? '#terminal-column section[aria-label="Terminal"]'
+ : '#terminal-dock-panel section[aria-label="Terminal"]';
+ const inactiveSelector =
+ targetHome === 'right'
+ ? '#terminal-dock-panel section[aria-label="Terminal"]'
+ : '#terminal-column section[aria-label="Terminal"]';
+ let frame = 0;
+ const timeout = window.setTimeout(() => {
+ window.cancelAnimationFrame(frame);
+ reject(new Error(`Terminal did not settle at ${targetHome}`));
+ }, 5_000);
+
+ const inspect = () => {
+ const active = [...document.querySelectorAll(activeSelector)].find((candidate) => {
+ const rect = candidate.getBoundingClientRect();
+ return rect.width > 0 && rect.height > 0;
+ });
+ const inactive = document.querySelector(inactiveSelector);
+ const text = active?.querySelector('.xterm-rows')?.textContent ?? '';
+ const rect = active?.getBoundingClientRect();
+ if (active && !inactive && rect && rect.width > 0 && rect.height > 0 && text.length > 0) {
+ window.clearTimeout(timeout);
+ resolve(performance.now() - startedAt);
+ return;
+ }
+ frame = window.requestAnimationFrame(inspect);
+ };
+
+ frame = window.requestAnimationFrame(inspect);
+ });
+ }, home);
+}
+
+async function moveTerminal(
+ app: ElectronApplication,
+ page: Page,
+ home: TerminalHome,
+): Promise<number> {
+ const settlement = waitForTerminalHome(page, home);
+ await clickTerminalPlacementItem(app);
+ return settlement;
+}
+
+async function readShellPid(page: Page, marker: string): Promise<number> {
+ await typeInActiveTerminal(page, `printf '${marker}=%s\\n' "$$"\r`);
+ let processId = 0;
+ await expect
+ .poll(
+ async () => {
+ const matches = [
+ ...(await readActiveTerminal(page)).matchAll(new RegExp(`${marker}=(\\d+)`, 'g')),
+ ];
+ processId = Number(matches.at(-1)?.[1] ?? 0);
+ return processId;
+ },
+ { timeout: 15_000 },
+ )
+ .toBeGreaterThan(0);
+ return processId;
+}
+
+async function dragTabOnto(page: Page, fromName: string, toName: string): Promise<void> {
+ const from = await page.getByRole('tab', { name: fromName }).boundingBox();
+ const to = await page.getByRole('tab', { name: toName }).boundingBox();
+ if (!from || !to) throw new Error(`tab bounding box missing (${fromName} -> ${toName})`);
+ await page.mouse.move(from.x + from.width / 2, from.y + from.height / 2);
+ await page.mouse.down();
+ await page.mouse.move(from.x + from.width / 2 + 14, from.y + from.height / 2, { steps: 4 });
+ await page.mouse.move(to.x + to.width / 2, to.y + to.height / 2, { steps: 12 });
+ await page.mouse.up();
+}
+
+async function growRightTerminal(page: Page, deltaPx: number): Promise<number> {
+ const column = page.locator('#terminal-column');
+ const before = await column.evaluate((element) => element.getBoundingClientRect().width);
+ const handle = await column.evaluate((element) => {
+ const rect = element.previousElementSibling?.getBoundingClientRect();
+ return rect == null ? null : { x: rect.x, y: rect.y, width: rect.width, height: rect.height };
+ });
+ if (!handle) throw new Error('right Terminal resize handle is unavailable');
+ await page.mouse.move(handle.x + handle.width / 2, handle.y + handle.height / 2);
+ await page.mouse.down();
+ await page.mouse.move(handle.x - deltaPx, handle.y + handle.height / 2, { steps: 12 });
+ await page.mouse.up();
+ await expect
+ .poll(() => column.evaluate((element) => element.getBoundingClientRect().width))
+ .toBeGreaterThan(before + deltaPx / 2);
+ return column.evaluate((element) => element.getBoundingClientRect().width);
+}
+
+async function expectCollapsedRailColumn(page: Page, selector: string): Promise<void> {
+ const column = page.locator(selector);
+ await expect(column).toHaveCount(1);
+ await expect
+ .poll(() => column.evaluate((element) => element.getBoundingClientRect().width))
+ .toBe(0);
+}
+
+test.describe('Terminal placement continuity — live Electron', () => {
+ test.skip(!SMOKE_ENABLED, 'Set OK_DESKTOP_E2E_SMOKE=1 to run Electron smoke tests.');
+ test.skip(!DARWIN, 'Desktop is darwin-only.');
+ test.skip(!TARGET.exists, TARGET.missingReason);
+
+ test('moving a populated terminal preserves every live session', async ({ captureStderrFor }) => {
+ // The static calibration parser totals 225s of sequential condition
+ // budgets; the 240s outer budget leaves 15s for untimed interaction work.
+ test.setTimeout(240_000);
+ const s = seed();
+ const app = await launchApp(s);
+ captureStderrFor(app, { cleanupDirs: [s.tmpHome, s.projectDir] });
+ const page = await findEditorWindow(app);
+ const editorWindow = await app.browserWindow(page);
+ await editorWindow.evaluate((windowHandle: unknown) => {
+ const target = windowHandle as {
+ setSize: (width: number, height: number, animate: boolean) => void;
+ };
+ target.setSize(1900, 900, false);
+ });
+ await expect.poll(() => page.evaluate(() => window.innerWidth)).toBeGreaterThanOrEqual(1800);
+
+ await openTerminal(app, page);
+ await openBareTab(page);
+ await expect(terminalTabs(page)).toHaveText(['Terminal 1', 'Terminal 2']);
+ await expect(page.getByRole('tab', { name: 'Terminal 2' })).toHaveAttribute(
+ 'aria-selected',
+ 'true',
+ );
+
+ const token = randomUUID().replaceAll('-', '');
+ const processMarker = `PROCESS_${token}`;
+ const sentinel = `SENTINEL_${token}`;
+ const scrollStart = `SCROLL_START_${token}`;
+ const processId = await readShellPid(page, processMarker);
+ await typeInActiveTerminal(
+ page,
+ `printf '${sentinel}\\n${scrollStart}\\n'; i=1; while [ "$i" -le 120 ]; do printf 'SCROLL_${token}_%03d\\n' "$i"; i=$((i+1)); done\r`,
+ );
+ await expect
+ .poll(() => readActiveTerminal(page), { timeout: 15_000 })
+ .toContain(`SCROLL_${token}_120`);
+ expect(await readScrollbackContaining(page, sentinel)).toContain(scrollStart);
+
+ const toRightMs = await moveTerminal(app, page, 'right');
+ expect(toRightMs).toBeLessThan(300);
+ await expect(terminalTabs(page)).toHaveText(['Terminal 1', 'Terminal 2']);
+ await expect(page.getByRole('tab', { name: 'Terminal 2' })).toHaveAttribute(
+ 'aria-selected',
+ 'true',
+ );
+ expect(await readScrollbackContaining(page, sentinel)).toContain(scrollStart);
+ expect(await readShellPid(page, processMarker)).toBe(processId);
+ const rightOutput = `RIGHT_OUTPUT_${token}`;
+ await typeInActiveTerminal(page, `printf '${rightOutput}\\n'\r`);
+ await expect.poll(() => readActiveTerminal(page), { timeout: 15_000 }).toContain(rightOutput);
+
+ expect(await readScrollbackContaining(page, sentinel)).toContain(scrollStart);
+ const toBottomMs = await moveTerminal(app, page, 'bottom');
+ expect(toBottomMs).toBeLessThan(300);
+ await expect(terminalTabs(page)).toHaveText(['Terminal 1', 'Terminal 2']);
+ await expect(page.getByRole('tab', { name: 'Terminal 2' })).toHaveAttribute(
+ 'aria-selected',
+ 'true',
+ );
+ expect(await readScrollbackContaining(page, sentinel)).toContain(scrollStart);
+ expect(await readShellPid(page, processMarker)).toBe(processId);
+ const bottomOutput = `BOTTOM_OUTPUT_${token}`;
+ await typeInActiveTerminal(page, `printf '${bottomOutput}\\n'\r`);
+ await expect.poll(() => readActiveTerminal(page), { timeout: 15_000 }).toContain(bottomOutput);
+
+ const rapidSettlement = waitForTerminalHome(page, 'right');
+ await clickTerminalPlacementItemRapidly(app, 7);
+ expect(await rapidSettlement).toBeLessThan(300);
+ await expect(page.locator('section[aria-label="Terminal"]')).toHaveCount(2);
+ await expect(visibleTerminal(page)).toHaveCount(1);
+ await expect(page.locator('#terminal-column section[aria-label="Terminal"]')).toHaveCount(2);
+ await expect(page.locator('#terminal-dock-panel section[aria-label="Terminal"]')).toHaveCount(
+ 0,
+ );
+ await expect(terminalTabs(page)).toHaveText(['Terminal 1', 'Terminal 2']);
+ await expect(page.getByRole('tab', { name: 'Terminal 2' })).toHaveAttribute(
+ 'aria-selected',
+ 'true',
+ );
+ expect(await readShellPid(page, processMarker)).toBe(processId);
+ const rapidOutput = `RAPID_OUTPUT_${token}`;
+ await typeInActiveTerminal(page, `printf '${rapidOutput}\\n'\r`);
+ await expect.poll(() => readActiveTerminal(page), { timeout: 15_000 }).toContain(rapidOutput);
+ expect(await readScrollbackContaining(page, sentinel)).toContain(scrollStart);
+ });
+
+ test('renderer restart restores the right layout and its live active terminal', async ({
+ captureStderrFor,
+ }) => {
+ // The static calibration parser totals 255s across both reload cycles;
+ // the 270s outer budget leaves 15s for untimed interaction work.
+ test.setTimeout(270_000);
+ const s = seed({ skipRestoreState: true });
+ const app = await launchApp(s);
+ captureStderrFor(app, { cleanupDirs: [s.tmpHome, s.projectDir] });
+ const page = await findEditorWindow(app);
+ const editorWindow = await app.browserWindow(page);
+ await editorWindow.evaluate((windowHandle: unknown) => {
+ const target = windowHandle as {
+ setSize: (width: number, height: number, animate: boolean) => void;
+ };
+ target.setSize(1900, 900, false);
+ });
+ await expect.poll(() => page.evaluate(() => window.innerWidth)).toBeGreaterThanOrEqual(1800);
+
+ await openTerminal(app, page);
+ await openBareTab(page);
+ await moveTerminal(app, page, 'right');
+ const restoredWidth = await growRightTerminal(page, 120);
+
+ await dragTabOnto(page, 'Terminal 1', 'Terminal 2');
+ await expect(terminalTabs(page)).toHaveText(['Terminal 2', 'Terminal 1']);
+ await page.getByRole('tab', { name: 'Terminal 1' }).click();
+ await expect(page.getByRole('tab', { name: 'Terminal 1' })).toHaveAttribute(
+ 'aria-selected',
+ 'true',
+ );
+
+ const token = randomUUID().replaceAll('-', '');
+ const processMarker = `RESTART_PROCESS_${token}`;
+ const processId = await readShellPid(page, processMarker);
+ const beforeRestart = `BEFORE_RESTART_${token}`;
+ await typeInActiveTerminal(page, `printf '${beforeRestart}\\n'\r`);
+ await expect.poll(() => readActiveTerminal(page), { timeout: 15_000 }).toContain(beforeRestart);
+
+ await expect
+ .poll(async () => {
+ return page.evaluate(() => localStorage.getItem('ok-terminal-placement-v1'));
+ })
+ .toBe('right');
+ const retainedWidth = await page.evaluate(() =>
+ Number(localStorage.getItem('ok-terminal-right-width-v1')),
+ );
+ expect(retainedWidth).toBeGreaterThan(restoredWidth - 20);
+ expect(retainedWidth).toBeLessThan(restoredWidth + 20);
+ await page.reload({ waitUntil: 'domcontentloaded' });
+
+ await expect(page.locator('#terminal-column')).toBeVisible({ timeout: 20_000 });
+ await expect(page.locator('#terminal-dock-panel')).toHaveCount(0);
+ await expect(terminalTabs(page)).toHaveText(['Terminal 2', 'Terminal 1'], { timeout: 25_000 });
+ await expect(page.getByRole('tab', { name: 'Terminal 1' })).toHaveAttribute(
+ 'aria-selected',
+ 'true',
+ );
+ await expect
+ .poll(async () => {
+ const width = await page
+ .locator('#terminal-column')
+ .evaluate((element) => element.getBoundingClientRect().width);
+ return Math.abs(width - restoredWidth);
+ })
+ .toBeLessThan(20);
+ expect(await readShellPid(page, processMarker)).toBe(processId);
+ const afterRestart = `AFTER_RESTART_${token}`;
+ await typeInActiveTerminal(page, `printf '${afterRestart}\\n'\r`);
+ await expect.poll(() => readActiveTerminal(page), { timeout: 15_000 }).toContain(afterRestart);
+
+ await clickViewAgentsItem(app);
+ await expect(page.locator('#agents-column')).toBeVisible({ timeout: 10_000 });
+ await editorWindow.evaluate((windowHandle: unknown) => {
+ const target = windowHandle as {
+ setSize: (width: number, height: number, animate: boolean) => void;
+ };
+ target.setSize(900, 900, false);
+ });
+ await expect.poll(() => page.evaluate(() => window.innerWidth)).toBeLessThan(1000);
+ await expectCollapsedRailColumn(page, '#agents-column');
+ await page.evaluate(() => {
+ window.okDesktop?.editor.notifyViewMenuStateChanged({ agentPanelVisible: true });
+ });
+ await page.reload({ waitUntil: 'domcontentloaded' });
+
+ await expect(page.locator('#terminal-column')).toBeVisible({ timeout: 20_000 });
+ await expectCollapsedRailColumn(page, '#agents-column');
+ await expect(page.getByText('Agent panel closed to keep Terminal readable.')).toBeVisible();
+ expect(await readShellPid(page, processMarker)).toBe(processId);
+ });
+
+ test('fresh and malformed layout state recover to a usable bottom terminal', async ({
+ captureStderrFor,
+ }) => {
+ const s = seed();
+ const app = await launchApp(s);
+ captureStderrFor(app, { cleanupDirs: [s.tmpHome, s.projectDir] });
+ const page = await findEditorWindow(app);
+
+ await openTerminal(app, page);
+ await expect(page.locator('#terminal-dock-panel')).toBeVisible();
+ await expectCollapsedRailColumn(page, '#terminal-column');
+ const token = randomUUID().replaceAll('-', '');
+ const processMarker = `MALFORMED_PROCESS_${token}`;
+ const processId = await readShellPid(page, processMarker);
+
+ await page.evaluate(() => {
+ localStorage.setItem('ok-terminal-placement-v1', 'future-home');
+ localStorage.setItem('ok-terminal-right-width-v1', 'not-a-width');
+ localStorage.setItem('ok-terminal-width-v1', 'agents-width-sentinel');
+ });
+
+ await page.reload({ waitUntil: 'domcontentloaded' });
+ await expect(page.locator('#terminal-dock-panel')).toBeVisible({ timeout: 20_000 });
+ await expectCollapsedRailColumn(page, '#terminal-column');
+ expect(
+ await page.evaluate(() => ({
+ placement: localStorage.getItem('ok-terminal-placement-v1'),
+ rightWidth: localStorage.getItem('ok-terminal-right-width-v1'),
+ agentsWidth: localStorage.getItem('ok-terminal-width-v1'),
+ })),
+ ).toEqual({
+ placement: 'bottom',
+ rightWidth: '740',
+ agentsWidth: 'agents-width-sentinel',
+ });
+ expect(await readShellPid(page, processMarker)).toBe(processId);
+ const output = `AFTER_MALFORMED_RESTART_${token}`;
+ await typeInActiveTerminal(page, `printf '${output}\\n'\r`);
+ await expect.poll(() => readActiveTerminal(page), { timeout: 15_000 }).toContain(output);
+ });
+});
diff --git a/packages/desktop/tests/smoke/terminal-process-restart.e2e.ts b/packages/desktop/tests/smoke/terminal-process-restart.e2e.ts
new file mode 100644
index 000000000..60e66a407
--- /dev/null
+++ b/packages/desktop/tests/smoke/terminal-process-restart.e2e.ts
@@ -0,0 +1,240 @@
+import type { ChildProcess } from 'node:child_process';
+import { mkdirSync, mkdtempSync, realpathSync, writeFileSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import { join } from 'node:path';
+import type { ElectronApplication, Page } from '@playwright/test';
+import { _electron as electron } from '@playwright/test';
+import { desktopLaunchOptions, resolveDesktopTarget } from './_helpers/launch-desktop';
+import { expect, test } from './_helpers/smoke-test';
+
+const TARGET = resolveDesktopTarget();
+const ENABLED = process.env.OK_DESKTOP_E2E_SMOKE === '1';
+const DESKTOP_PRODUCT_NAME = '@inkeep/open-knowledge-desktop';
+
+interface RestartSeed {
+ tmpHome: string;
+ userDataDir: string;
+ projectDir: string;
+}
+
+function seedRestartProfile(): RestartSeed {
+ const tmpHome = realpathSync(mkdtempSync(join(tmpdir(), 'ok-terminal-restart-home-')));
+ const projectDir = realpathSync(mkdtempSync(join(tmpdir(), 'ok-terminal-restart-project-')));
+ mkdirSync(join(projectDir, '.ok', 'local'), { recursive: true });
+ writeFileSync(join(projectDir, '.ok', 'config.yml'), "content:\n dir: '.'\n");
+ writeFileSync(join(projectDir, '.ok', 'local', 'config.yml'), 'terminal:\n enabled: true\n');
+ writeFileSync(join(projectDir, 'start.md'), '# Terminal restart\n');
+ writeFileSync(join(tmpHome, '.zprofile'), 'export PATH="/usr/bin:/bin:/usr/sbin:/sbin"\n');
+ writeFileSync(join(tmpHome, '.zshrc'), 'export PATH="/usr/bin:/bin:/usr/sbin:/sbin"\n');
+ const userDataDir = join(tmpHome, 'Library', 'Application Support', DESKTOP_PRODUCT_NAME);
+ mkdirSync(userDataDir, { recursive: true });
+ writeFileSync(
+ join(userDataDir, 'state.json'),
+ JSON.stringify({
+ recentProjects: [
+ { path: projectDir, name: 'Terminal restart', lastOpenedAt: new Date().toISOString() },
+ ],
+ lastOpenedProject: projectDir,
+ versionPendingInstall: null,
+ lastSeenVersion: null,
+ lastSuccessfulCheckAt: null,
+ stuckHintShown: false,
+ }),
+ );
+ return { tmpHome, userDataDir, projectDir };
+}
+
+async function launchRestartProfile(seed: RestartSeed): Promise<ElectronApplication> {
+ const deepLink = `openknowledge://open?project=${encodeURIComponent(seed.projectDir)}&doc=start`;
+ return electron.launch(
+ desktopLaunchOptions({
+ target: TARGET,
+ args: [`--user-data-dir=${seed.userDataDir}`, deepLink],
+ env: {
+ ...process.env,
+ HOME: seed.tmpHome,
+ PATH: '/usr/bin:/bin:/usr/sbin:/sbin',
+ SHELL: '/bin/zsh',
+ OK_DESKTOP_E2E_SMOKE: '1',
+ OK_RECLAIM_DISABLE: '1',
+ },
+ }),
+ );
+}
+
+async function findEditorWindow(app: ElectronApplication): Promise<Page> {
+ let page: Page | undefined;
+ await expect(async () => {
+ for (const candidate of app.windows()) {
+ const mode = await candidate
+ .evaluate(() => window.okDesktop?.config?.mode)
+ .catch(() => undefined);
+ if (mode === 'editor') {
+ page = candidate;
+ return;
+ }
+ }
+ throw new Error('editor window unavailable');
+ }).toPass({ timeout: 25_000 });
+ if (!page) throw new Error('editor window vanished');
+ return page;
+}
+
+async function setWindowSize(
+ app: ElectronApplication,
+ page: Page,
+ width: number,
+ height: number,
+): Promise<void> {
+ const editorWindow = await app.browserWindow(page);
+ await editorWindow.evaluate(
+ (handle: unknown, size) => {
+ (handle as { setSize: (w: number, h: number, animate: boolean) => void }).setSize(
+ size.width,
+ size.height,
+ false,
+ );
+ },
+ { width, height },
+ );
+ await expect
+ .poll(() => page.evaluate(() => window.innerWidth))
+ .toBeGreaterThanOrEqual(width - 100);
+}
+
+async function clickMenuItem(
+ app: ElectronApplication,
+ topLabel: string,
+ labels: string[],
+): Promise<void> {
+ await app.evaluate(
+ ({ Menu }, payload) => {
+ const top = Menu.getApplicationMenu()?.items.find((item) => item.label === payload.topLabel);
+ const item = top?.submenu?.items.find((candidate) =>
+ payload.labels.includes(candidate.label),
+ );
+ if (!item)
+ throw new Error(`missing ${payload.topLabel} menu item: ${payload.labels.join(' / ')}`);
+ item.click();
+ },
+ { topLabel, labels },
+ );
+}
+
+const terminalTabs = (page: Page) =>
+ page.getByRole('tablist', { name: 'Terminal sessions' }).getByRole('tab');
+
+async function openTerminal(app: ElectronApplication, page: Page): Promise<void> {
+ await clickMenuItem(app, 'View', ['Show Terminal']);
+ const terminal = page.locator('section[aria-label="Terminal"]:visible');
+ await expect(terminal).toBeVisible({ timeout: 15_000 });
+ await expect(terminal.locator('[data-terminal-status]')).toHaveAttribute(
+ 'data-terminal-status',
+ 'running',
+ { timeout: 25_000 },
+ );
+}
+
+async function openBareTab(page: Page): Promise<void> {
+ await page.getByTestId('terminal-new-chat-menu').click();
+ await page.getByRole('menuitem', { name: 'Terminal' }).click();
+ await expect(terminalTabs(page)).toHaveCount(2, { timeout: 25_000 });
+}
+
+async function growRightTerminal(page: Page, deltaPx: number): Promise<number> {
+ const column = page.locator('#terminal-column');
+ const before = await column.evaluate((element) => element.getBoundingClientRect().width);
+ const handle = await column.evaluate((element) => {
+ const rect = element.previousElementSibling?.getBoundingClientRect();
+ return rect == null ? null : { x: rect.x, y: rect.y, width: rect.width, height: rect.height };
+ });
+ if (!handle) throw new Error('right Terminal resize handle unavailable');
+ await page.mouse.move(handle.x + handle.width / 2, handle.y + handle.height / 2);
+ await page.mouse.down();
+ await page.mouse.move(handle.x - deltaPx, handle.y + handle.height / 2, { steps: 12 });
+ await page.mouse.up();
+ await expect
+ .poll(() => column.evaluate((element) => element.getBoundingClientRect().width))
+ .toBeGreaterThan(before + deltaPx / 2);
+ return column.evaluate((element) => element.getBoundingClientRect().width);
+}
+
+async function dragTabOnto(page: Page, fromName: string, toName: string): Promise<void> {
+ const from = await page.getByRole('tab', { name: fromName }).boundingBox();
+ const to = await page.getByRole('tab', { name: toName }).boundingBox();
+ if (!from || !to) throw new Error('tab bounding box unavailable');
+ await page.mouse.move(from.x + from.width / 2, from.y + from.height / 2);
+ await page.mouse.down();
+ await page.mouse.move(to.x + to.width / 2, to.y + to.height / 2, { steps: 12 });
+ await page.mouse.up();
+}
+
+async function quitAndWait(app: ElectronApplication, child: ChildProcess): Promise<void> {
+ const exited = new Promise<void>((resolveExit, reject) => {
+ const timer = setTimeout(
+ () => reject(new Error('Electron process did not exit after app.quit()')),
+ 15_000,
+ );
+ child.once('exit', () => {
+ clearTimeout(timer);
+ resolveExit();
+ });
+ });
+ await app.evaluate(({ app: electronApp }) => electronApp.quit());
+ await exited;
+ expect(child.exitCode ?? child.signalCode).not.toBeNull();
+}
+
+test.describe('terminal process restart', () => {
+ test.skip(!ENABLED, 'Set OK_DESKTOP_E2E_SMOKE=1');
+ test.skip(process.platform !== 'darwin', 'Desktop is darwin-only');
+ test.skip(!TARGET.exists, TARGET.missingReason);
+
+ test('restores placement, width, tab order, and active tab in a separate Electron process', async ({
+ captureStderrFor,
+ }) => {
+ // Two Electron launches and their sequential restore checks have a 220s cumulative budget.
+ test.setTimeout(240_000);
+ const seed = seedRestartProfile();
+ const firstApp = await launchRestartProfile(seed);
+ captureStderrFor(firstApp);
+ const firstProcess = firstApp.process();
+ const firstPage = await findEditorWindow(firstApp);
+ await setWindowSize(firstApp, firstPage, 1900, 900);
+ await openTerminal(firstApp, firstPage);
+ await openBareTab(firstPage);
+ await clickMenuItem(firstApp, 'Terminal', ['Move Terminal to right']);
+ await expect(firstPage.locator('#terminal-column')).toBeVisible({ timeout: 10_000 });
+ const retainedWidth = await growRightTerminal(firstPage, 120);
+ await dragTabOnto(firstPage, 'Terminal 1', 'Terminal 2');
+ await expect(terminalTabs(firstPage)).toHaveText(['Terminal 2', 'Terminal 1']);
+ await firstPage.getByRole('tab', { name: 'Terminal 1' }).click();
+ await expect(firstPage.getByRole('tab', { name: 'Terminal 1' })).toHaveAttribute(
+ 'aria-selected',
+ 'true',
+ );
+ await quitAndWait(firstApp, firstProcess);
+
+ const secondApp = await launchRestartProfile(seed);
+ captureStderrFor(secondApp, { cleanupDirs: [seed.tmpHome, seed.projectDir] });
+ const secondPage = await findEditorWindow(secondApp);
+ await setWindowSize(secondApp, secondPage, 1900, 900);
+ await expect(secondPage.locator('#terminal-column')).toBeVisible({ timeout: 25_000 });
+ await expect(secondPage.locator('#terminal-dock-panel')).toHaveCount(0);
+ await expect(terminalTabs(secondPage)).toHaveText(['Terminal 2', 'Terminal 1'], {
+ timeout: 25_000,
+ });
+ await expect(secondPage.getByRole('tab', { name: 'Terminal 1' })).toHaveAttribute(
+ 'aria-selected',
+ 'true',
+ );
+ await expect
+ .poll(async () => {
+ const width = await secondPage
+ .locator('#terminal-column')
+ .evaluate((element) => element.getBoundingClientRect().width);
+ return Math.abs(width - retainedWidth);
+ })
+ .toBeLessThan(20);
+ });
+});
diff --git a/packages/desktop/tests/smoke/terminal-tabs.e2e.ts b/packages/desktop/tests/smoke/terminal-tabs.e2e.ts
index e22561495..7f7eae428 100644
--- a/packages/desktop/tests/smoke/terminal-tabs.e2e.ts
+++ b/packages/desktop/tests/smoke/terminal-tabs.e2e.ts
@@ -19,10 +19,8 @@
* reorder); this pins the live-session outcome.
*
* Skip gates mirror the sibling terminal smokes: opt-in via OK_DESKTOP_E2E_SMOKE=1,
- * darwin-only, the electron-vite build must exist (out/main/index.js), and
- * CI-quarantined (the live-Electron terminal surface degrades on the constrained
- * runner — allowlisted in the CI no-skip guard, not hidden). Runs in local dev /
- * the release gate. Not part of `pnpm check`.
+ * darwin-only, and the electron-vite build must exist (out/main/index.js). Runs
+ * in local dev / the release gate. Not part of `pnpm check`.
*/
import { mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
@@ -37,7 +35,6 @@ const TARGET = resolveDesktopTarget();
const SMOKE_ENABLED = process.env.OK_DESKTOP_E2E_SMOKE === '1';
const DARWIN = process.platform === 'darwin';
-const IS_CI = process.env.CI === 'true' || process.env.GITHUB_ACTIONS === 'true';
const DESKTOP_PRODUCT_NAME = '@inkeep/open-knowledge-desktop';
interface Seed {
@@ -112,11 +109,14 @@ async function findEditorWindow(app: ElectronApplication, timeoutMs = 25_000): P
async function clickViewTerminalItem(app: ElectronApplication): Promise<void> {
await app.evaluate(async ({ Menu }) => {
- const view = Menu.getApplicationMenu()?.items.find((i) => i.label === 'View');
+ const menu = Menu.getApplicationMenu();
+ if (!menu) throw new Error('application menu is unavailable');
+ const view = menu.items.find((i) => i.label === 'View');
const item = view?.submenu?.items.find(
- (i) => i.label === 'Show Bottom Dock' || i.label === 'Hide Bottom Dock',
+ (i) => i.label === 'Show Terminal' || i.label === 'Hide Terminal',
);
- item?.click();
+ if (!item) throw new Error('View menu is missing the required Terminal visibility item');
+ item.click();
});
}
@@ -163,7 +163,7 @@ async function waitActiveRunning(page: Page, timeoutMs = 25_000): Promise<void>
/** Open a second (or further) tab running a BARE shell via the New-chat carat →
* "Terminal" pick. The new tab activates; wait for its shell to be running. */
async function openBareTab(page: Page): Promise<void> {
- await page.getByRole('button', { name: 'Choose CLI for new chat' }).click();
+ await page.getByTestId('terminal-new-chat-menu').click();
await page.getByRole('menuitem', { name: 'Terminal' }).click();
await waitActiveRunning(page);
}
@@ -216,11 +216,6 @@ test.describe('Terminal tabs — live Electron', () => {
test.skip(!SMOKE_ENABLED, 'Set OK_DESKTOP_E2E_SMOKE=1 to run Electron smoke tests.');
test.skip(!DARWIN, 'Desktop is darwin-only.');
test.skip(!TARGET.exists, TARGET.missingReason);
- test.skip(
- IS_CI,
- 'Quarantined on CI: the live-Electron terminal surface degrades on the constrained runner — see inkeep/agents-private#2187.',
- );
-
test.afterEach(() => {
for (const target of cleanup.splice(0)) {
try {
diff --git a/packages/desktop/tests/smoke/terminal-window.e2e.ts b/packages/desktop/tests/smoke/terminal-window.e2e.ts
index 176f1c587..0934f9ccd 100644
--- a/packages/desktop/tests/smoke/terminal-window.e2e.ts
+++ b/packages/desktop/tests/smoke/terminal-window.e2e.ts
@@ -10,11 +10,8 @@
* kills the host); this asserts the observable window-close.
*
* Skip gates mirror terminal-dock.e2e.ts: opt-in via OK_DESKTOP_E2E_SMOKE=1,
- * darwin-only, the electron-vite build must exist, and CI-skipped (the
- * live-Electron terminal surface is not yet validated on the CI runner — same
- * caveat as the docked-terminal smoke). Runs in local dev to keep the seam
- * covered. Not part of `pnpm check`; run via `pnpm exec playwright test` or
- * `pnpm run check:full:parallel`.
+ * darwin-only, and the electron-vite build must exist. Not part of `pnpm check`;
+ * run via `pnpm exec playwright test` or `pnpm run check:full:parallel`.
*/
import { mkdirSync, mkdtempSync, realpathSync, rmSync, writeFileSync } from 'node:fs';
@@ -29,7 +26,6 @@ const TARGET = resolveDesktopTarget();
const SMOKE_ENABLED = process.env.OK_DESKTOP_E2E_SMOKE === '1';
const DARWIN = process.platform === 'darwin';
-const IS_CI = process.env.CI === 'true' || process.env.GITHUB_ACTIONS === 'true';
const DESKTOP_PRODUCT_NAME = '@inkeep/open-knowledge-desktop';
interface Seed {
@@ -103,15 +99,36 @@ async function findWindowByMode(
return page;
}
-async function clickNewTerminalWindow(app: ElectronApplication): Promise<boolean> {
- return app.evaluate(async ({ Menu }) => {
+async function clickNewTerminalWindow(
+ app: ElectronApplication,
+ sourceWebContentsId?: number,
+): Promise<boolean> {
+ return app.evaluate(async ({ BrowserWindow, Menu }, expectedSourceId) => {
const menu = Menu.getApplicationMenu();
const terminal = menu?.items.find((i) => i.label === 'Terminal');
const item = terminal?.submenu?.items.find((i) => i.label === 'New Terminal Window');
if (!item) return false;
- item.click();
+ if (expectedSourceId === undefined) {
+ item.click();
+ return true;
+ }
+ const source = BrowserWindow.getAllWindows().find(
+ (candidate) => candidate.webContents.id === expectedSourceId,
+ );
+ if (!source) return false;
+ // Electron's headless test runner cannot establish native macOS focus, while
+ // the production menu command intentionally resolves project context from
+ // BrowserWindow.getFocusedWindow(). Scope that platform seam to this click so
+ // the test still exercises the real menu and project-inheritance path.
+ const getFocusedWindow = BrowserWindow.getFocusedWindow;
+ Reflect.set(BrowserWindow, 'getFocusedWindow', () => source);
+ try {
+ item.click();
+ } finally {
+ Reflect.set(BrowserWindow, 'getFocusedWindow', getFocusedWindow);
+ }
return true;
- });
+ }, sourceWebContentsId);
}
async function terminalWindowCount(app: ElectronApplication): Promise<number> {
@@ -132,11 +149,6 @@ test.describe('Standalone terminal window — live Electron', () => {
test.skip(!SMOKE_ENABLED, 'Set OK_DESKTOP_E2E_SMOKE=1 to run Electron smoke tests.');
test.skip(!DARWIN, 'Desktop is darwin-only.');
test.skip(!TARGET.exists, TARGET.missingReason);
- test.skip(
- IS_CI,
- 'Quarantined on CI: constrained-runner degradation on the live-Electron terminal surface, same class as terminal-dock (inkeep/agents-private#2187). Runs in local dev.',
- );
-
test.afterEach(() => {
for (const target of cleanup.splice(0)) {
try {
@@ -154,11 +166,16 @@ test.describe('Standalone terminal window — live Electron', () => {
track(s.tmpHome, s.projectDir);
const app = await launchApp(s);
captureStderrFor(app, { cleanupDirs: [s.tmpHome, s.projectDir] });
- // The editor window must be focused so the command inherits its project.
- await findWindowByMode(app, 'editor');
+ // The main-process command inherits project context from the source editor.
+ const editor = await findWindowByMode(app, 'editor');
+ const editorWindow = await app.browserWindow(editor);
+ const editorWebContentsId = await editorWindow.evaluate(
+ (win: unknown) => (win as { webContents: { id: number } }).webContents.id,
+ );
- expect(await clickNewTerminalWindow(app)).toBe(true);
+ expect(await clickNewTerminalWindow(app, editorWebContentsId)).toBe(true);
const term = await findWindowByMode(app, 'terminal');
+ expect(await term.evaluate(() => window.okDesktop?.config.collabUrl)).not.toBe('');
// A live shell tab spawned in the new window.
await expect(term.locator('[data-terminal-status]').first()).toHaveAttribute(