Skip to content

fix(threads): keep tool group rows attached while they collapse - #1327

Merged
nixuuu merged 2 commits into
devfrom
fix/tool-group-collapse-jump
Nov 27, 2026
Merged

nixuuu merged 2 commits into
devfrom
fix/tool-group-collapse-jump

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 27, 2026

Copy link
Copy Markdown
Member

Problem

Collapsing an expanded tool group ("Ran 1 command") glitched: in the first frame the rows under the header jumped down by the fold gap (12 px at the end of a fold, 4 px inside it), detached from the header as a separate block, and only then shrank. The content below jumped down too before collapsing.

Cause: an open group's header had no bottom gap (its rows hang right under it), a closed one gets the fold's gap. That gap appeared at once while the rows were still animating out.

Fix

  • feed.ts: an open group's header is marked like a closed one, so it keeps one gap in both states; the group's first row is marked lead.
  • FeedRowView.svelte: the lead row is drawn up into the header's gap (-mt-3 / -mt-1, -mt-3 in fork history). The open group looks the same as before; toggling no longer changes the header's height.
  • motion.ts / VirtualRow.svelte: exiting feed rows clip only their bottom edge (expand option overhang), so the drawn-up part stays visible until the row is gone.
  • docs/timeline-folding.md updated.

Verification (local)

Per-frame measurement on /dev/long-thread in Chrome (with a temporary local harness, not committed):

Row top vs header Content below
Before jumps 0 → 12 px 116 → 128 → 12
After 0 px every frame 116 → 12, monotonic

Also checked: a group inside a fold (4 px gap), a single-row group, opening (header does not move), and slowed-down frames (rows fold up under the header). apps/web typecheck, lint of the edited files and the feed tests (work-tool-groups, feed-prefix, work-fold-state, steer-folds, notice-folds, work-history-gaps) pass locally; the rest is left to CI.

Not changed: mobile, which has its own disclosure.

Copy audit (docs/copy.md §8): no UI text changed.

Related: #491

🤖 Generated with Claude Code

An open tool group's header had no bottom gap, while a closed one gets
the fold's gap. Closing a group added that gap in the first frame, so
the collapsing rows jumped down, detached from the header and only then
shrank.

The header now keeps the same gap in both states and the group's first
row is drawn up into it. Exiting feed rows clip only their bottom edge,
so the drawn-up part stays visible until the row is gone.

Related: #491

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nixuuu
nixuuu enabled auto-merge (squash) November 27, 2026 08:55
@nixuuu
nixuuu merged commit c72bc20 into dev Nov 27, 2026
24 checks passed
@nixuuu
nixuuu deleted the fix/tool-group-collapse-jump branch November 27, 2026 09:07
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