diff --git a/apps/web/app/terminal/page.tsx b/apps/web/app/terminal/page.tsx index c75c2df..fbb9418 100644 --- a/apps/web/app/terminal/page.tsx +++ b/apps/web/app/terminal/page.tsx @@ -13,7 +13,7 @@ import { getWSClient } from '@/lib/ws-client'; import { useSession } from '@/lib/auth'; export default function TerminalPage() { - const { showLeftRail, showRightRail } = useTerminalStore(); + const { showLeftRail, showRightRail, setShowLeftRail, setShowRightRail } = useTerminalStore(); const { user, loading: sessionLoading } = useSession(); const ingestMT5 = useMT5Store((s) => s.ingestEvent); const refreshAccounts = useMT5Store((s) => s.refreshAccounts); @@ -28,6 +28,17 @@ export default function TerminalPage() { else if (!user.emailVerified) window.location.href = '/verify'; }, [sessionLoading, user]); + // Mobile: the rails are fixed-width (48px + 340px) and would crush the flex-1 chart to a sliver + // on a phone. Default both closed under lg (<1024px) so the chart gets the full viewport; the + // rails still open as overlays (drawer-style) via the top-bar/settings toggles. + useEffect(() => { + if (typeof window === 'undefined' || window.innerWidth >= 1024) return; + setShowLeftRail(false); + setShowRightRail(false); + // once, on first mount — a user reopening a rail on mobile must stick. + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + // Docs deep link: /terminal?pulse= loads the snippet into the Script dock // (one-shot, then stripped from the URL so refresh doesn't re-apply it). useEffect(() => { diff --git a/apps/web/features/terminal/left-rail.tsx b/apps/web/features/terminal/left-rail.tsx index c83d2b7..91a6e00 100644 --- a/apps/web/features/terminal/left-rail.tsx +++ b/apps/web/features/terminal/left-rail.tsx @@ -88,7 +88,7 @@ export function LeftRail() { return ( -