Repository navigation
feat(studio): mobile optimizations — PWA, sheets, threads, touch interactions - #647
Merged
Merged
Conversation
…ns, working tap-to-open The shell's CSS gates used Tailwind's sm: (640px) while the JS hooks call <500px mobile; they now agree on 500px (min-[500px]: variants). The gradient edge margin halves below the breakpoint (10px vs 20px). Tapping a chat row on a phone did nothing: useIsMobile is undefined on the first render, so sidebarOpen initialised as if on desktop, and the row's router.push changed the optional catch-all's segment count — remounting the page and re-running that init, so the list rendered straight back over the chat. Selection now uses native history.pushState (no remount, the draft-mint precedent) and a measured-mobile effect closes the list over a selected chat on mount. The search palette becomes a full page below the breakpoint — the on-screen keyboard eats half the viewport, so a floating dialog leaves no room for results. Co-Authored-By: Claude Fable 5 <[email protected]>
Web app manifest (standalone display, /workspace/chat start URL, brand theme/background, 192/512/maskable icons generated from the logo mark on a solid brand ground), apple-touch-icon + appleWebApp metadata, and a viewport export with media-queried theme colors matching the shell gradient plus viewportFit cover for the notch. Deliberately no service worker: Studio is a local daemon client, so offline caching would lie about live state — and installability no longer requires one on Chrome and never did on iOS. Co-Authored-By: Claude Fable 5 <[email protected]>
…ns, focus Bottom sheets follow mobile conventions: full-bleed with square corners, no X button, a centered grab handle, iOS safe-area padding, and dependency-free drag-to-close (handle or unscrolled body; >25% height or a flick dismisses, taps and scrolls are untouched). Threads (and file/canvas panels) now work on mobile: the same desktop panels render maximized inside a 94dvh bottom sheet with their window controls hidden — the grab handle owns dismissal — so the thread composer sits above the on-screen keyboard. Message actions: the hover-only reveal gains a touch path — a horizontal left swipe on a message reveals the action row, right swipe hides it. The Edit pencil is gone on all form factors (the daemon has no message-edit capability; it was prototype residue). The thread composer gains parity with the main one (model selector + memory control), and entering a chat or thread focuses the input: tiptap autofocus on mount plus a focusKey refocus when the open chat changes. Co-Authored-By: Claude Fable 5 <[email protected]>
The five surfaces move to a native-style bottom tab bar on mobile (Material-3-style: light pill behind the active icon, small always-on labels, safe-area padding), sitting on the same green gradient; the top bar keeps only logo + search there. The gap between the content card and the bar is trimmed to a sliver. Settings gets a native mobile IA: the index renders grouped inset lists (icon chip, label, chevron) linking to each subpage, and subpages show a "back to Settings" header with the section's own title. Desktop keeps the left secondary nav and lands on the first section via a client redirect (the viewport decides, so the server can't). Profile splits out of Appearance into its own page on both form factors, and the section inventory is shared from one module so the nav, the drill-down list, and the back-header can't drift. Also drops the sheet base's gap-4 on bottom sheets — the grab handle's own padding is the only space wanted above sheet content, which was padding the thread title down. Co-Authored-By: Claude Fable 5 <[email protected]>
…eaner copy Mobile settings subpages swap the back-link + big title for the chat header pattern: a full-bleed h-16 bar with a back arrow and the section title. The desktop secondary nav now pivots on the same 500px edge as the mobile drill-down list (hidden + min-[500px]:flex, not max-[499px]:hidden), so a fractional viewport width can never render both at once. Tab bar labels drop leading-none — truncate clips overflow, so the line box must clear descenders. The profile picture no longer rejects large files: the browser downscales any image to a 512px-longest-edge JPEG before storing it. Settings copy diet: card descriptions and how-it-works paragraphs are gone across all six pages. What stays is functional text only — offline and unconfigured-state recovery notes, the operator-managed refusal, error/notice channels, and the one warning a rule requires (writes that restart the daemon say so). Co-Authored-By: Claude Fable 5 <[email protected]>
The mobile settings index adopts the inset-grouped-list convention: filled cards with no border, a solid per-item tinted icon square with a white glyph, hairline dividers inset to the text edge, and tighter 46px rows. Memory leaves the top-level nav (top bar and mobile tab bar both read the one nav config) and becomes a settings section on both form factors: /workspace/settings/memory with the entry detail beneath it. Old /workspace/memory URLs redirect. Section resolution is now prefix-aware, so a memory entry keeps the desktop nav highlight and gets the mobile back header — whose arrow now goes up one level (entry to list, list to index) instead of always to the index. The inline Back button hides on mobile where that header covers it. Co-Authored-By: Claude Fable 5 <[email protected]>
A little gap between top-nav pills so hover and active states don't touch. On mobile the schedules create button shortens to "New" (the full label was truncating the page title) and the session-list position control hides (the list is full-screen there). Co-Authored-By: Claude Fable 5 <[email protected]>
Over a LAN origin the page rendered but nothing worked on any phone: Next dev's cross-origin protection 403'd the /_next/* chunk requests for a non-localhost Host, so the app never hydrated — dead buttons, session list stuck on its spinner. allowedDevOrigins now derives from the same MECATL_STUDIO_PUBLIC_ORIGIN allowlist the API proxy trusts, so one env var opts a deployment's origins into both gates. Dev-only: `next start` has no such gate, and with the var unset behaviour is unchanged (localhost-only). Co-Authored-By: Claude Fable 5 <[email protected]>
Installed as a PWA (black-translucent status bar, viewport-fit cover) the shell drew under the clock and a white strip showed below the tab bar. The gradient column gains safe-area-inset-top padding so the nav clears the status bar while the gradient still paints behind it, and the html canvas is painted the gradient's terminal colour per theme — 100dvh can under-report in standalone iOS, and overscroll exposes the canvas too, so matching the gradient's end keeps both invisible. Co-Authored-By: Claude Fable 5 <[email protected]>
Drop the per-item colour tints from the mobile settings list — the icon chips go back to muted, keeping the inset-grouped layout. Co-Authored-By: Claude Fable 5 <[email protected]>
The mobile composer consolidates to a single line: attach (+) on the left, the field, and one right-hand slot that is the mic until there is text, then the send button (native messaging convention; on insecure origins with no speech API it degrades to the disabled send). Desktop keeps the two-row layout. The model/effort and memory pickers follow the chat-options menu onto bottom sheets on mobile — floating dropdowns clipped against the tab bar. The model sheet flattens the desktop submenus into Model and Effort sections and stays open across taps so both can be set in one visit; memory closes on choice. Co-Authored-By: Claude Fable 5 <[email protected]>
While a text input holds focus on mobile the on-screen keyboard owns the bottom of the screen, so the tab bar hides (focus-based rather than visualViewport-based — it also covers browsers that resize the layout viewport, where the bar would otherwise eat the little height left). Co-Authored-By: Claude Fable 5 <[email protected]>
iOS standalone computes dvh stale at cold launch and self-corrects on the first scroll, so the white strip below the tab bar survived the html-only canvas paint — the stale region sits inside body's box. Body now carries the gradient's terminal colour too (every visible surface declares its own bg-background, so nothing read body's background). The viewport also pins maximumScale/userScalable so the app doesn't pinch-zoom like a document. Co-Authored-By: Claude Fable 5 <[email protected]>
The gradient margin around the card disappears below the breakpoint — content spans the screen width, keeping only the rounded top corners where the card meets the nav band. The inset rounded card becomes a >=500px treatment. Co-Authored-By: Claude Fable 5 <[email protected]>
The mobile composer's + becomes an options button opening a bottom sheet — Add a file, Model, Memory — with Model and Memory drilling into their own sheets (a live-routed model renders display-only), replacing the toolbar pill row, which hides on mobile. The pickers' own mobile sheet branches move into this menu; desktop dropdowns are untouched. Docked composers (main chat and thread) go full-bleed on mobile: a single min-h-16 row — matching the chat title bar, so the two read as symmetric bands — with only a hairline top border, and they own the home-indicator safe area now that they touch the screen edge. The draft view keeps its floating rounded box. Co-Authored-By: Claude Fable 5 <[email protected]>
The bottom tab bar is gone — the top nav's icon row serves all widths again, as before. The mobile card also trims its top rounding to 12px. Co-Authored-By: Claude Fable 5 <[email protected]>
Appearance gains a Text size control (Small / Default / Large / Extra large) — a browser-local preference that scales the root font-size, so the whole rem-based UI follows. Applied on load via a one-line mount in ClientProviders; Default clears the stored key. Co-Authored-By: Claude Fable 5 <[email protected]>
Android Chrome's default keeps the layout viewport fixed under the on-screen keyboard (only the visual viewport shrinks), burying the docked composer behind it. interactive-widget=resizes-content restores layout resize, so h-dvh — and the composer with it — shrinks above the keyboard. iOS ignores the key. Co-Authored-By: Claude Fable 5 <[email protected]>
Mobile reads at arm's length: the default root font-size steps up to 17px below the breakpoint (an explicit Text size choice still overrides via its inline style), and the small UI glyphs step up one notch through one unlayered rule that outranks the size-* utilities. To balance the larger type, the chat title bar, draft header, session list header, settings back bar, and the docked composer all slim from h-16 to h-14 on mobile. The docked composer's top hairline now matches the title bar's divider (border-border, steady across focus — the bar is chrome, not a field), and its options button swaps + for a sliders glyph: + means attach on desktop, and this opens a menu. Co-Authored-By: Claude Fable 5 <[email protected]>
… polish The text-size steps become an interface-scale slider (85–130%): the root font-size is calc()'d against a --ui-scale variable, so the multiplier composes with the per-viewport defaults (16px desktop, 17px mobile) instead of replacing them. Theme and session-list position swap their pill groups for select-style fields — a dropdown on desktop, the app's bottom-sheet picker on mobile (pill rows don't scale on small screens). Settings cards dissolve on mobile (the back bar already names the section), the drill-down rows drop their icon chips for bare glyphs and get descender-safe line boxes, page titles step down to text-3xl on mobile, and the settings nav is now always a vertical left column — the awkward horizontal band between 500px and 640px is gone. Co-Authored-By: Claude Fable 5 <[email protected]>
Settings gains an Agent page (heading Agent runtime): the display name moves there from Profile, joined by an agent picture that replaces the default bot mark in chat. Profile keeps only the user's own picture. Both pictures share one AvatarPicker (browser-local data URLs, downscaled in the browser). Co-Authored-By: Claude Fable 5 <[email protected]>
When the transcript is scrolled away from the bottom, a floating arrow above the composer jumps back down. Co-Authored-By: Claude Fable 5 <[email protected]>
The card's side/bottom gradient margin drops from 20px to 12px on desktop. Co-Authored-By: Claude Fable 5 <[email protected]>
The mobile root steps from 17px to 18px; the Interface scale slider still multiplies on top, and rem-based icons and bar heights scale with it. Co-Authored-By: Claude Fable 5 <[email protected]>
The scroll padding under the transcript reserves room for the absolutely-positioned composer; the mobile docked bar is far slimmer than the desktop box, so the reserve shrinks with it (main chat and threads) instead of leaving a blank band above the input. Co-Authored-By: Claude Fable 5 <[email protected]>
While the user sits at the bottom, sending a message and the streaming response keep the view pinned there; once they scroll up, their position holds and only the floating arrow brings them back down. The follow gate reads a ref mirror of the at-bottom state, so it sees the value as of the latest scroll rather than the latest render. Co-Authored-By: Claude Fable 5 <[email protected]>
… text The token-usage pill leaves the chat header for the context menus: a titled two-line "Token usage" block (input / output) at the top of the desktop dropdown and the mobile options sheet, standard menu type, no status dot. A streaming turn now shows a bottom-of-transcript activity line — three staggered pulsing brand dots with a phase label (thinking / running tools / writing) derived from the streaming message, plus elapsed time — replacing the old spinner block that only rendered in the gap before the assistant placeholder landed, i.e. almost never. Chat responses get a roomier line height (relative 1.75, so it holds at every interface scale), and the composer's focus outline softens a shade on both themes. Co-Authored-By: Claude Fable 5 <[email protected]>
The serif page titles now sit at text-3xl on every width — the mobile override becomes the one size. Entry detail titles keep their own larger treatment. Co-Authored-By: Claude Fable 5 <[email protected]>
Applying the scale on every drag tick rescaled the root font, which relaid out the page and moved the slider under the thumb — a feedback loop. The drag now updates a local preview (the % label follows live) and the scale applies once on release (pointer, keyboard, or blur). Co-Authored-By: Claude Fable 5 <[email protected]>
A ~450ms touch hold on a session row opens a bottom sheet with the same rename/delete actions as the hover "…" menu (unreachable on phones), honoring the daemon row's capabilities and reasons. Mouse pointers are ignored, the release click is swallowed, Android's native long-press contextmenu is suppressed for touch, and iOS's selection callout is disabled on the row. Co-Authored-By: Claude Fable 5 <[email protected]>
The new-chat view docks its composer at the bottom exactly like an open chat — desktop and mobile — so the draft-to-chat transition doesn't move the input under your hands; the greeting and starter chips stay centered above, and the subtitle line is gone. Co-Authored-By: Claude Fable 5 <[email protected]>
The slider gives way to a stepper on the right of the row (5% steps, bounds-disabled buttons, live %). Discrete clicks also make the mid-drag relayout feedback loop structurally impossible. Co-Authored-By: Claude Fable 5 <[email protected]>
Picked images now cross the wire: the composer's files ride sendMessage into the daemon prompt's multimodal parts (standard-base64 data, image/* only — the daemon has no document part kind), with a 5 MB client-side ceiling and the pickers/drop-zone scoped to images. The user bubble keeps name+type chips. Token usage now accumulates the daemon's per-run figures into a chat total and shows in the context menus whenever any landed, not only while the session is live in this tab. (A reload still loses it: the HTTP read surface doesn't expose the session's persisted cumulative usage — a small additive daemon field if wanted.) The usage block carries its own hairline, and the separators above Delete are gone from all the chat menus. Co-Authored-By: Claude Fable 5 <[email protected]>
Co-Authored-By: Claude Fable 5 <[email protected]>
The hover reveal was gated to lg: (>=1024px), so any narrower desktop window never showed the rename/delete menu at all. Hover exists wherever a mouse does — the gate is the mobile breakpoint now (touch has the long-press sheet). Co-Authored-By: Claude Fable 5 <[email protected]>
Phone photos are 4–12 MB HEIC — over the daemon's byte budget (413) and in a format vision providers don't take. A small image in a provider-friendly format still goes as-is; everything else downscales onto a canvas (1600px longest edge) and re-encodes as JPEG, so Safari transcodes HEIC on the way through. A browser that cannot decode the format fails with a named error instead of a silent drop. Co-Authored-By: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #618. Makes Studio genuinely usable on a phone, verified against a live daemon at 375×812 and on a real device.
What changed
Shell & layout
sm:/640px in between).Interaction fixes (found on-device)
useIsMobileisundefinedon first render so the list initialised over the chat, and selecting a rowrouter.pushed across the optional catch-all's segment-count boundary — remounting the page and resetting that init. Selection now uses nativehistory.pushState(the same no-remount pattern that fixed the draft-mint stream) plus a measured-mobile guard.Bottom sheets, per modern mobile conventions
Threads on mobile
PWA
appleWebAppmetadata, media-queried theme colors,viewportFit: cover. No service worker by design — Studio is a local daemon client, and offline caching would lie about live state; installability doesn't require one.Verification
tsc --noEmit,biome check, vitest 70/70,next buildclean.mecated: tap-to-open navigates, the thread sheet renders with a focused full composer, manifest and icons serve.🤖 Generated with Claude Code