Repository navigation
fix(mobile): share sidebar hierarchy and hide standalone subagents - #322
Merged
Merged
Conversation
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
marked this pull request as ready for review
November 7, 2026 08:36
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.
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:checkand the web production build passed.bun run typecheckandbunx expo lintpassed. Shared selector coverage: 6 tests, 21 assertions. Focused mobile/linked-project transport coverage: 15 tests, 94 assertions.bun run check:tmp --timeout 30000: 1655 passed, 161 skipped, 0 failed; nothing left in the test temporary directory. Run with worktree-localTMPDIRandGIT_CEILING_DIRECTORIESto 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.spawn_threadandask_usercalls; 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 shows1 finished subagent.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)
Needs inputrow → parentSubagent needs input/N subagents need inputN side thread(s)andPrevious agents · NArchived→Archived · N, withLoad moreandRetryChecked 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.