Skip to content

fix: stop a thread card's follow when the card redraws or closes - #5932

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-5925
Nov 13, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-5925

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Since #5893, every thread card a gesture opens wraps its draw in follow (browser/runtime/application.js) so the card's message ages keep advancing with the clock. But only the presenter's next paint (forget()) stopped a follow, and each follow chained a closure onto the previous one. So opening and closing cards with no margin repaint in between piled up live effects, each holding that card's host, thread and outlets. The render gate's closed-surfaces check reported this as the thread card leaking nodes and listeners on every round trip, on seven corpus pages.

The card's follow now lasts as long as the card:

  • follow returns {drawn, stop}, and the follows sit in a set that a stopped follow leaves. Previously they sat in a chain that kept every stopped closure until forget().
  • The card keeps its draw's stop on its session as stopDraw (annotation-overlay/thread-preview.js). It calls it before drawing again and when the session retires, so a card holds at most one follow. The presenter's paint still stops every follow, as before.

This keeps what #5893 meant the follow to do: the card's ages still advance with the clock, and the margin is still painted once per card open.

Checked locally on Linux:

  • test_page_fixture_renders fails on log-retention before the change, with the same counts as CI ([2486, 3592, 4385, 5178] nodes). After the change it passes on all seven pages the issue lists: log-retention, review-a-plan, ship-review, feature-gallery, thread-panel-gallery, sidebar-contents and thread-choice-hints.
  • test_message_age_may_shift_metadata_but_leaves_the_thread_in_place passes for both surfaces. Its card case is the test that showed Stop measurement ranges slowing every DOM write on a long page, paint the margin once per card open, and skip clip walks for boxes off screen #5893 needs the card's draw followed.
  • pnpm run test:runtime passes 965 of 965, and pnpm run check:browser and pre-commit pass. A stub in tests/runtime/thread-card.test.mjs now returns the new {drawn, stop} shape.

On macOS, thread-panel-gallery timed out (work the page deferred past presentation never landed) instead of reporting the leak. No runner here has macOS, so the next scheduled test-macos run after merge will show whether that timeout had the same cause.

Closes #5925 — automated triage

#5893 wrapped a gesture-opened card's draw in `follow` so its message
ages keep advancing with the clock, but only the presenter's next paint
stopped a follow, and every follow chained a closure onto the last one.
Opening and closing cards without a margin repaint therefore piled up
live effects and the closures holding each card's host, thread and
outlets, which the render gate's closed-surfaces check read as the
thread card leaking nodes and listeners on each round trip.

`follow` now returns its stop alongside the draw, and the follows sit
in a set a stopped follow leaves. The card keeps its draw's stop on its
session and calls it when it draws again or retires, so it holds at
most one follow, and the presenter's paint still stops them all.

Closes #5925
@leaf-agent
leaf-agent merged commit 2156f91 into main Nov 13, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-5925 branch November 13, 2026 09:01
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.

test_page_fixture_renders: the thread card leaks nodes and listeners on each round trip since #5893's card follow

1 participant