Spec: the web UI on a phone
Adds a phone layout to web-ui-graphite.md and replaces the second sentence of its GR-3 ("Below 720 px the sidebar stacks above the main column"). Routes, data, actions and the visual language stay as they are. Desktop and tablet layouts (720 px and wider) do not change.
Why
The owner reaches the server's Jarvis from a phone over Tailscale (https://<host>.<tailnet>.ts.net, ADR-0016) to continue threads, answer questions and approvals and look at a task while away from the laptop. Today, below 720 px the whole sidebar (search, thread list, usage, nav) is stacked on top of every page and takes about 40% of the screen; the thread list itself is squeezed to one clipped line, so the thread the owner wants cannot be reached, and the composer's controls are misplaced.
Out of scope: a native app, push notifications, a service worker or offline mode, new screens, behaviour or API changes, gestures beyond tap and scroll.
Requirements
Below 720 px wide ("phone"):
Shell
- MB-1 A top bar replaces the stacked sidebar: a menu button, the screen's title (the page name;
Jarvison/chatand in a thread, whose header already shows the thread title), and the engine state dot. The main column takes the rest of the screen. - MB-2 The menu button opens the sidebar as a drawer from the left edge, full height,
min(320px, 88vw)wide, over a dimmed backdrop. It closes on a backdrop tap,Escape, the close button and after any navigation (opening a thread, a nav link,New thread). While open, focus stays in the drawer and the page behind does not scroll. The sidebar's collapse toggle and width resizer are not shown on a phone; the stored desktop collapsed state is ignored there. - MB-3 The menu button carries a badge with the number of threads in
Waiting for youwhen it is above zero, so the owner sees from any screen that something needs them. - MB-4 The app uses the dynamic viewport height, so the composer stays above the browser bars and the on-screen keyboard, and respects safe-area insets (notch, home indicator) when opened from the Home Screen.
Thread
- MB-5 The thread header fits one row: the title truncates, and secondary links (task ID, PR) move into the
⋯menu if they do not fit; the console, task panel and⋯buttons stay. - MB-6 The task panel, when opened, covers the whole screen with a visible close button, and is closed by default on a phone (the desktop choice is not applied).
- MB-7 The composer spans the width with small side margins; the text field uses a 16 px font (so iOS does not zoom in on focus); the keyboard hint line is hidden; the model selector and the send button share one row with the send button on the right. Decision, question and permission cards fit the width, with their buttons wrapping onto a new line rather than overflowing.
Pages
- MB-8 Every page uses one column with reduced side padding. Filter chip rows stay on one line and scroll horizontally inside their row.
- MB-9 Wide tables (Tasks, Runs, Usage) scroll horizontally inside their own box; the page itself never scrolls sideways. On Tasks the ID, title and stage columns come first and stay readable without scrolling.
- MB-10 The session console's facts wrap into as many rows as needed; long values (CLI session ID, paths, commands) break instead of widening the page; event rows wrap their text.
Touch and Home Screen
- MB-11 Interactive controls in the top bar, the drawer's nav, the thread header and the composer have a hit area of at least 44×44 px. Actions that appear only on hover on desktop (archive in a thread row) stay reachable on a phone through the
⋯menu, as today. - MB-12 A web app manifest (name
Jarvis,display: standalone, the theme's background colour, an icon) and anapple-touch-icon, so "Add to Home Screen" opens Jarvis full-screen with its own icon.viewport-fit=coveris set for MB-4. No service worker.
Edge cases
| Case | Expected |
|---|---|
| Drawer open and the window grows past 720 px | The drawer state is dropped; the desktop sidebar shows |
| Phone in landscape (wider than 720 px) | The desktop layout, as today |
| Thread with a very long title | Truncated in the thread header, full title in its tooltip |
| A message with a wide code block or table | Scrolls inside the message; the feed does not scroll sideways |
| On-screen keyboard open in the composer | The composer stays visible above the keyboard; the feed shrinks |
| Engine offline | The top bar's state dot shows Offline (label for screen readers) |
| Budget banner shown | It sits under the top bar, above the main column |
Acceptance
- At 375×667 and 390×844 no page scrolls horizontally (
documentElement.scrollWidthequals the viewport width) on every route: Chat, a thread, Overview, Tasks, Task detail, Session console, Usage, Connections, Capabilities, Config. - On a phone viewport the owner can open the drawer, open a thread, send a message and answer a decision card without the page zooming or any control being covered.
- The axe suite passes at 390 px in both themes on Chat and Task detail.
- Screenshots at 1440 and 1024 px are unchanged by this work.
- Existing web tests and e2e pass; new tests cover MB-2 (open, close on backdrop,
Escapeand navigation) and MB-3.