Skip to content

feat(mobile): match the web composer tray for subagents, tasks and queue - #466

Merged
nixuuu merged 1 commit into
devfrom
feat/mobile-composer-parity-1
Nov 10, 2026
Merged

nixuuu merged 1 commit into
devfrom
feat/mobile-composer-parity-1

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 10, 2026

Copy link
Copy Markdown
Member

Stage 1 of 2 (stacked; stage 2 is the split Steer / Queue send button). Mobile now shows the same stack above the composer as web/desktop. Before this, mobile had a plain "Subagents · 1 finished ›" text row, the queue sat in the timeline, and there was no background-tasks chip or goal row.

What changes

  • Tray (features/threads/tray, web: ComposerTop): one stack on the composer's surface, rounded top corners only. It is inset 16 dp, the box's corner radius, so its sides meet the box's straight top edge and the box's top border closes it. Order is web's: goal, subagents, queue, then requests nearest the input. Each panel has a shared TrayHeader (40 dp row, 48 dp target, 14 text, 16 icon, 12 chevron) and a hairline above it. A folded composer folds the panel bodies; the headers stay. A tall stack scrolls without closing the keyboard.
  • Subagents (web: SubagentsPanel): only working or waiting subagents (subagentsOf). The header shows the shared summary "2 subagents working · 1 needs you" and provider icons. Expanded, each row has a status dot, title, state label and the first line of the last message, and opens the thread. Finished subagents leave the tray; thread details keep the full lineage. subagentsExpanded still remembers the open state.
  • Queue (web: QueuePanel): "N queued", open by default, rows in run order. Each row has the text with chip names, a warning when a steer fell back, Steer (only while a turn runs), Delete (toast with Undo) and "…". The "…" sheet has "Runs with …", Edit message, the moves and Turn on/off queueing. Changes show at once (useQueue); a refusal restores the gateway's state and says why in a toast. Queued messages leave the timeline until the gateway starts them, as on web (buildTimeline).
  • Goal (web: GoalBar, embedded): status icon and colour, objective, and a dot with the status or what it waits for (Starting… / Pausing… / Resuming…). Pause or Resume sits inline; a tap opens the goal sheet (full objective, latest check, Clear with confirmation, Replace). An achieved goal can be dismissed. The composer's "Goal" pill is gone; "Set a goal…" stays in the thread menu.
  • Requests: the "Answer questions" / "Review request" row moves into the tray, nearest the input, with the Expires in m:ss countdown and the pending count. The sheet is unchanged.
  • Background tasks (web: BackgroundTasksChip): an "N running in background" chip on the left above the tray. It opens the running tasks with status, "Show full output" and "Stop task"; the sheet closes with the last task.
  • No layout shift: status notes (Sending…, delivery error, computer offline), the chip and the tray float outside the composer measurement, on the composer canvas with their own 32 dp fade. Their height joins the feed reserve only at the end of the feed (useFloatingComposer.measureAccessory). There the latest message moves up with them; while reading history nothing moves, and the reserve catches up on return.
  • Shared rules move to @canopy/domain (goals look/actions/pending/showsGoal, queue order/moves, subagents subagentsOf/subagentSummary, model-name). Web re-exports them, so web behaviour is unchanged.

Parity table (web → mobile)

