Skip to content

fix(mobile): show subagents in a compact panel like the web - #347

Merged
nixuuu merged 1 commit into
devfrom
fix/mobile-subagents-panel
Nov 7, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/mobile-subagents-panel

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 7, 2026

Copy link
Copy Markdown
Member

Replaces the overflowing mobile subagent chips with one compact summary row above the composer. Needs-input counts remain highlighted while typing. Expanding shows state, title, provider/model and the first plain-text line of the last message; finished subagents remain reachable in their disclosure group, and rows open their threads.

The list uses a bounded overlay accordion (up to 240 dp, with internal scrolling) instead of a sheet. It keeps the keyboard and composer focus available and needs no additional sheet header or dismissal step. A permanent 44 dp summary slot keeps the composer measurement and feed reserve unchanged when agents start, finish or expand. Mention suggestions retain their existing overlay slot and temporarily take precedence. Expansion is collapsed by default and saved per device.

Also restores start/end timestamps for provider/recovery-origin turns in the mobile snapshot reducer, including disk-cache replay. This fixes missing elapsed time in the work header; older data without timestamps says “Working” instead of “Working for” without a duration. Timers use tabular digits.

Fixes: #231
Related: #332

Verification

  • Gates passed: bun install, bun run gen:check, bun run typecheck, bun run lint, bun run format:check, web build, mobile typecheck and bunx expo lint. Expo Doctor: 20/20; iOS and Android bundle exports passed. Full bun run check:tmp: 1,755 passed, 161 skipped, 0 failed; no test temp entries left. Test temporary data stayed inside the worktree, with GIT_CEILING_DIRECTORIES to prevent nested test folders inheriting the checkout's Git repository.
  • Built an arm64 Android debug client on Linux with private SDK/Gradle, no daemon, two workers, in-process Kotlin and a 2 GiB Java heap. No EAS/store build or Mac build.
  • T3 manual checks on Android 16: Medium Phone and a temporary copy of the busy Canopy Fold profile; light/dark, keyboard open/closed, long titles, one/many subagents, finished disclosure, row navigation, typing mode, saved expansion after app restart, and system animations disabled. Isolated gateway, scripted worker and Postgres provided two working + one waiting + two finished subagents. A live provider-origin turn displayed its elapsed time alongside “Wait threads…”.
  • Dynamic 0 → 1 → finished on Fold kept the composer field at y=1697 and the feed work header at y=1236. Compared the existing web panel in T3 preview at desktop and phone widths, light/dark. No UI tests added. iOS UI remains unverified: installed clients could not load this JS (the development launcher rejected Metro through ATS); no Mac rebuild attempted.

Componentize and motion pass

Completed before commit using the design, componentize and transitions-dev skills. Composer and thread details share SubagentLineage, SubagentLineageRow and SubagentGroup; web/mobile share grouping and status presentation in @canopy/domain/subagents. Native components accept style, use existing type/color tokens, and keep spacing at the call site. Existing pop, Expand and chevron motion tokens are reused; panel/group expansion is immediate with reduced motion.

Copy audit (§8)

  • Individual truncated chips → “Subagents · N running · N finished” plus “N needs/need input”: one scannable line, explicit counts and singular/plural agreement; attention has a text cue as well as color.
  • Sparse lineage rows → existing web labels “Working”, “Waiting for an answer”, “Completed”, “Failed”, “Interrupted”, “N finished” and “Previous subagents”, with provider/model and message context. Existing “Working on it…” / “No message yet” cover missing previews. No new glossary terms.
  • “Working for” with no duration → “Working” only when no timestamp exists; timed work keeps “Working for 2m 0s”. No invented elapsed time.
  • Checked sentence case, punctuation, concise labels, accessible disclosure state and short/long titles. Disclosure labels name their contents, consistent with web. No new error, confirmation, empty-state action, humor or repeated explanatory text.

Replace overflowing chips with a device-persistent summary and bounded overlay list. Keep composer and feed geometry stable, including while typing with the keyboard open. Restore elapsed time for provider and recovery turns in the mobile snapshot cache.

Fixes: #231

