Skip to content

fix: keep progress disclosures still during card motion - #4330

Merged
leaf-agent merged 5 commits into
mainfrom
fix/issue-4235
Oct 27, 2026
Merged

leaf-agent merged 5 commits into
mainfrom
fix/issue-4235

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Opening or closing progress messages in a margin card now keeps the disclosure stationary throughout the resize animation. Growing parts cancel inherited translation through the existing carry helper, preserving the transcript's send stream without traversing its contents. This repairs the motion regression after #4174.

The expanded regression also exposed stale message ages in an open card. Mechanical annotation refreshes now run through the existing presenter, and opening a card requests that refresh, so newly visible messages contribute their clock dependencies. Ages continue updating while the user drafts a reply; disclosure motion and held news retain their existing behavior.

Validation: the pointer regression reproduced the stale-age failure before this repair and passed afterward. The pointer and keyboard disclosure cases and the card-news case passed together. pnpm run check passed, including all 682 runtime tests, and the browser kernel was rebuilt. A served startup comparison with the preceding PR head used 35 requests in both arms and added 203 JavaScript bytes before first server-state presentation.

Closes #4235 — automated triage

A growing scroller used its final content placement while inheriting a moving parent translation. Cancel that inherited carry and keep its stationary motion reading when annotating a frame. Preserve the existing opaque transcript and send stream.

Hold the existing pointer and keyboard disclosure test at the start, midpoint and end of opening and closing; the original runtime fails at the first frame. Eight focused card and panel motion checks pass, along with 668 runtime tests and pnpm run check.

Closes #4235
@leaf-agent

leaf-agent commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator Author

Holding merge until the dispatched macOS check finishes: CI run 40456703733 verifies the integrated head 96c220dc44008621a8f3cfbc0bbdca85d03eb478. PR CI passed at that head, but its macOS job is skipped, so its green rollup does not establish this platform check. This triage session owns that follow-up.

# Conflicts:
#	dist/kernel/kernel.json
@leaf-agent

leaf-agent commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator Author

Merged current main and rebuilt the kernel at d830708; the conflict was confined to generated kernel metadata. The head test-merges clean, and all 673 runtime tests passed.

CI run 40471253059 failed in test_a_press_in_the_card_keeps_the_pressed_spot_still[press] at line 216: after advancing the fixed clock to 60 seconds, the message age stayed “just now” instead of “1m ago”. The focused local run reproduced that failure after its opening/closing motion assertions passed; its keyboard case passed. Refusing state responses during the age check, as other clock-paint tests do, still reproduced the same failure; that experiment was discarded. I have not established its cause or whether it is inherited.

Queued repair run 40472887513 owns further diagnosis. The macOS verification hold still applies.

# Conflicts:
#	dist/kernel/kernel.json
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Resolved the generated-kernel conflict by merging current main and rebuilding at 84d1f62361bacd3adb7e2ff2394889cffea92aea. That head test-merges cleanly with the fetched base, and all 682 runtime tests passed locally.

CI run 40497993374 failed in test_a_press_in_the_card_keeps_the_pressed_spot_still[press] at test_card_placement.py:216: the message age remained “just now” when “1m ago” was expected. This matches the assertion reported earlier; its cause and whether it is inherited remain unverified. Landing remains blocked on that failure and the separate macOS verification.

Mechanical annotation refreshes now use their existing presenter so a newly opened card contributes its clock dependencies. Request that refresh after the card opens. This keeps message ages live while composing without changing disclosure motion or held news. The existing pointer regression failed at its age assertion before this repair and passes after it.
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Pushed 0a553cf011f2729cd09b86be64d102ee52cd8992 to fix the stale-age failure by routing mechanical annotation refreshes through their existing presenter and requesting a refresh when a card opens. The newly visible messages now contribute their clock dependencies. The pointer regression failed at the reported age assertion before the repair and passes afterward; both disclosure input cases and the card-news case passed together. pnpm run check also passed, including 682 runtime tests.

The earlier dispatched macOS run finished: both disclosure regression cases passed on its head, while other tests failed. The new head still needs its own CI and review. With await_ci: false, the review queued by this push and tend-land own that follow-up; this repair run will not poll or merge it.