Web element Mobile element Status
ComposerTop stack tucked under the composer ComposerTray, rounded top, inset to the box radius, closed by the box border ✅ (inset 16 dp vs web 8 px, so there is no notch at the rounded corners)
GoalBar embedded: icon, objective, status/pending, pause/resume, clear, details accordion GoalPanel: icon, objective, status/pending, pause/resume inline; details, clear, replace in the goal sheet ✅ (accordion → sheet)
SubagentsPanel: active-only summary, provider icons, rows to the thread SubagentsPanel, same rules and copy ✅ (rows hide provider/model, as web does on phones)
QueuePanel + QueueRow: Steer, Delete + Undo, "…" (Runs with, Edit, Move top/bottom, queueing toggle), drag to reorder QueuePanel: Steer, Delete + Undo, "…" sheet (Runs with, Edit, Move up/down/top/bottom, queueing toggle) ✅ (reorder by menu, no drag)
Queued turns are not timeline rows Same (visibleTurns) ✅
QuestionForm docked in ComposerTop; permission cards above Tray request row with countdown → sheet (questions, approvals, MCP forms) ⚠️ sheet instead of a docked form; the composer stays usable
BackgroundTasksChip (one → output, several → menu) BackgroundTasksChip → sheet with each running task's output and Stop ✅
Compact composer folds panel bodies Same (compact → bodies fold, headers stay) ✅ (headers keep 40 dp; web uses 28 px)
ThreadSyncStatus "Syncing…" above the tray ✅ (unchanged)
Steer/queue split send button Stage 2 ➡️ next PR

Copy audit (docs/copy.md §8)

Before → after Reason
"Subagents · N running · N finished" + "N needs input" → "N subagents working · N needs you" Same summary as web; finished subagents are in details
(queue "…" on a timeline bubble) → "N queued", "Steer into the running turn now", "Delete", "More actions" Web's queue labels; buttons start with a verb
"Steer now" / "Delete message" in the menu → inline Steer and Delete; menu keeps "Edit message", "Move up/down/to top/to bottom" Web's split between the row and its menu
New: "Turn on queueing" / "Turn off queueing" with "Send queues for the next turn. Hold Send to steer." / "Send steers into the running turn. Hold Send to queue." Web's toggle, with keys replaced by touch; one idea per sentence
New: "Runs with …", "(only files)", "(only quotes)", "Could not join the running turn" Web strings
"Queued message deleted" → "Message deleted"; errors "Could not reorder/delete/steer/restore: ‹reason›" Web strings; what happened, then the gateway's reason
Goal pill "Goal" → goal row; new "Pause the goal", "Resume the goal", "Dismiss" Web strings
New: "N running in background", "Show tasks" (accessible name), sheet "Background tasks" Web chip; existing section title

Glossary: subagent, turn, queue, goal and background task, as in §3. No new terms. No soul sentences. Long titles, objectives and queue texts truncate on one line (checked in code; see manual checks).

