Skip to content

fix(threads): attach expanded activity to its row - #491

Merged
nixuuu merged 1 commit into
devfrom
fix/timeline-expanded-rows
Nov 10, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/timeline-expanded-rows

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 10, 2026

Copy link
Copy Markdown
Member

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 nixuuu closed this Nov 10, 2026
@nixuuu
nixuuu deleted the fix/timeline-expanded-rows branch November 10, 2026 12:38
@nixuuu
nixuuu restored the fix/timeline-expanded-rows branch November 10, 2026 12:39
@nixuuu nixuuu reopened this Nov 10, 2026
@nixuuu
nixuuu force-pushed the fix/timeline-expanded-rows branch from 369c197 to da47d52 Compare November 10, 2026 12:42
@nixuuu
nixuuu merged commit 7cd1491 into dev Nov 10, 2026
9 checks passed
@nixuuu
nixuuu deleted the fix/timeline-expanded-rows branch November 10, 2026 12:50
nixuuu added a commit that referenced this pull request Nov 14, 2026
## Problem

In Settings → Scheduled tasks, collapsing a task's details (the "N runs"
disclosure) cleared the content at once and left a blank band. The rows
below then snapped up instead of easing. The user's 120 fps recording
shows the clip shrinking far faster than the row box.

## Cause

`expandGrid` (motion.ts) tweened `grid-template-rows: t fr` on the
wrapper. In an auto-height grid, Chromium sizes the wrapper to t ×
content but the `t fr` track (the clipping child) to t² × content.
Measured in headless Chromium at t = 0.5: wrapper 84 px, clip 42 px.
Content vanished early, and the leftover band snapped shut when the
element unmounted. Expanding had the same mismatch in reverse.

## Fix

- `expandGrid(node)` tweens the wrapper's measured height
(`--duration-fast`, `--ease-smooth-out`, with a fade), and the `1fr`
track follows it exactly (verified: wrapper = clip at every step). The
height comes from the clipping child's `scrollHeight`, so a toggle
reversed mid-way keeps its scale. Reduced motion stays instant. The grid
mode of `Disclosure` (activity frames) gets the same fix.
- The schedule row body is now a flex column, and the details wrapper
cancels its 2 px gap (`-mt-0.5` / `pt-2.5`), so nothing moves at either
end of the motion. A grid row would clamp the negative margin. The final
layout is unchanged.
- Mobile: details used to mount at full height in one frame. A new
shared `ui/Accordion` (measured height + fade on `fast`, the same both
ways, instant with reduced motion) makes the cards below glide. JS only;
the runtime fingerprint is unchanged, so it ships OTA.

Fixes: #694
Related: #491

## Checks

- `bun install`, `bun run gen:check`, `bun run typecheck`, `bun run
lint`, `bun run format:check`: clean
- web build: passed; `expo export` iOS + Android: passed; fingerprint
sources contain none of the changed files
- Browser review on an isolated stack: built web, fixture schedules,
Chromium via Playwright, sampled every animation frame:
- Before: on collapse the clip fell far behind the wrapper, leaving a
blank band, then the rows snapped.
- After, collapse at 1440 px light: wrapper = clip on every frame (246 →
174 → 81 → 32 → 11 → 3 → 0 px), next row 525 → 279 px, no step at mount
or unmount. Expand mirrors it.
  - After, 390 px dark: the same (298 → 0 px).
  - With `prefers-reduced-motion: reduce` it is instant both ways.
- Pre-existing and unrelated: an intermittent `Cannot read properties of
undefined (reading 'component')` in SvelteKit's client router on the
first navigation. It reproduces on plain `dev` (4397875) in the same
stack.
- Mobile: typecheck and export pass; not checked on a device.

## Copy audit (§8)

No UI text changes.
nixuuu added a commit that referenced this pull request Nov 27, 2026
## 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](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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