Related: #332
@nixuuu
nixuuu merged commit a9e2745 into dev Nov 7, 2026
10 checks passed
@nixuuu
nixuuu deleted the fix/mobile-subagents-panel branch November 7, 2026 17:46
nixuuu added a commit that referenced this pull request Nov 8, 2026
Closing the expanded mobile subagents panel could draw its rows through
the composer. Keep the panel anchored and clipped until its animation
reaches the closed state.

Fixes: #347

### Cause and change

The conditional render removed the panel's flex slot before Reanimated
finished the native `exiting` animation. The retained native view lost
its bottom anchor and moved into the composer. A persistent outer clip
now retains the slot; an inner surface follows one reversible opacity/4
dp upward translation using `fast`, `quick`, and `distance.micro`. At
zero progress the slot is hidden. Reduced motion switches instantly, and
closed content cannot receive touches or accessibility focus. The 240 dp
bound, internal scrolling, saved expansion and fixed composer/feed
reserve remain intact. Interrupted toggles retain progress and scroll
state without teardown callbacks.

The narrow portrait column also has an application-side cause: the
sidebar kept reserving its width until an asynchronous close callback.
Its render-phase context update additionally consumed the intended
`instant` flag before commit. Remounting the sidebar at a layout-context
boundary now selects its target state immediately; manual sidebar
toggles still animate. This removes that code path, but device rotation
verification remains incomplete, so this does not establish that every
frame in the supplied iPhone recording came from our layout rather than
an OS snapshot.

### Evidence and device verification

- Reviewed the supplied iPhone close/rotation recording. Reproduced the
close glitch on the Android phone baseline with Gboard visible: the
closing list appears below the summary in the composer area. The
corresponding fixed close frames remain above the summary, with
stationary composer and feed.
- Used T3 Device tools on a separate Android phone and Canopy Fold with
an isolated gateway, scripted worker and Postgres: one running and nine
finished children, including long labels. Recorded before/after clips
and inspected extracted frames; final fixed recordings cover light/dark
and keyboard shown/hidden on both devices.
- Exercised rapid repeated toggles, closing a scrolled list, reopening
with retained scroll position, saved expansion after app restart, and
the Android reduced-motion setting. No UI test suites added.
- Evidence is retained outside version control. Primary captures:
`before-phone-keyboard-verified.mp4`,
`after-phone-{light,dark}-verified.mp4`,
`after-fold-{light,dark}-verified.mp4`; extracted close frames include
`before-phone-close.png`, `after-phone-close-frames.png` and
`after-fold-close-frames.png`. Earlier exploratory recordings are not
all reliable keyboard evidence.
- **Not verified:** native iOS behavior. Its installed client lacks
`ExpoClipboard`; Mac free space was below the required 12 GB (latest
check: 1.9 GiB), so no iOS build was attempted. Android rotation
requests returned `unconfirmed` and did not change the visible viewport;
Fold pose commands also did not produce a cover-width viewport.
Rotation/breakpoint transitions remain unverified on devices.

### Checks

Passed: `bun install`, `bun run gen:check`, `bun run typecheck`
(including mobile), `bun run lint`, `bun run format:check`, web build,
mobile `bunx expo lint`, Expo Doctor (20/20), Android CNG prebuild, both
native Hermes bundle exports and a local Android ARM64 debug build with
a private SDK/Gradle and bounded heap/workers. Final formatting and diff
checks are clean.

**Full gate not green:** `bun run check:tmp` reported 16 failures in
unchanged gateway/worker areas (add-project, bot routines/wakeups,
shell, relay, linked-project routes and mirrors), then ended with
SIGTERM/143 near the final updates tests without the final temp audit.
Focused reruns: add-project 7 pass/1 fail; bot harness regressions 7
pass/4 fail/4 errors; both focused temp audits clean. These failures
were not repaired in this UI change, and not all have been established
as baseline failures. Draft pending a green full gate and the missing
native verification.

Owned servers, tunnel, reverse mappings, database container/volume and
device sessions were cleaned up. Existing AVDs were preserved; generated
native output and private build caches were removed. No store/EAS build,
submission or merge.

Copy audit: no UI text changed.
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