Skip to content

feat(mobile): agent sessions on the compact shell — chat, inbox, new-session sheet - #302

Merged
chareice merged 7 commits into
mainfrom
feat-mobile-chat
Aug 30, 2026
Merged

feat(mobile): agent sessions on the compact shell — chat, inbox, new-session sheet#302
chareice merged 7 commits into
mainfrom
feat-mobile-chat

Conversation

@chareice

Copy link
Copy Markdown
Collaborator

What

Mobile finally sees agent sessions (they were desktop-only since #294):

  • Session model: agent sessions join the mobile switcher sheet and strip/swipe order, grouped like the desktop sidebar (reused projection). Rows: agent badge, status dot (same semantics — amber only for asked), unread bold+dot; no per-row kill for agent rows (kill lives in the chat header).
  • Inbox: amber banner in the switcher ("N waiting on you", tap → oldest asked), amber dot on the title bar, and an in-chat cross-session reminder chip when a different session becomes asked.
  • Compact chat view: AgentChatView compact 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.
  • New-session sheet: bottom-sheet mirror of feat: one-click session creation + model selection across agents #300's one-screen prefilled flow incl. model dropdown; the terminal chip preserves the old + behavior exactly (current group cwd, overflow rule).
  • Routing: #/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 build clean
  • Containerized e2e, isolated stack: 88/89 — new mobile-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

…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.
@chareice
chareice merged commit e5205fd into main Aug 30, 2026
3 checks passed
@chareice
chareice deleted the feat-mobile-chat branch August 30, 2026 01:38
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