feat(mobile): agent sessions on the compact shell — chat, inbox, new-session sheet - #302
Merged
Conversation
…targets Finish the AgentChatView compact variant on top of the merged PR #300 world: the header model picker is extracted into a shared ModelPicker and rides above the composer on phones (same testids); the starting-state elapsed-second pill is extracted to lib/agentStarting and reused by the mobile title bar; ask-card options become 52px touch targets and the composer a 44px row with a 44px send button; resume moves above the composer. The mobile title bar also stops offering the terminal long-press sheet while a chat is open.
Extract NewSessionDialog's state (remembered defaults, model options from live sessions + cache, recent cwds, bookmarks, validation, submit) into useNewSessionState and build NewSessionSheet on it: a bottom sheet per MobileNew.dc.html with agent chips, a 44px model dropdown, recent/bookmark directory rows, a machine picker only when >1 machine is online (PROD tag → auto-run off note), single-line auto-run toggle and a full-width Create button. The desktop panel's UI and testids are unchanged.
TerminalCanvas compact branch: MobileWorkbench gets the agent session lists, seen map, inbox (askedSessions) and pick/kill/new-session callbacks; the selected session renders as chatContent (compact AgentChatView with send/stop/answer/model/resume handlers); the title-bar + opens NewSessionSheet seeded from the active group, whose terminal chip preserves the old direct-create behavior (current group's cwd, full tab overflows into a fresh one); agent picks follow the session across hosts; kill goes through a canvas-owned ConfirmDialog.
New mobile-agent-sessions.spec.ts (iPhone 14 viewport, fake ACP agent): API-created session appears in the switcher with badge and opens the chat page; send streams the echo; ask-card option tap resolves (auto_run=off); asked elsewhere surfaces the title-bar amber dot, the cross-session reminder and the inbox banner jump; the + sheet creates an agent session; kill from the chat title bar confirms and removes. mobile-controls.spec.ts: the title-bar + is now mobile-bar-new-session and creation goes through the sheet — the two direct-create assertions use the new mobileCreateTerminalViaSheet helper (terminal chip + submit), keeping the cwd/placement expectations intact.
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.
What
Mobile finally sees agent sessions (they were desktop-only since #294):
AgentChatViewcompact variant (not a fork) — 44px composer, 52px option chips, header model picker, honest starting state (elapsed + cold-start hint), soft-keyboard handling via the existing visual-viewport pattern, no key bar in chat, IME-safe composer.#/a/<id>deep links work on mobile.Base includes a merge of main (#297/#299/#300) with conflict resolution over the parallel desktop changes.
Verification
pnpm typecheck/pnpm test(345, incl. 6 new ordering/unread cases) /pnpm buildcleanmobile-agent-sessions.spec.ts(5 scenarios: switcher→chat, streamed echo, ask-card tap resolve, asked-elsewhere jump, sheet create + kill) all pass; the 1 failure is the known perf: end-to-end input latency, scroll feel, and mobile IME fixes #295 IME timing flake (fails on unrelated branches too, tracked separately, reproduces ~10% under host load — evidence handed to that effort)Implementation: Kimi K3 (headless, resumed across a host reboot); spec & report in docs/plans/2026-08-30-mobile-chat*.md.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KCy6QFUCj4GhjHdv4x5FwY