Skip to content

fix: keep each floating-box part's carry until its own motion ends - #7385

Merged
max-sixty merged 1 commit into
mainfrom
fix/issue-7381
Nov 27, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/issue-7381

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

A floating box's tween restored every carried part's inline translate from the last animation's finish event (box-motion.js, last.onfinish). Parts begun in one reading can finish a frame apart. So a part whose own motion was still at progress 0.9999975 lost its translate: var(--lf-box-carry) consumer a frame before its motion ended. The shift watch reads a registered-property translation only while that consumer stands. A watch sample in that frame therefore saw the part at rest with its animation still running and credited none of the carry. On a starved frame, the floating panel's head line (Back, Resolve, Close) then read as moving its whole carry, 70 to 113 px, without input.

Each part now restores its own declaration when its own motion finishes. The last animation's finish still ends the stream ride (contentRides), on its old timing. Nothing changes on screen, because the leftover carry at the early restore was under a hundredth of a pixel. The module header already said a part's declaration is restored "when its part stops moving", and the code now does what it says.

Verification. tests/browser/test_render_floating_panel.py::test_resolve_opens_the_next_thread_as_tall_as_it_holds, run alone unthrottled (uv run pytest -n0), failed 7 of 19 runs on main and passes 48 of 48 with the change. Focused browser tests over the panel, the margin card's reply, send placement and composing (-k "carry or ride or tween or ring or rise or grow or resolve or send or fold or motion", 139 tests), pnpm run test:runtime, eslint and the browser type check pass, with one exception described below.

Diagnosis

I instrumented the watch and box-motion on a failing run. The head's carry began at 4375 ms. The watch sampled it at 4418 ms at its full start value, then again at 4686 ms with no translate value. The head's animation only finished at 4726 ms. In between, last.onfinish called restoreTranslations() while the head's animation stood at progress 0.9999975 (logged with a stack from last.onfinish). The watch's reading skips a bound translate whose consumer is no longer effect.target.style.translate (shift_watch.js, readMotion), so the 4686 ms sample credited nothing. The issue's ended: null was accurate at comparison time, because the ending came 40 ms later.

A first version that held every restore until all parts had settled (Promise.allSettled) also fixed the target. It made the stream ride end a frame later too, so this version leaves the ride's end where it was.

Not fixed here. test_a_resolve_s_notice_stands_for_that_resolve_alone fails at its consume_browser_errors (line 524) on main as well as on this branch. With --cpu-throttle 3 it failed 10 of 10 runs on each, with the same extra findings: the Threads rows' text moves −10 px beyond the expected settled-row move. Unthrottled it failed 0 of 58 runs on main and 4 of 98 on this branch's two versions. I take the unthrottled gap to be noise, given that the throttled failure is identical on both, but it's the one result here that leans the other way.

Closes #7381 — automated triage

A box-motion tween restored every carried part's inline `translate` from the
last animation's `finish` event. Parts begun in one reading can finish a frame
apart, so a part still at progress 0.99999 lost its `translate: var(--lf-box-carry)`
consumer a frame before its motion ended. The shift watch reads a registered-property
translation only while that consumer stands, so a sample in that frame saw the
part at rest with no animation credit, and on a slow frame the floating panel's
head line (Back, Resolve, Close) read as moving its whole carry without input.

Each part now restores its own declaration when its own motion finishes; the
last animation's finish still ends the stream ride. Nothing changes on screen:
the leftover carry was under a hundredth of a pixel.

test_resolve_opens_the_next_thread_as_tall_as_it_holds, run alone unthrottled,
failed 7 of 19 runs on main and passes 48 of 48 with the change.

Closes #7381
@max-sixty
max-sixty merged commit db508e5 into main Nov 27, 2026
7 checks passed
@max-sixty
max-sixty deleted the fix/issue-7381 branch November 27, 2026 11:58
max-sixty pushed a commit that referenced this pull request Nov 27, 2026
…tructurally (#7388)

`lf-tally` hands its region element to its Effect UI component as a
prop. When a revision replaces that region, Effect UI's `propsEqual`
sees the field differ by reference and falls back to `Equal.equals`,
which in Effect 4 compares two objects structurally, through every
property they reach. On a DOM node that walk covers the document; on
command-hub it reaches an SVG length whose `value` getter throws
`NotSupportedError: Could not resolve relative length`, so the page's
reading fails (`leaf: read failed` from `layer-client.js`). Both cases
of `test_command_hub_an_absorbed_input_stays_fulfilled` fail this way on
main since #7374, first in [ci run
45985477026](https://github.com/max-sixty/leaf/actions/runs/45985477026).

The adapter (`runtime/lib/effect-widget.js`) now marks each DOM node an
`inputs` function returns with `Equal.byReferenceUnsafe`, so a replaced
node counts as a changed prop and an unchanged one as equal, with no
walk. The fix sits in the adapter rather than in `lf-tally`, because any
widget whose `inputs` returns an element would hit the same walk.
`/vendor/effect-ui.js` now exports `Equal` for this (rebuilt with `pnpm
run build:browser`); `leaf-dev interface --base` reports no name added.

**Verification:** `test_command_hub_an_absorbed_input_stays_fulfilled`
(both cases) fails on `db508e5b8` with the SVGLength error and passes
with this change.
`test_a_tally_counts_its_regions_obligations_and_walks_them`, the
runtime tests `effect-widget` and `authored-capture`, `pnpm run
check:browser` and `pnpm run test:browser` pass.

The run's other failures are not touched here: the floating-panel
teardown shift is #7381, fixed by #7385, and the heading-link
copy-button shift has its own cause issue.

Refs #7387 — 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.

test_resolve_opens_the_next_thread_as_tall_as_it_holds: shift watch leaves the panel head's ended slide uncredited at teardown

2 participants