From bb38b37ceb44ed70a38e209e5c4d2d90bb68adcb Mon Sep 17 00:00:00 2001 From: Developer Date: Tue, 14 Jul 2026 19:41:34 +0000 Subject: [PATCH] fix: reinitialize terminal on mobile viewport changes Recreate the terminal when responsive classification changes so mobile scrollback and touch listeners are installed.\n\nOpenSpec: fix-mobile-terminal-scrolling\nQuality gates: npm run typecheck, npm run lint, npm test (89 passed), npm run build --- apps/web/src/components/features/terminal/terminal.tsx | 2 +- openspec/changes/fix-mobile-terminal-scrolling/tasks.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/web/src/components/features/terminal/terminal.tsx b/apps/web/src/components/features/terminal/terminal.tsx index 604c044..ef4821c 100644 --- a/apps/web/src/components/features/terminal/terminal.tsx +++ b/apps/web/src/components/features/terminal/terminal.tsx @@ -700,7 +700,7 @@ export const TerminalComponent = React.forwardRef( // Ignore disposal errors from partially torn-down terminal } }; - }, [instanceId, connectWebSocket]); + }, [instanceId, connectWebSocket, isMobile]); useImperativeHandle(ref, () => ({ fit: () => { diff --git a/openspec/changes/fix-mobile-terminal-scrolling/tasks.md b/openspec/changes/fix-mobile-terminal-scrolling/tasks.md index b524a8c..6c0e1de 100644 --- a/openspec/changes/fix-mobile-terminal-scrolling/tasks.md +++ b/openspec/changes/fix-mobile-terminal-scrolling/tasks.md @@ -1,6 +1,7 @@ # Restore Mobile Terminal Scrolling — Tasks - [x] Add a mobile-specific terminal scrollback limit while preserving zero scrollback on desktop. +- [x] Reinitialize the terminal when the responsive mobile classification changes so its scrollback and touch handler match the active viewport. - [x] Add focused tests for the responsive scrollback configuration. - [x] Run the full frontend test suite (89 tests passed after repairing the `ProjectsPage` test setup). - [x] Run frontend typecheck, lint, focused tests, and production build.