Skip to content

Drop the floating panel's view fade-out, and return a list as the user left it on Back - #7420

Merged
max-sixty merged 2 commits into
mainfrom
threads-grow-flake
Nov 27, 2026
Merged

max-sixty merged 2 commits into
mainfrom
threads-grow-flake

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The floating panel faded a view out for 60 ms before the next faded in. Kept as it last drew (#7367), the fading view stood past the edge of the shrinking box, over the page, and thread and On views already skipped the fade. Now a view goes in the paint that draws the next, which fades in as the box takes its size. That removes the leaving view's state and second node, its CSS rule, motion token and delay, and Go-to's wait for it.

Back from a thread now returns Threads, On Me or the menu as the user left it. The panel keeps the focused row, where it stood, and the scroll as a view opens over a list, the reading history already kept for an entry, and Back puts that row where it stood in the window, so a row a reply moved to the head of Threads stays in sight. Browser Back takes the same path with history's record, so it holds after a reload. g T from a thread far down Threads now reveals the row it focuses.

The maintainer asked for these follow-ups to land on my judgement. Tests: the new test_back_returns_a_list_as_the_user_left_it fails on main; the runtime tests, type check and 108 panel, On, history and Go-to tests pass, apart from the harness race #7404 fixes.

This was written by Claude Code on behalf of max-sixty

…r left it on Back

The panel faded a view out for 60 ms before the next faded in. #7367
fixed a flake in that fade by keeping the fading view as it last drew,
but drawn that way it stood past the edge of the box shrinking under
it: a still 20 ms into Threads → On Me shows Threads' rows over the
page's text. Thread and On views already skipped the fade, since the
thread reader empties them as the next view comes, and
test_a_resolve_s_notice_stands_for_that_resolve_alone accepted a move
of the Resolved heading inside the fading Threads as the one move a
refused Resolve makes without input.

A view now goes in the paint that draws the next, which still fades in
over 90 ms while the box takes its size. Removed: the `leaving` state,
the view's second keyed node, `data-lf-leaving` and its CSS rule,
`--lf-motion-view-out`, the rendering hold that kept the fade inside
the gesture, `playMotion`'s `delay` with Go-to's wait for a delayed
motion (`heldUnseen`), and `:not([data-lf-leaving])` from every view
selector in the tests and dev/leaf_dev. The resolve test no longer
expects a move, and the Go-to test reads its chips once on the
arriving view instead of slowing the page's animations.

Back drew the list afresh at its top, so in a list the user had
scrolled, the row Back focused often sat out of view; only the menu
revealed its row, since #7367. The panel now keeps where the user
stood in a list as a view opens over it (`placeOf`): the row focus is
on, or on a control of, where that row stood in the list, and how far
the list was scrolled. History's record of the entry (`listShown`)
reads the same place. Back (`returnTo`) stands the user on that row
and scrolls so it stands where it stood in the window, as far as the
list's ends allow, so a row a reply carried to the head of Threads
stays in sight. Where focus wasn't on a row, as after a press that
left it on the list, the list scrolls as far as they left it and they
stand on the row that leads to the view they leave, brought into view
where none of it shows; without either row the list holds focus
itself. Browser Back over a list takes the same path with history's
record, so it keeps the place after a reload, when the panel holds
none. An On line, which carries no key of its own, takes its item's.
A landing that focuses the row of the thread the user was in, as
`g T` from a thread does, now reveals that row rather than the list's
first thread.

What the user sees differently: the view being left no longer fades
out; the next one fades in as the box changes size. Back from a thread
returns Threads, On Me or the menu scrolled as the user left it, on
the row they opened. `g T` from a thread far down Threads shows that
thread's row.

Tests: test_back_returns_a_list_as_the_user_left_it is new and fails
on main (the list at 0 for 243 px); test_threads_fades_out_where_it_stood
goes with the fade. The menu's way-back test now scrolls to its row in
the short window, since Back returns the menu as the user left it
rather than revealing the row. `pnpm run test:runtime`, the runtime's
type check, pre-commit, and 108 panel, On, history and Go-to tests the
change reaches pass, apart from
test_an_open_view_covers_the_page_beneath_it, whose harness race #7404
fixes. Codex reviewed three rounds; its findings are fixed here, apart
from a mouse press on an On Agent item's Discuss in WebKit or Firefox,
which leaves focus on the list rather than the line, so Back stands on
the list, scrolled as left.
# Conflicts:
#	tests/render_harness.py
@max-sixty
max-sixty merged commit da94c59 into main Nov 27, 2026
5 of 6 checks passed
@max-sixty
max-sixty deleted the threads-grow-flake branch November 27, 2026 18:00
max-sixty pushed a commit that referenced this pull request Nov 28, 2026
…ith repeat instead of keyed (#7541)

#7420 drew the floating panel's stage with Lit's `keyed`, keyed by the
opening, so each opening gets a fresh view node. When the key changes,
`keyed` resets the part's committed value to a sentinel before the new
value commits (`lit-html` 3.3's `directives/keyed.js`, also on Lit's
`main`). So the old template instance never leaves the part's set of
disconnectable children, and the `ref(declareView)` on that view keeps
the whole closed view alive. Every view the panel drew stayed in memory.
Opening and closing the versions menu kept about 61 nodes and one
listener per round trip, which the closed-surfaces journey of
`test_page_fixture_renders` reported on 50 corpus pages.

The stage now draws a one-item `repeat` keyed by the opening, the
primitive it used before #7420. `repeat` disposes the old item's part.
Each opening still draws its view in a node of its own, so nothing the
user sees changes. A comment at the site says why `keyed` isn't used
there.

**Verification**
- `test_page_fixture_renders[alert-thresholds]` fails at the base with
`the versions menu leaks nodes: [5302, 5363, 5424, 5485]` and passes
here. `[feature-gallery]` passes too.
- `[alert-review]` loses the leak finding but still fails on a resize
finding that bisects to #7417. #7538 doesn't fix that one, so I filed it
as #7540.
- In an isolated probe on `alert-review`, six versions-menu round trips
held 6613 → 7240 nodes at the base, and stay at 6878 here after the
first trip.
- `pnpm run test:runtime` (1237 pass), pre-commit, and 25 focused panel,
Go-to and On tests pass.

<details><summary>How the retainer was found</summary>

I diffed two heap snapshots, taken around one round trip once the test
harness had drained its own input records. Every old
`.lf-fp-view[data-lf-route="versions"]` was retained by the panel's root
part: `_$committedValue` → stage `ChildPart._$disconnectableChildren` (a
`Set` that grows by one template instance per opening) → the instance's
`ElementPart` → the view `<div>`.

Other `keyed` sites in the tree (`records/thread/messages.js`, On's
regrouping in `floating-panel.js`, `lf-diff`, the Playwright timeline)
leak the same way only where a `ref` or another async directive sits
under the key, and only when their key changes, which is far rarer than
a panel view change. I left them alone.

</details>

Closes #7526 — automated triage

Co-authored-by: leaf-agent <[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.

2 participants