Skip to content

fix(mobile): share sidebar hierarchy and hide standalone subagents - #322

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

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

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Change

Mobile listed agent-spawned threads as independent conversations, including pinned subagents. Its separate filtering also lost side-thread hierarchy and differed from web search, archive and section rules.

Move the existing web sidebar selectors, section ordering, activity helpers and archive pager into @canopy/domain, and consume them from both apps. Web rendering stays unchanged. Mobile nests user side threads, keeps previous agents under their parents, and marks each parent once when a subagent needs the user. Pinned, Working and project sections share the same rules. Mobile snapshots now include archived sides of active parents, matching the web sidebar index.

Subagent results stay inside the thread; user-directed questions alert through the parent. The composer still exposes active and finished subagents, with user side threads excluded from its finished-subagent count.

Verification

  • bun install, bun run gen:check, bun run typecheck, bun run lint, bun run format:check and the web production build passed.
  • Mobile bun run typecheck and bunx expo lint passed. Shared selector coverage: 6 tests, 21 assertions. Focused mobile/linked-project transport coverage: 15 tests, 94 assertions.
  • Full bun run check:tmp --timeout 30000: 1655 passed, 161 skipped, 0 failed; nothing left in the test temporary directory. Run with worktree-local TMPDIR and GIT_CEILING_DIRECTORIES to keep non-Git fixtures from inheriting the repository origin. The 30-second limit accommodates an unrelated bot harness test that exceeded the default 5 seconds; it passed in the final full run.
  • T3 Android verification on a phone and unfolded Fold, light and dark: isolated gateway, PostgreSQL and scripted WorkerLink worker; real spawn_thread and ask_user calls; finished and waiting subagents, a long user-side title, pinned/working sections, side navigation, search and archived parents/children. The parent shows one input-needed state; no standalone subagent, including the pinned finished one; the composer shows 1 finished subagent.
  • T3 browser verification at desktop and phone widths, light and dark: unchanged parent/side hierarchy, attention and working sections, side-title search and archive search. Preview tab and both devices closed. No web UI tests or EAS builds.

All CI checks passed. Inline self-review found no blocking issues; independent review is pending. The isolated gateway, worker, PostgreSQL, development servers and tunnel are stopped.

Copy audit (§8)

Before → after Reason
Separate subagent Needs input row → parent Subagent needs input / N subagents need input Identify who needs attention without duplicate rows.
Flat side threads → N side thread(s) and Previous agents · N Explain the nested disclosure using existing web terms.
Archived → Archived · N, with Load more and Retry Show the filtered count and the available action.

Checked sentence case, short statuses, plurals and glossary; no new terms or decorative sentences. Actions use verbs; archive failures provide Retry, empty states stay concise, and no status relies on color alone. No duplicated attention badge/count. Checked short, typical and long text on desktop, phone and Fold in both themes.

Reuse the web sidebar selectors and archive pager from domain. Keep side threads under their parents, aggregate subagent attention once, and include previous side threads in mobile snapshots.
@nixuuu
nixuuu marked this pull request as ready for review November 7, 2026 08:36
@nixuuu
nixuuu merged commit ece495d into dev Nov 7, 2026
11 checks passed
@nixuuu
nixuuu deleted the fix/mobile-sidebar-subagents branch November 7, 2026 08:39
nixuuu added a commit that referenced this pull request Nov 7, 2026
Keep completed, failed and interrupted subagents accessible from parent details and the mobile subagent sheet. Verify owner follow-ups retain the child worker and provider session.

Related: #322
nixuuu added a commit that referenced this pull request Nov 7, 2026
Finished subagents disappear from thread details when the default
display setting is off. After the sidebar stopped listing subagents,
this left no route to their history or composer.

Web (including desktop) and mobile now keep them under an expandable “N
finished” group. It starts collapsed and remembers its state on the
device. Each row opens the thread and shows its provider, title, outcome
and relative activity time. The mobile composer chip opens the same list
in a sheet. Keeping finished subagents in the main list remains
available in Settings.

Owner follow-ups already work for completed, failed and interrupted
subagents: the gateway preserves the child's worker and provider
session. No gateway permission or lifecycle changes are needed.
Explicitly archived threads remain readable and require **Unarchive**
before a follow-up, preserving the existing archive behavior that stops
work and schedules. The parent-origin link is unchanged.

Related: #322

## Verification

- 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`.
- All PR CI checks are green on the final head, including static checks,
all four test shards, typecheck and builds. Local full `bun run
check:tmp` passed before rebase (**1676 pass, 161 skip, 0 fail**). After
rebase: **1675 pass, 161 skip, 1 timeout** in the existing `CODEX
routine and wakeup use the harness and preserve visibility` test (5 s
limit); that entire file then passed in isolation (**11/11**). Focused
follow-up and Full access coverage passes after rebase (**7/7**). Every
run cleaned its test temp directory. Scratch data stays under the
worktree; `GIT_CEILING_DIRECTORIES` prevents temporary project fixtures
from inheriting the enclosing worktree's remote.
- Added gateway/worker integration coverage for full history and owner
follow-ups after completed, failed and interrupted turns, child
provider-session routing, and rejection of another owner's read/message
attempts. No web UI tests added.
- Real-browser checks used an isolated gateway, Postgres, scripted
worker and web server. Subagents were spawned through gateway agent-bus
calls. Checked 0/1/5 finished, short/typical/long titles, setting
on/off, remembered expansion, light/dark and desktop/narrow/phone
widths. Opened a finished thread, read its history and parent origin,
and sent a follow-up from its composer. This verifies gateway routing
and UI behavior with the scripted worker; it does not exercise live
provider inference. Motion reuses the existing disclosure/expand tokens
and reduced-motion handling.
- Android and iOS checks were attempted through T3 devices and our Metro
server. Both installed development clients fail to load current JS with
`Cannot find native module 'CanopyPinnedFetch'`; native UI remains
unverified. No native builds or temporary AVDs were created. Owned tabs,
device panels, servers, tunnel and containers were cleaned up.

## Componentize pass

Applied `design`, `componentize` and `transitions-dev` guidance using
existing kit components. Web shares `SubagentList` and `LineageRow`;
mobile shares `SubagentLineage` and its row between thread details and
`SubagentSheet`. State classification and the existing compact age
formatter live in the shared domain package. Native rows use `now` /
`5m` / `3h`, avoiding Hermes's unsupported `Intl.RelativeTimeFormat`;
web keeps its existing relative-time formatter. The final pass removed
repeated list markup and kept provider/navigation icons in fixed slots
with truncating titles.

## Copy audit (§8)

| Before → after | Reason |
| --- | --- |
| “Show finished subagents” → “Keep finished subagents in the list” |
The setting controls placement; finished threads remain reachable with
either value. |
| “Include completed, failed and interrupted subagents in thread
details.” → “When off, completed, failed and interrupted subagents stay
in a separate expandable group.” | One 13-word sentence explains the off
state without repeating the title. |
| Plain finished count → expandable “N finished”, with “Completed”,
“Failed” or “Interrupted” per row | Makes access and outcomes visible in
words, with correct counts and sentence case. |

Audited all ten items: concise active English and glossary terms; action
labels unchanged; no new errors or empty-state copy; no duplicated
explanatory facts, optional-gap messages or “soul” text; no meaning
conveyed by color/icon alone. Short, typical and long titles were
checked at desktop and phone widths in the browser. Native copy/layout
checks share the device limitation above.
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