Skip to content

fix(threads): let composer pills hug their labels - #464

Merged
nixuuu merged 1 commit into
devfrom
fix/composer-pill-gap
Nov 9, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/composer-pill-gap

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 9, 2026

Copy link
Copy Markdown
Member

The composer model and effort pills now hug their labels with the normal 4 px gap. #450 introduced permanent 192/96 px web slots; a short model label left a large blank area before effort. #375 introduced the matching 160/96 dp model/effort slots on mobile.

  • Web keeps a maximum width for truncating long model names, removes permanent slot widths, and removes the effort wrapper entirely for models without effort. New-thread, existing-thread, and side-thread composers share these controls.
  • Mobile removes the 160/96/128 dp model/effort/permission widths. Only cold model/effort skeletons reserve compact 128/72 dp widths. The toolbar aligns right so loading changes grow away from Send. New-thread pills already sized to content; bot chat composers have no model/effort pills.
  • Existing synchronous catalog reads remain in place. Web waits for the initial catalog read before mounting the composer; mobile reads the pairing's external-store snapshot synchronously. No native, dependency, or runtime configuration changes.

Fixes: #450
Fixes: #375

Verification

Passed bun install, bun run gen:check, bun run typecheck, bun run lint, bun run format, bun run format:check, the web build, focused ESLint for both changed mobile files, and git diff --check. No UI tests added. Full local check:tmp was not run as requested; CI remains the gate.

Checked the actual SvelteKit app in Chromium with disposable HTTP/SSE response fixtures, without connecting to a live stack. New-thread and existing-thread composers were measured at 1440, 768, and 390 px in light/dark with o3, GPT-6.1-Sol, Claude Opus 5.5, a long model name, and Low/Default/High/Max effort. Every pair retained a 4 px gap with no page overflow. Desktop model widths were 73.5/130/159.5 px, capped at 192 px for the long name. Phone labels truncate within the available space. Inspected the model sheet, effort popover, and the no-effort case; no empty effort slot remains.

Cold browser loads used a 1,000 ms catalog delay. Frame sampling from the first composer frame showed one final catalog label and one fixed pair of pill coordinates throughout each captured load: phone dark (GPT-6.1-Sol), desktop dark (o3), and desktop light (Claude Opus 5.5). Warm navigation between new-thread and existing-thread routes also retained the cached label without an intermediate alias. These checks cover the shared desktop/web UI; Electron was not launched.

Both mobile fingerprints were generated before and after using bunx [email protected] fingerprint:generate --platform <ios|android> --build-profile production --json --non-interactive:

Platform Before and after
iOS 6ddec9ef559ee0095ac33e94ff9418a942053b17
Android 5f6eae3ab278f1cd543e9ed763f923a319b65ec9

Native visual verification remains incomplete. Launched this checkout through Metro in an installed iOS simulator client; it fails before rendering with “The package 'react-native-keyboard-controller' doesn't seem to be linked.” A compatible native development client is needed for mobile visual/cold-cache/scroll checks. No native build or publication was attempted. Android device visuals were not verified.

Copy audit (§8): no UI strings changed. Existing model/effort labels, accessible names, and truncation remain; the change only removes excess reserved space. No new terminology or actions.

@nixuuu
nixuuu merged commit 9355f12 into dev Nov 9, 2026
9 checks passed
@nixuuu
nixuuu deleted the fix/composer-pill-gap branch November 9, 2026 23:37
nixuuu added a commit that referenced this pull request Nov 10, 2026
…eue (#466)

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 (#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.
nixuuu added a commit that referenced this pull request Nov 10, 2026
The mobile composer placed Attach next to the model pills after #464
right-aligned the whole scroll container. The same container allowed iOS
horizontal bounce even when its contents fit.

Attach now has its own non-shrinking slot at the left edge, outside the
pill scroll area. Model and effort retain content-sized widths, their 4
dp gap, and right alignment next to the existing reserved Send slot.
Content/viewport changes restore the scroll area's trailing edge so
overflowing pills grow leftwards. Shell mode still replaces the controls
with its notice. New-thread and existing/side-thread composers share the
fix; bot chat retains Attach before its inline text field and has no
model pills. The mobile documentation describes the layout.

The scroll area disables both `alwaysBounceHorizontal` and `bounces`.
The existing single-line, 140 dp label cap truncates long names first;
genuinely overflowing pills remain scrollable on narrow screens or with
larger text. The trailing 4 dp gap is outside the scroll content,
preventing padding from creating artificial overflow. This avoids extra
measurement state and keeps Attach and Send independent of
catalog/skeleton widths. Extracted the props interface to keep the
shared composer below the function-size limit.

Fixes: #464

### Verification

- Passed `bun install`, `bun run format`, `bun run typecheck`, `bun run
lint`, `bun run format:check`, and `git diff --check`. No UI tests added
or run.
- Reviewed every `ComposerBox` call site: new thread, thread screen
(including side threads), and bot chat. The side-thread creation sheet
uses its own task field; opened side threads use the shared thread
screen. Reviewed cold skeletons, short/long model labels, missing
effort, shell notices, attachment rows, and the split Send reservation
by source/layout reasoning.
- Ran `bunx [email protected] fingerprint:generate --platform <ios|android>
--build-profile production --json --non-interactive` before and after.
Unchanged iOS: `6ddec9ef559ee0095ac33e94ff9418a942053b17`; Android:
`5f6eae3ab278f1cd543e9ed763f923a319b65ec9`. No native dependencies,
configuration, or assets changed.
- No native device was available. Native visuals, scroll gestures, and
large Dynamic Type at 320 dp were not runtime-verified. Expo web is
explicitly unsupported by this app; no web compatibility dependencies or
target were added. Source inspection of the web composer found a
separate attachment control and a flexible right-aligned model group,
without the mobile scroll container issue; no web files changed. Broader
integration tests, web build, prebuild, and bundle exports were not run
under the task's verification restrictions.

Copy audit (§8): no UI text or accessible labels changed; existing
truncation and labels remain. No new actions or terminology.
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