feat(mobile): ACP-backed workspace pages — restyled home, native workspace screen, diff surface

Merged
SA
4mo ago
+2288-442

Summary

Reworks the mobile workspace UX end to end on the new ACP session architecture:

  • Home list restyle — chat-card background removed; sessions hang off a thread rail under their workspace, date sections separate on whitespace, ghost + button starts a chat in that workspace, row tap opens the workspace page.
  • ACP sessions everywhere — home and workspace chat lists read host-wide acpSessions.list (useHostAcpSessions, 30s poll + focus refetch); the composer creates an ACP session and prompts it; threads open at chat/acp/[sessionId]. The legacy live-sessions surface is removed.
  • Native workspace page — flattened into the root stack for a real back chevron; transparent glass header with title + branch subtitle, native toolbar (compose + workspace menu); chat list with workspace-pinned composer and a glass "View changes" chip.
  • Diff surface — Changes screen (files/commits/PR checks), files-changed list with per-file viewer, commits formSheet with a native pinned header and continuous timeline rail.
  • Composer polish — whole-pill tap-to-focus via contentShape + onTapGesture, tighter SwiftUI edge padding, fixedTarget/above slots for the workspace page.
  • Client plumbing — host-client listSessions accepts optional host-wide input; git router gains commit-file stats; ACP client-unification proposal in plans/.

Test plan

  • Home lists workspaces with their ACP sessions; + targets the composer; sends create a session and land in the thread
  • Workspace page: back chevron, title/subtitle header, tridot menu (rename/delete/copy/share), full-screen scroll, pinned composer sends
  • Chat thread: native back + session-title header
  • Changes → files changed / commits sheet render real data (verified in sim against local host)
  • bun run lint and turbo typecheck green across mobile, host-client, host-service
  • Cold-mount check of the commits formSheet on a fresh install

Open in Stage

Summary by cubic

Rebuilt the mobile workspace around ACP: home shows per‑workspace session rails, a native workspace page hosts chats with a pinned composer and “View changes,” and a full diff surface covers files, commits, and PR checks. Also fixes diff cache correctness, a viewed‑files selector render loop, large‑changeset fetch stampedes, and improves commit avatar resolution.

  • New Features

    • Home: restyled rows; sessions from host‑wide acpSessions.list with 30s polling; tap workspace opens its page; plus button starts a chat.
    • ACP threads: workspace/[id]/chat/acp/[sessionId] route with a glass title header; legacy live‑sessions view removed.
    • Workspace screen: native transparent header with back chevron, title + branch, toolbar menu; session list; pinned composer; glass “View changes” chip.
    • Diff surface: Changes (files/commits/PR checks), per‑file viewer, commits formSheet with a timeline rail and author avatars; avatars resolve by email or display name; viewed‑file tracking; cache/key fixes and finite stale times to prevent fetch stampedes.
    • Client plumbing: host-client listSessions(routingKey, input?) supports host‑wide input; git router adds per‑file stats and authorEmail; added useHostAcpSessions; new dependency diff.
  • Migration

    • Update navigation to /(authenticated)/workspace/[id]/chat/acp/[sessionId]; remove links to the old live‑sessions screen.
    • Update calls to listAcpSessions to pass an optional input object (e.g., { workspaceId, cursor, limit }).
    • Install diff in apps/mobile and the lockfile.
    • Hosts must expose acpSessions.list and the updated git procedures (commit files and authorEmail) for diff/commits views.

Summary by CodeRabbit

  • New Features
    • Added ACP-based session browsing on Home and Workspace, with session navigation into the ACP chat flow.
    • Introduced workspace screens for Diff (PR/status summaries), Files Changed (pull-to-refresh, viewed tracking, per-file comments/actions), File Viewer, and Commits (timeline with author avatars and per-commit additions/deletions).
  • UX Improvements
    • Refreshed the “new chat” experience to support a fixed target, plus refined workspace header/glass presentation and session list typography/spacing.