Skip to content

feat(app): iOS agent-status orbs in the sidebar - #57357

Open
kitlangton wants to merge 1 commit into
betafrom
agent-orbs
Open

kitlangton wants to merge 1 commit into
betafrom
agent-orbs

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

Why

Busy sessions in the sidebar and the timeline's Working lane all show the same grey dot grid, whatever the agent is doing. The iOS app already uses orbs that tell thinking, tools, shell, needs-you, failed and done apart at a glance.

Video (1440×900 @2×, 60 fps: dark, light, a 0.25× cut, and before|after against the dot grid): https://problems.kitlangton.com/media/0loKdv0WTTseRmWxl4I-7w.mp4
Before|after only: https://problems.kitlangton.com/media/JTyo5MfB7wYr-1u8-2LGRw.mp4
Playground (tailnet): https://studio.taila8e7c7.ts.net:4850/orbs/

What Changes

  • AgentOrb in @opencode/session-ui/v2/agent-orb: a port of the iOS ActivityGyro, the shell prompt glyph and the orb shader.

    • One WebGL2 context for the whole page. Each frame draws the orbs that moved into tiles of one offscreen canvas, then copies each tile into that orb's 2D canvas, so Chromium's cap on live contexts never applies.
    • The loop runs only when needed: while a visible orb is still moving and the window is shown and focused. Resting orbs and a hidden or background window cost no GPU time.
    • Fallbacks: without WebGL2, a still dotted disc tinted by state. With reduced motion, the iOS still pose.
    • Sizes under 24px light the unlit grid, the dots and the glow a little harder so idle and thinking stay legible at 1×.
  • State mapping (agent-orb-state.ts, in priority order):

    Session Orb
    Permission or question waiting waiting
    Running a shell tool shell
    Running a subagent tool handoff
    Running another tool tool
    Text streaming streaming
    Running, nothing more specific thinking
    Subagent still running handoff
    Background shell still running shell
    Run just ended done or failed for 2.6 s, then the project avatar
    Interrupted straight back to the avatar
    New session still being created startup
  • Where orbs appear:

    • Session tab rows: the vertical sidebar, the horizontal titlebar and the mobile tabs button.
    • The timeline's Working lane: a thinking orb before "Working".
  • Settings → Appearance → Agent status: Orb / Classic, default Orb. Classic is today's indicator, unchanged.

Scope

  • The activity pill, session header and activity-chips are untouched; the capsule redesign (D-7) is still open.
  • Shells report no byte rate, so the shell glyph laps at the iOS lab's nominal 800 B/s.
  • English strings only; other locales fall back.

LOC:

Part Lines
Ported engine (gyro.ts, shell.ts, render.ts) +2044
Component, loop and app wiring +573 / −9
Tests +123 / −16

Verification

  • Unit tests: agent-orb-state.test.ts covers the state mapping, the running step and the last outcome (9 tests).
  • E2E: tabs.spec.ts and new-session.spec.ts now accept either indicator style.
    • Locally on the built app, everything passes except two tests that fail identically on beta: tab shortcuts in the side panel, and worktree composer text order.
    • new-session.spec.ts also needed seven lint fixes it already had, because lint:changed checks whole files.
  • Perf: headless Chromium with ANGLE/Metal, 21 orbs on screen (20 rows plus the Working lane).
    • Main-thread rAF cost: 0.35 ms on average, 0.40 ms at p95, 241 frames in 4 s.
    • Once every session went idle and the finales played out, the loop made zero rAF calls over 4 s.
    • The playground measured GPU time at 0.2–0.56 ms per frame for 20 orbs.
  • bun typecheck in app and session-ui, and bun run lint:changed origin/beta, are clean.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant