Skip to content

feat(threads): separate tool activity and thoughts from agent text - #473

Merged
nixuuu merged 2 commits into
devfrom
feat/timeline-activity-contrast
Nov 10, 2026
Merged

nixuuu merged 2 commits into
devfrom
feat/timeline-activity-contrast

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Agent commentary, tool summaries and thoughts currently blend into one column. This change gives web/desktop and mobile the same hierarchy: ordinary message typography for agent prose, quiet neutral activity rows with kind icons, and bulb-marked thoughts with italic one-line previews. Final answers retain their separate slot below the work fold.

Design rationale

  • A — icons alone: lightest treatment, but too similar to prose while scanning a long turn.
  • B — tinted pills: more separation, but variable label lengths create uneven edges and extra visual noise.
  • C — quiet activity rail (selected): stable full-width rows use the existing neutral palette and work density in every state. A compact status count carries the existing status colour; failures never tint the whole row. Expanded details retain their compact layout.

Group label, icon, priority status and its exact item count share one traversal. The badge counts only items with the highest-priority status (failed, declined, interrupted, running); other statuses remain visible in the expanded rows. Web uses 1 failed on desktop and icon + count on phones. Native mobile uses icon + count with an explicit full accessibility label. The phone slot is 40px instead of 96px on web / 104px on native, leaving more room for summaries. The desktop badge now shares the summary's line box.

Row keys, shallow row reuse, fold state, anchoring and motion tokens are preserved. No new delta subscription or fold-wide rendering path is introduced. Header insets and group status slots remain stable as work completes.

Validation

  • Passed: frozen dependency install, bun run gen:check, bun run typecheck, bun run lint, bun run format:check, web production build and git diff --check.
  • Real browser on an isolated port: mixed long turn, many commands, edit/read, thoughts, failure/interruption, subagent/bus cards, background-task note, quotes and streaming; light/dark at desktop and 390px phone width. No horizontal overflow. All 18 preexisting row DOM elements stayed connected through streaming and completion. This is a row-reuse check, not a performance benchmark.
  • Default Birch theme contrast (light/dark): tool summary 6.52/7.67, thought 6.97/7.07, agent prose 12.93/11.00, failed status 6.45/7.64. Work text is 13px desktop / 15px phone. Existing reduced-motion handling is unchanged; reduced-motion emulation was not separately exercised.
  • EAS CLI 27.4.1 production fingerprints unchanged before/after: iOS 6ddec9ef559ee0095ac33e94ff9418a942053b17; Android 5f6eae3ab278f1cd543e9ed763f923a319b65ec9. Mobile changes are JS/TS only. Native simulator visual verification was not performed; phone browser screenshots cover the web layout.
  • No UI tests added. Full check:tmp is left to CI as requested. Browser checks use synthetic data with the real timeline components and state-update path, without a live gateway. The build reports the existing large-chunk advisory.

Review follow-up: checked the revised rows in light/dark at 1280px, 390px and 320px. At desktop, summary and badge centres both measure 416px (20px line boxes). At 320px they also share a centre; summaries truncate cleanly. The timeline rows do not overflow; the synthetic dev toolbar's benchmark controls extend 12px beyond the 320px document, outside the timeline. Repeated open/close checks on desktop and phone settled at exactly 90°/0°, with zero remaining chevron animations. A stuck intermediate rotation was not reproduced; replacement captures use the settled state. Manually checked shared summary data for one/two failures, five interruptions and all-completed groups. Native simulator verification remains unperformed.

Copy audit — docs/copy.md §8

Before → after: group-wide Failed / Declined / Interrupted → exact count such as 1 failed, 1 declined, 1 interrupted. These lower-case count phrases use existing glossary terms and describe only the affected items. On phones the word is visually hidden, retained for screen readers and in the full status tooltip; native group accessibility labels include the count and state explicitly. Thinking / Thought, activity summaries and individual-item labels are unchanged. No new actions, error instructions, empty states or decorative copy. Short, typical and long previews/summaries were checked at desktop, 390px and 320px; long previews truncate.

Local review artifacts (not committed)

All files are in /var/tmp/canopy-timeline-contrast/ on the implementation machine:

  • Review index: /var/tmp/canopy-timeline-contrast/review.html.
  • Before: before-desktop-light.png, before-desktop-dark.png, before-phone-light.png, before-phone-dark.png.
  • Revised after: after-desktop-light.png, after-desktop-dark.png, after-phone-light.png, after-phone-dark.png, after-phone-320-light.png, after-phone-320-dark.png. Expanded-detail images from the initial implementation are retained as after-expanded-desktop-light.png, after-expanded-phone-light.png, after-expanded-phone-dark.png.
  • Variants: variant-a-icons-light.png, variant-a-icons-dark.png, variant-b-pills-light.png, variant-b-pills-dark.png, variant-c-rail-light.png, variant-c-rail-dark.png.
  • Additional states: streaming-desktop-dark.png, streaming-completed-desktop-dark.png, subagent-bus-background-light.png, subagent-bus-background-dark.png, quotes-desktop-dark.png. Fingerprint JSON and check logs are alongside the images.

@nixuuu
nixuuu merged commit d5fecb5 into dev Nov 10, 2026
16 of 18 checks passed
@nixuuu
nixuuu deleted the feat/timeline-activity-contrast branch November 10, 2026 09:06
nixuuu added a commit that referenced this pull request Nov 10, 2026
…#482)

