fix: lock body scroll and re-add programmatic terminal touch scroll

- Add body.terminal-page-open { overflow: hidden } to prevent page scroll
- TerminalPage adds/removes 'terminal-page-open' class on body when mounted
- Re-add capture-phase touch listeners in terminal.tsx with low 3px threshold
- Call e.preventDefault() immediately when vertical gesture is detected,
  before browser compositor commits to page scroll
- Remove CSS touch-action overrides on xterm viewport (now handled in JS)
- Scroll forwarded via term.scrollLines() with 24px per line sensitivity
This commit is contained in:
Alex Blank
2026-05-29 19:57:48 +02:00
parent 61d32fa00f
commit c1e16f2163
3 changed files with 91 additions and 19 deletions
+10
View File
@@ -204,6 +204,16 @@ export const TerminalPage: React.FC = () => {
};
}, []);
// Lock body scroll on mobile terminal so swipes scroll the terminal buffer,
// not the page.
useEffect(() => {
if (!isMobile) return;
document.body.classList.add("terminal-page-open");
return () => {
document.body.classList.remove("terminal-page-open");
};
}, [isMobile]);
// Click outside terminal content/header to exit fullscreen
const handleFullscreenClick = useCallback(
(e: React.MouseEvent<HTMLElement>) => {