Skip to content

feat(threads): collapse tool groups while working by default - #668

Merged
nixuuu merged 1 commit into
devfrom
feat/collapse-tool-groups
Nov 13, 2026
Merged

nixuuu merged 1 commit into
devfrom
feat/collapse-tool-groups

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Tool groups now start collapsed while the turn is working, independently of the outer “While working” setting. Commentary remains visible between compact group headers, which retain the current command or step, spinner and running count.

  • Add Tool calls: Collapsed / Expanded to Settings → Threads → Turn activity on web and mobile. The device-local default is Collapsed; Expanded restores automatic opening.
  • Always give a sole group its own stable header. A second group does not reparent existing tools or change the first group's choice.
  • Share group-choice memory across clients. Manual expansion/collapse survives later items, preference changes, completion and virtualization; individual tool details remain closed initially.
  • Retain the existing anchored disclosure motion and reduced-motion behavior. Document the rules in Polish in docs/timeline-folding.md, docs/ui-api.md and docs/mobile.md.

Verification

  • All commands used nice -n 10: install, gen:check, workspace typecheck, root/mobile lint, formatting and web production build passed. Focused fold/group logic: 20 passed.
  • All CI checks passed on this head, including all four full-suite test shards, static checks and the web/Linux builds.
  • Local check:tmp encountered three 5-second timeouts in unchanged bot download/harness tests; their targeted reruns with --timeout 30000 passed (17 passed, no temp leftovers). The full local run then encountered repeated failures in unchanged computer-moves.test.ts (including destination-unreachable errors) and was stopped with SIGINT. Its runner cleaned up successfully and reported nothing left in the temp dir. The local full run is therefore not a passing result; full-suite evidence comes from green CI.
  • Production-build browser review through the real gateway, scripted worker and live SSE: sole/multiple groups, independent outer/group defaults, manual opening, later groups, virtual unmount/remount, preference persistence/reset, desktop/phone, light/dark and reduced motion. Normal-motion header position stayed y=723 through expand/collapse; reduced motion stayed y=534. Reset preserved the control's position. Long commands truncate without horizontal overflow. Review stack, container, tunnel and browser were cleaned up.
  • iOS and Android bundle exports passed. Fingerprints match dev: iOS 74705db3a68907bc28379bb9b1080a227bc0755b, Android 7d38be8f5c9bf842d62060c75820a206f99c87e3.
  • Mobile device review pending: the device host is unavailable, as noted in the task. Bundle exports/typechecking do not replace native device review.

Copy audit — docs/copy.md §8

Before → after Reason
No independent group setting → Tool calls Existing product term; separates tool-group visibility from the outer work section.
No description → Expand tool groups during a turn. One action, six words, sentence case and active voice; describes the setting's scope.
No choices → Collapsed / Expanded Reuses existing state labels; Collapsed is the reset/default state.
No reset label → Reset Tool calls to default Reuses the shared reset-control pattern and names its action.
Counts/status only → counts/status plus the existing current-step hint when collapsed Reuses shared hint copy; the full text remains available to assistive technology and in the web tooltip.

No new errors, empty states, glossary terms or humorous copy. Settings and live headers were reviewed at desktop and phone widths with short commentary, typical labels and long commands. The reset has reserved space; labels, expanded state and progress have text/accessibility cues independent of color or icons. The mobile setting uses the existing custom Segmented control; the web uses the custom Select.

This is a behavior change, not a regression fix.

@nixuuu
nixuuu marked this pull request as ready for review November 13, 2026 18:43
@nixuuu
nixuuu merged commit 4bb71c8 into dev Nov 13, 2026
12 checks passed
@nixuuu
nixuuu deleted the feat/collapse-tool-groups branch November 13, 2026 18:46
nixuuu added a commit that referenced this pull request Nov 13, 2026
Older turn summaries can arrive while their messages are outside the
independent 128-item watch window. Web treated those turns as completed
empty folds and only paged near the list's beginning, leaving work and
answers blank across reloads.

