diff --git a/src/web/public/terminal-ui.js b/src/web/public/terminal-ui.js index e32b5832..d908c2af 100644 --- a/src/web/public/terminal-ui.js +++ b/src/web/public/terminal-ui.js @@ -1092,6 +1092,12 @@ Object.assign(CodemanApp.prototype, { if (this._localEchoOverlay?.hasPending) { this._localEchoOverlay.rerender(); } + // Pane B (split view) has its own container and its own fit()/resize + // frame — this observer only ever measured Pane A's container, so + // without this call Pane B never learned about a window resize, an + // Alt+B sidebar toggle, or a tab-rail drag, and its PTY silently + // stayed at whatever size it was last dragged to. + this._splitPane?.fit(); }, 300); // Trailing-edge: only fire after 300ms of no resize events }; diff --git a/test/routes/system-routes-split-button-setting.test.ts b/test/routes/system-routes-split-button-setting.test.ts deleted file mode 100644 index 0f9fe069..00000000 --- a/test/routes/system-routes-split-button-setting.test.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'; -import { createRouteTestHarness, type RouteTestHarness } from './_route-test-utils.js'; -import { registerSystemRoutes } from '../../src/web/routes/system-routes.js'; - -const { subagentWatcher, imageWatcher, workflowRunWatcher, fileSystem } = vi.hoisted(() => { - const makeWatcher = () => ({ - isRunning: vi.fn(() => false), - start: vi.fn(), - stop: vi.fn(), - getStats: vi.fn(() => ({})), - watchSession: vi.fn(), - getRecentRunSummaries: vi.fn(() => []), - }); - - // Simulate in-memory file storage - let storedSettings: Record = {}; - - return { - subagentWatcher: makeWatcher(), - imageWatcher: makeWatcher(), - workflowRunWatcher: makeWatcher(), - fileSystem: { - storedSettings, - }, - }; -}); - -vi.mock('node:fs/promises', () => ({ - default: { - readFile: vi.fn(async () => JSON.stringify(fileSystem.storedSettings)), - writeFile: vi.fn(async (_path: string, content: string) => { - fileSystem.storedSettings = JSON.parse(content); - }), - }, -})); - -vi.mock('node:fs', async (importOriginal) => { - const actual = await importOriginal(); - return { ...actual, existsSync: vi.fn(() => true), mkdirSync: vi.fn(), readdirSync: vi.fn(() => []) }; -}); - -vi.mock('../../src/subagent-watcher.js', () => ({ subagentWatcher })); -vi.mock('../../src/image-watcher.js', () => ({ imageWatcher })); -vi.mock('../../src/workflow-run-watcher.js', () => ({ workflowRunWatcher })); - -describe('showSplitButton setting', () => { - let harness: RouteTestHarness; - - beforeEach(async () => { - harness = await createRouteTestHarness(registerSystemRoutes); - }); - - afterEach(async () => { - await harness.app.close(); - }); - - it('round-trips through PUT and GET /api/settings', async () => { - const putRes = await harness.app.inject({ - method: 'PUT', - url: '/api/settings', - payload: { showSplitButton: true }, - }); - expect(putRes.statusCode).toBe(200); - - const getRes = await harness.app.inject({ method: 'GET', url: '/api/settings' }); - const body = JSON.parse(getRes.body); - expect(body.showSplitButton).toBe(true); - }); -});