@leaf-agent
leaf-agent merged commit 7edb75c into main Oct 27, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-4235 branch October 27, 2026 12:21
leaf-agent added a commit that referenced this pull request Oct 27, 2026
#4330 changed mechanical annotation refreshes from synchronous drawing
to queued presentation. A contribution's immediate control lookup
therefore returns null; the first-placement test throws inside its frame
callback without rejecting the promise Playwright is awaiting, hanging
the worker for 30 minutes.

Partially revert that annotation scheduling change, restoring
synchronous contribution lookup, retained-control updates and focus
preparation. Keep #4330's disclosure-motion correction. The test now
awaits the frame before creating and measuring the row, so an exception
rejects the evaluation instead of stranding it.

This withdraws #4330's separate age-refresh repair: a newly opened
card's message age can stay “just now” while a reply is drafted. The
existing pointer disclosure test still fails at its “1m ago” assertion;
its preceding motion assertions and the keyboard case pass. #4443
remains open for the presentation/clock-dependency decision and
restoring that behavior without breaking control lookup. No age
assertion is removed or weakened.

Validation: the revised first-placement test fails promptly against the
broken runtime and passes with this repair. Both retained-control cases,
Page Map reconciliation, More-click focus and spilled-thread opening
pass (six focused browser tests); all 682 runtime tests pass and the
browser kernel rebuild passes. Local Ruff is unavailable; CI owns lint.
The existing plan-card-reply and plan-card-aging stills are unchanged;
the latter does not reproduce the failing disclosure journey, so it does
not establish that age repaint is preserved. Served review-a-plan
startup retains 35 requests (31 code requests) through widget upgrade
and first server-state presentation, with 203 fewer JavaScript bytes and
no console errors or layout shifts.

Refs #4443. Closes #4449 — automated triage

Co-authored-by: leaf-agent <[email protected]>
leaf-agent added a commit that referenced this pull request Nov 5, 2026
An open margin card's message ages stayed "just now" as time passed.
This restores the ages without giving up synchronous annotation drawing,
as decided on #4403: a direct annotation redraw now follows what it
reads and repaints through the presenter when one of those values
changes, the clock included.

**Cause.** #4451 restored synchronous annotation drawing so a
contribution's control and the focus prepared on it stand when the call
returns. That withdrew #4330's age repair. A direct redraw, and the card
that opening it draws, read their ages outside the annotation
presenter's tracking, so the clock tick never repainted them.

**Change.**
- `application.js`: `renderAnnotations` runs its paint inside an effect.
The first run paints synchronously. Any later change to a value it read
calls the presenter's `present()`. The presenter's next paint drops that
effect, because it reads everything again under its own tracking. A
direct redraw nested inside a paint is kept and released with it.
- `margin-projection.js`: opening a card redraws the margin directly, as
#4330 did, so the card's ages are among the values that redraw follows.
Cost: a card open now does one full annotation paint inside the click's
task. Before #4451, the same paint ran through the presenter.
- `tests/shift_watch.js`: a text reflow region (`data-lf-reflow="text"`)
is now bounded by what the text paints, not by its unclipped range. When
the age widened, the card's ellipsized receipt moved inside its head, as
the inline thread's does. Its clipped glyphs past the head's edge were
being reported as leaving the region. The inline case passed only
because its head is wide enough.

**Verification.** Three cases failed at "1m ago" before this change and
pass after it:
-
`tests/browser/test_render_shift_watch.py::test_message_age_may_shift_metadata_but_leaves_the_thread_in_place[card]`
and `[inline]`
-
`tests/journeys/margin/test_card_placement.py::test_a_press_in_the_card_keeps_the_pressed_spot_still[press]`
(the second caller named on #4403)

The tests from #4443, #4444, #4445, #4446 and #4449 still pass:
retained-control order, Page Map reconciliation, More-click and Tab
focus, spilled-thread opening, contribution lookup. So do the shift
watch's reflow and append controls, `pnpm run check:framework`, and
`pnpm run test:runtime` (812 pass).

<details><summary>Inherited failures in tests/browser/margin</summary>

Running the whole directory, four tests fail with identical messages on
both `main` and this branch:
-
`test_page_map.py::test_the_current_obligation_marks_its_selected_margin_reading`
(colour)
-
`test_status.py::test_an_acknowledgment_uses_status_until_an_active_claim_restores_a_disclosure`
(`Unknown contribution entry option: className`)
-
`test_entries.py::test_an_inline_contribution_name_needs_no_physical_margin[page]`
and `[overlay]`

This change does not cause them.

</details>

Closes #4403

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.

Pressing a margin card moves its pressed spot on macOS

1 participant