Cleanup previews could reuse Git output cached for one second by the
process governor, showing a dirty checkout immediately after external
changes were removed, or a clean checkout immediately after files were
added. `ScanWorktrees` now uses the existing `freshGit` boundary while
preserving process admission, background priority and removal safety
checks. The automation test warms the scan, changes files outside
Canopy, and asserts immediate dirty → clean → dirty → clean results
before cleanup. The worktree documentation describes this freshness
guarantee.

The worktree fixture also waited only for `thread.status === idle`.
`threadReady` can set that before the automation turn or its command has
settled. It now waits for the worktree's actual busy state before
deleting or archiving; preview assertions immediately after
delete/settings changes remain direct assertions, without retries. A
controlled delayed-ack run reproduced the original refusal with clean
Git state, a cancelled turn and a pending `startTurn`. The original CI
log reports only `wouldRemove`, so it cannot distinguish that refusal
from stale scan state.

The desktop/phone CI failure in run 42786085102, attempt 1, rejected a
valid transient `syncing` update after both clients' items and turns
already matched. The test now waits for completion of the specific reply
turn and convergence after recovery, with 100 ms revision probes
exercising resubscriptions. Local baseline runs exposed another fixture
race: after the parent interruption, its queued question turn could
start while `holdTurns` was still enabled and block the final reply
forever. Releasing the hold before ending the parent, then observing the
question turn complete, removes that race. A controlled run reproduced
the stuck interaction turn and queued final message. No production
subscription behavior changes.

Validation:

| Separate sequential file runs | Before | After |
| --- | --- | --- |
| `worktree-automation.test.ts` | 28 passed / 2 failed | 30 passed / 0
failed |
| `thread-multiclient.test.ts` | 29 passed / 1 failed | 30 passed / 0
failed |

Each file ran 30 times before and after, one file at a time. All 30
final phone runs exercised revision resubscription. The local baseline
phone failure was the held-question timeout, distinct from CI's invalid
no-syncing assertion. An intermediate readiness-only revision failed 8/8
worktree runs and exposed the cached Git result; those failures are
excluded from the final counts.

`bun install`, `bun run typecheck`, `bun run lint`, `bun run
format:check`, and `git diff --check` passed. Verification was scoped to
the requested integration files and static checks under the supplied
execution limits; the full suite, generation check and web build were
not run. Scratch logs and fault-injection diagnostics remain outside the
repository and are not committed. No schema, proto, UI copy or UI test
changes; copy audit is not applicable.

Fixes: #124
Related: #473, #478
nixuuu added a commit that referenced this pull request Nov 10, 2026
nixuuu added a commit that referenced this pull request Nov 10, 2026
Expanded tool details previously appeared as disconnected boxes below
their tinted trigger. Put the rail and neutral surface around the
trigger and body, with a consistent inner inset. Tool groups continue
that surface across independently virtualized rows; their children use
indentation rather than additional activity boxes. Thoughts use a
quieter attached surface, and failed activity keeps its neutral
background.

Individual web disclosures animate a grid track from `0fr` to `1fr`
using the existing motion tokens, with matching corner transitions and
immediate reduced-motion behavior. Group row entrances retain their
final measured heights to preserve virtual-feed anchoring. Closed
details still unmount; existing keys, remembered expansion and row
memoization are preserved. Expanded commands expose the full command,
including long single-line commands, in a contained scroll area.

Mobile mirrors the structure using JavaScript-only changes and retains
its anchored toggles.

Fixes: #473

Validation:
- `bun install --frozen-lockfile`, `bun run gen:check`, `bun run
typecheck`, `bun run lint`, `bun run format:check`, and the web build.
- Existing pure domain unit tests: `bun test
apps/web/test/work-fold-state.test.ts`. No UI tests added or run; the
full integration/temp-cleanup suite remains a CI gate.
- Real browser, isolated fixture server: light/dark; desktop (1280 px),
narrow (768 px), phone (390 px), and 320 px. Covered long
commands/output, a five-command group plus an edit with nested
expansion, failure, thoughts, and streaming output. Header/body seams
measured 0 px, horizontal overflow remained inside code blocks, and the
streaming header moved 0 px while unaffected row elements stayed
mounted. Before/after screenshots saved outside the repository;
temporary fixture and shell changes removed.
- Production fingerprints generated before/after with `[email protected]
fingerprint:generate --platform <ios|android> --build-profile production
--json --non-interactive`: iOS
`6ddec9ef559ee0095ac33e94ff9418a942053b17`, Android
`5f6eae3ab278f1cd543e9ed763f923a319b65ec9`, both unchanged. Native
device visuals were not checked.

Copy audit: no copy changes.
nixuuu added a commit that referenced this pull request Nov 28, 2026
The native thread timeline placed tool group labels slightly above the
center of their card. The group header now centers its label, chevron,
tool icon and status together. It uses the secondary work text size of
13 dp and a 40 dp visible row inside a 44 dp touch target.

## Verification

- Compared the previous and updated components on an Android emulator.
Checked light and dark themes, a running group with a hint and count,
and a long mixed group with a failure count.
- Expanded the group by tapping just outside its visible background.
Collapsing it hid the child rows again.
- Mobile TypeScript and lint on the edited files passed locally.
Repository-wide checks run in CI.

Fixes: #473
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