Verification

  • bun install, bun run gen:check, bun run typecheck, bun run lint, bun run format:check, the web build, bun test packages/domain: clean. A full local check:tmp was not run (shared machine); CI is the gate.
  • OTA: bunx [email protected] fingerprint:generate --platform <ios|android> --build-profile production --json --non-interactive gives iOS 6ddec9ef559ee0095ac33e94ff9418a942053b17 and Android 5f6eae3ab278f1cd543e9ed763f923a319b65ec9, the same as dev (fix(threads): let composer pills hug their labels #464). JS/TS only.
  • Web reference: the real web components (GoalBar, SubagentsPanel, QueuePanel, BackgroundTasksChip, SteerSendButton) rendered with fixtures in Chromium at 390 px (dark/light, short/long texts, compact) and 1000 px. That page was scratch-only and is not committed. The mobile layout follows those measurements.
  • Native visuals not verified: the installed simulator clients lack this checkout's native modules, and native builds were not allowed. The manual checks are below.

Manual device checks (iPhone + Android phone, plus a Fold unfolded; light + dark)

  1. A thread with 1 working and 1 waiting subagent: the tray shows "1 subagent working · 1 needs you" with a provider icon. A tap opens the rows; a row opens the subagent thread. When both finish, the panel disappears; thread details still list them.
  2. While a turn runs, queue 3 messages (one long, one with a model/effort override, one with a file only). The tray shows "3 queued", open, with one-line rows. The long text truncates, and "(only files)" appears. Steer moves a row into the turn. Delete shows "Message deleted" with Undo, and Undo restores the row in place. "…" → "Runs with GPT-5.5, High effort" note, Move up/down/top/bottom and Turn on/off queueing (also check Settings → Threads → Messages). Edit opens the editor.
  3. Queued messages are not in the timeline; a message appears there with "Starting" once dispatched.
  4. Set a goal (Codex or Claude): the goal row shows the objective and "Active"; Pause turns into "Pausing…" then "Paused" with Resume. A tap opens the goal sheet with Clear/Replace. An achieved goal shows ×; × hides it.
  5. Start a background command (e.g. a dev server): the "1 running in background" chip appears left above the tray. A tap opens the sheet with Show full output and Stop task; stopping the last task closes the sheet and the chip pops out.
  6. A pending question and an approval: the tray's bottom row shows "Answer questions" / "Review request", "2 pending" and "Expires in m:ss" (amber in the last 25 s). A tap opens the sheet.
  7. No shift: at the end of the feed, panels appearing or expanding move the latest message up with them, never under the tray. Scrolled up into history, toggling panels or a subagent finishing moves nothing; the composer folds, the bodies fold and the headers stay. "Show latest" brings the reserve back.
  8. Keyboard open: the tray stays above the input; a tall tray scrolls inside itself, and taps don't close the keyboard. Mention suggestions still open above.
  9. Seams: the tray's sides meet the composer's top edge with no gap or notch at either width. The 32 dp fade sits above the topmost floating row. Nothing shows through between the tray and the input.
  10. Reduced motion: the tray, rows, chip and accordions switch without movement.

Mobile now shows the same stack above the composer as web. The tray
attaches to the composer's top edge and, in web order, holds the goal,
working subagents, the queue and pending requests.

- Subagents: only working or waiting subagents, with the shared
  "N subagents working · N needs you" summary, provider icons and rows
  that open the thread. Finished subagents stay in thread details.
- Queue: "N queued" panel, open by default. Rows have Steer, Delete
  (toast with Undo) and a sheet with "Runs with …", Edit, moves and
  Turn on/off queueing. Queued messages leave the timeline until the
  gateway starts them, as on web.
- Goal: objective and status (with Starting/Pausing/Resuming) and
  Pause or Resume inline; a tap opens the goal sheet. The composer's
  Goal pill is gone.
- Requests: the "Answer questions" / "Review request" row joins the
  tray nearest the input, with the expiry countdown.
- Background tasks: an "N running in background" chip opens the running
  tasks with output and Stop.
- Status notes (sending, delivery errors, computer offline) float with
  the tray outside the composer measurement. Their height joins the
  feed reserve only at the end of the feed, so reading history never
  moves.

Shared rules moved to @canopy/domain (goals look, queue order,
subagent summary, model names); web re-exports them unchanged.
JS/TS only: both EAS fingerprints are unchanged.
@nixuuu
nixuuu added this pull request to stack #468 November 10, 2026 06:34
@nixuuu
nixuuu marked this pull request as ready for review November 10, 2026 06:36
@nixuuu
nixuuu merged commit 42b144b into dev Nov 10, 2026
10 checks passed
@nixuuu
nixuuu deleted the feat/mobile-composer-parity-1 branch November 10, 2026 06:46
nixuuu added a commit that referenced this pull request Nov 10, 2026
Expanding mobile subagents or queued messages changed the feed's bottom
reserve, moving the conversation. Suggestion lists also occupied space
above the input, and New thread inserted them into the form. These lists
now open upwards in a bounded overlay; only collapsed tray headers
retain their layout slots.

Fixes: #466

- Add a portal in the existing native window, anchored and measured on
the UI thread. Opening a panel changes neither the timeline reserve nor
its mounted list. Subagent expansion is local state, without a
device-preference update across the timeline.
- Use the same opaque themed surface for subagents, queue, background
tasks, and suggestions in thread/side-thread, new-thread and bot
composers. Lists size to content, cap at the available space and 40% of
the visible viewport, and scroll internally with a reserved indicator
gutter.
- Consume outside taps; support Close, downward swipe, accessibility
escape and Android Back. Pickers retain their input and keyboard. Tray
panels isolate screen-reader navigation and restore focus to the
trigger. Motion grows from the bottom edge with shared tokens and is
skipped for reduced motion.
- Temporarily reduce the input to one row in short visible viewports,
independently of overlay state. Keep controls mounted. Side-thread
creation already uses a sheet without suggestions; the created
conversation uses the shared thread composer.

Validation:

- `bun install`, `bun run typecheck`, `bun run lint`, `bun run
format:check`, and `git diff --check`: pass. No UI tests added or run.
Full integration tests, generation checks and builds were outside this
task's permitted verification scope.
- `bunx [email protected] fingerprint:generate --platform <ios|android>
--build-profile production --json --non-interactive`: before/final
outputs are byte-for-byte identical. iOS:
`6ddec9ef559ee0095ac33e94ff9418a942053b17`; Android:
`5f6eae3ab278f1cd543e9ed763f923a319b65ec9`. No native dependencies or
configuration changed.
- Browser comparison used the production web `ComposerTop`,
`SubagentsPanel` and `MentionSuggestions` in a scratch fixture, in
light/dark at 320px and 1280px widths, with typical and long labels. The
desktop suggestion popover kept focus in the textarea. Expanding the web
tray preserved the measured timeline top (57px), height (800px), and
scrollTop (300px). Scratch screenshots are outside the repository.
- Native rendering, IME behavior, swipe gestures, accessibility focus,
landscape and performance are **unverified on a device**. Expo web is
unsupported by repository policy and was not added. Android's IME may
consume Back before the JavaScript handler; the keyboard-hide event then
also closes the overlay.

Copy audit (`docs/copy.md` §8): reuse “Subagents”, “Background tasks”,
“Suggestions” and “Queued messages” as compact panel headings; add
“Close subagents”, “Close background tasks”, “Close suggestions” and
“Close queued messages” as explicit screen-reader actions. Existing row
labels, errors and empty states remain. Sentence case and glossary
checked; no new terms or soul copy. Long titles truncate in code; the
browser label check covers the web reference, not native rendering.
nixuuu added a commit that referenced this pull request Nov 16, 2026
## Change

Remove the extra 8 dp of bottom padding from the mobile composer's
shared tray. The last visible panel header now meets the composer border
directly, including when only subagents or only the queue are visible.
Update the mobile behavior documentation.

Fixes: #466

## Verification

- Passed: lint and formatting for
`apps/mobile/src/features/threads/tray/ComposerTray.tsx`.
- Passed: mobile package typecheck and `git diff --check`.
- Native visual verification remains incomplete: the Android emulator
could not load the bundle because Metro hit the host's disk quota while
writing its cache.
- UI copy audit: not applicable; no user-facing text changed.
- The full repository verification gate is left to CI.
nixuuu added a commit that referenced this pull request Nov 21, 2026
Pressing × on an achieved goal used to hide the row for the current
visit only. Returning to the thread brought it back.

Web, desktop, and mobile now save the goal ID in device view
preferences. The dismissal survives navigation and a restart on that
device. A later goal in the same thread still appears. An achieved goal
waits for preferences to load before rendering.

Fixes: #466

## Verification

- Chromium at desktop and phone widths, with light and dark appearance.
Dismissed achieved goals stayed hidden on return and after reloading. A
new active goal appeared in the same thread after setting it through the
local gateway API.
- Typechecks passed for web, mobile, and domain. Lint and formatting
passed for the changed source. The existing goal tests passed, and a
local persistence check confirmed that saved dismissals survive loading
device preferences.
- Native mobile applies the same dismissal behavior. The Android device
reservation refused access because Canopy could not verify ownership of
the emulator runtime. The remaining native check consists of tapping ×,
reopening the thread, and restarting the app.
- Required repository checks are left to CI.
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