This change shows compact loading rows for missing or partial work,
prefetches one bounded history page from virtual overscan, and preserves
message anchors when earlier steers renumber segments. Fold coverage
mismatches expose the source rows and emit diagnostics. Initial
positioning has a two-second reveal fallback; diagnostics include
earlier-page request-to-render timings. New running turns without their
first item do not trigger a scan of older history.

History metrics use fixed IDs 450–455, separate from the thread-watch
metrics introduced by #673. Gateway responses classify client metrics by
their registry group, keeping recovery timings in the Client section and
preserving the existing watch-recovery behavior.

Fixes: #541

Verified with git bisect: `0c655ca3ba72f2aea48487d7de62642a15a096f2`
introduced the independent windows; its parent `e483f4274` passes the
same three-turn/600-item reproduction. #639 and #668 steer/group parity
tests pass. Shared mobile fold derivation is unchanged.

Validation:

- Nine focused history/fold regressions pass, including partial cached
tails, steers, collapsed groups, nested tools, a running subagent and
stable message identities. Real gateway/cache/checkpoint recovery
integration passes.
- Production browser checks cover desktop and 390px phone widths,
light/dark and reduced motion. Prefetch starts up to 572px before
missing work reaches the viewport; loading rows measure 44px;
reading-anchor drift stays under 0.5px.
- Held responses, actual thread switching, cached reload with a
simulated desktop persistence bridge, cleared local storage, failed
requests/Retry and blocked row measurement all recover visibly. A fresh
running turn sends zero history requests; scrolling to older gaps sends
one. Recovery and request-to-render diagnostics were captured.
- Initial handover gates passed: install, `gen:check`, typecheck, lint,
`format:check`, `check:tmp` and the web build. That full local run had
2,793 passed, 166 skipped and zero failures across 523 files;
temporary-directory cleanup was clean.
- Rebased onto current `dev` (`89f37fea6`), including #670 and #673.
Post-rebase checks pass: 34 focused feed/fold tests, 10 diagnostics
integration tests, six provider-account integration tests and the
bounded-window/cache integration test (51 total), full typecheck, lint,
format check and production web build. The provider refresh invalidation
regression and forced-refresh race both pass. Diagnostics tests verify
distinct watch/history metrics through authenticated ingestion,
client-section rendering data and redacted export. Runs were detached
with `nice`, with heavy test files run one at a time; each focused
`check:tmp` run cleaned its temporary directory.

Native Mac/Electron and native phone rendering were unavailable. The
desktop renderer and cache contract were checked in Chromium; shared
mobile/web steer and group logic tests pass.

Copy audit (docs/copy.md §8): “Loading earlier work…” is a concise
progress status; existing error and Retry copy is reused. Light/dark
desktop and phone widths checked; no new motion or copy in tool/steer
rows.
nixuuu added a commit that referenced this pull request Nov 20, 2026
## Change

- Remove native tooltips that duplicate collapsed work, tool-group,
command, and mini-transcript previews. Keep a tooltip when a short,
single-line path or URL adds context to a tool label.
- Use the first line and at most 120 characters of content for command
and tool-argument previews and live activity hints on web, desktop, and
mobile. Expanded details expose the full command, script, and result.
- Document the preview behavior in `docs/timeline-folding.md`.

## Verification

- Chromium at 390 px and 1440 px, light and dark. Checked the collapsed
DOM with a multiline script, running status, the short path tooltip,
opening the group by keyboard and touch, and reading the full command
and script after expansion.
- Native Android emulator. Tapped the group and expanded a multiline
command and a long single-line shell call. Both showed compact previews
when closed and the full command after expansion.
- Web and mobile typechecks, targeted Oxlint and Expo lint, edited-file
formatting, and `git diff --check` passed. Spot checks covered long
lines, CRLF, Unicode, and tooltip eligibility. GitHub CI runs the full
gate.

## Copy audit

The previous tooltips repeated the command or group summary in full. The
updated headers keep the existing action and status wording, mark
shortened previews with an ellipsis, and expose full text in the
disclosure. Checked short and typical labels and long inputs at desktop
and phone widths. Counts, running status, and expanded-state semantics
remain available to assistive technology.

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