Skip to content

feat(dashboard): mobile-first sandbox terminal and VNC#521

Merged
DorianZheng merged 1 commit into
mainfrom
mobile-terminal-ux
May 14, 2026
Merged

feat(dashboard): mobile-first sandbox terminal and VNC#521
DorianZheng merged 1 commit into
mainfrom
mobile-terminal-ux

Conversation

@DorianZheng

Copy link
Copy Markdown
Member

Summary

  • New /sandboxes/:id/terminal and /sandboxes/:id/vnc fullscreen routes share a single SandboxSessionProvider so activation survives navigation; details/header collapse on mobile and a --app-content-height CSS var carries the banner-aware viewport budget to every page.
  • Daemon terminal HTML gains a viewport-meta + svh/dvh body, a ResizeObserver+visualViewport+orientationchange refit chain, IME-hardened helper textarea, and a soft-keys toolbar (Esc/Tab/Ctrl/Alt/arrows/|//~/Trackpad/Keyboard) using shadcn dark tokens, with sticky modifiers and pinch-to-zoom.
  • Clipboard paste is parent-mediated: a dashboard-rendered Paste button reads under the dashboard's user activation and postMessages to the iframe's registered origin; iframe-originated paste requests are dropped. xterm pinned to 5.3.0 (avoids 6.x touch-scroll regression).

Test plan

  • Open a running sandbox on a phone (or DevTools iPhone 12 Pro emulation): Terminal tab is edge-to-edge; the opens /sandboxes/:id/terminal fullscreen.
  • Focus the terminal, raise the soft keyboard: viewport shrinks, cursor stays in view; soft-keys row is visible above the OS keyboard.
  • Tap Ctrl then c on the OS keyboard: SIGINT fires. Double-tap Ctrl to lock; verify next two keys are also Ctrl-modified.
  • Drag the trackpad button: cursor moves; lifting releases without emitting stray arrows.
  • Pinch two fingers on the terminal: font size scales between 8 and 32 and persists across reloads.
  • Click the Paste button: dashboard prompts for clipboard, text appears in the shell (with bracketed-paste wrapper when the remote shell enabled it).
  • Read-only viewer on mobile can still see the sandbox (note: refresh is currently gated behind the writePermitted dropdown — separate fix incoming).
  • Desktop ≥1024px: no soft-keys, no fullscreen affordance change, full sidebar/tabs unchanged.
  • VNC tab: opens fullscreen VNC; fullscreen variant has no extra chrome.

Dashboard
- Add /sandboxes/:id/terminal and /sandboxes/:id/vnc fullscreen routes
  behind a shared SandboxSessionProvider pathless layout so activation
  state survives navigation between details and fullscreen siblings.
- Extract SandboxFullscreenShell and SandboxTerminalFrame; add
  terminalIframeSrc bridge with registered Window+origin paste channel.
- Promote viewport budget to --app-content-height CSS var on the
  Dashboard root and consume it from fullscreen pages and SandboxDetails.
- Compact SandboxHeader on mobile (hide UUID line, py-1.5).
- Hide PageHeader on mobile sandbox details.
- Maximize/Paste action buttons on tab and fullscreen variants.

Daemon terminal HTML
- viewport meta with interactive-widget=resizes-content; svh/dvh body.
- ResizeObserver + visualViewport + orientationchange refit chain with
  rAF coalesce and double fit() (Coder workaround).
- IME-hardened helper textarea (xtermjs/xterm.js#2403); optional
  ?ime=off password-input fallback.
- Soft-keys toolbar (Esc/Tab/Ctrl/Alt/arrows/|//~/Trackpad/Keyboard)
  using shadcn dark tokens; sticky modifiers (tap=arm, double=lock);
  pointerup-within-bounds tap activation.
- Pinch-to-zoom font size with per-iframe localStorage + parent pref
  postMessage to the dashboard for stable persistence.
- Parent-mediated paste via postMessage; pasteInFlight refcount so
  bracketed-paste bytes aren't transformed by armed Ctrl/Alt.
- Pin xterm to 5.3.0 with comment to avoid the 6.x touch-scroll
  regression (xtermjs/xterm.js#5489, fixed in v7.0.0 via #5563).
@DorianZheng DorianZheng merged commit 0cb2290 into main May 14, 2026
19 checks passed
@DorianZheng DorianZheng deleted the mobile-terminal-ux branch May 14, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant