Repository navigation
Stabilize nightly browser tests and reply version holds - #161
Conversation
leaf-agent
left a comment
There was a problem hiding this comment.
Reviewed at 0b8925e. Thirteen of the sixteen failures on 834e68c are addressed and everything the diff touches passes on the merged tree — I ran it: anchors ×4, aim ×3, margin ×3, drafts, options, pages, controls ×3, and test_demo_recording_drives_the_browser_journey. Three findings, one of them the reason I'm commenting rather than approving.
The seven "release the inline reply" edits are one runtime decision, written down only in test helpers. I probed the state they walk out of: immediately after a comment posts, document.activeElement is an empty TEXTAREA carrying data-lf-offer, inside the inline thread the runtime opened by itself.
PROBE: {'active': 'TEXTAREA.lf-ui', 'offer': True, 'value': '',
'previewOpen': True, 'previewThread': True}
midComposition() in skills/leaf/assets/leaf.js returns true for exactly that shape — active.value !== "" || active.hasAttribute("data-lf-offer") — and state-application.js's willActivate gate reads !midComposition() || activationIsForced(). So on the live root, posting a comment now stops the page following new revisions until the reader closes the thread, with nothing typed and nothing on screen saying so. That is the failure composing/surface.js already records in its own words: "leaving an element anchor set, which midComposition() reads, so the page quietly stopped following new versions."
Six of the sixteen nightly failures were that one fact — anchors ×4 and aim ×2, the latter reading Actual value: v1 ▾ where the test expects v2 — and leave_new_thread plus the six open-coded copies of it are the same workaround seven times. That is a lot of weight for a rule whose only statement is a helper docstring saying a live page "may" follow its next revision. midComposition's own comment justifies the data-lf-offer case as "deleting everything is still an edit", which is not what an untouched auto-focused box is. Either the hold is intended, in which case it belongs beside midComposition and the four anchors tests' "The page follows it" comments want rewording; or the fix is that an opened-but-never-typed-in reply doesn't count as composition, and one runtime change replaces all seven. From here it reads like the second, but it turns on what the inline thread is supposed to mean, which is yours to say.
Two of the new waits poll for the assertion behind them. test_a_specimen_holds_a_wide_exhibit_inside_the_column waits for scrollWidth === clientWidth and then asserts document == column on those same two numbers, so the assertion the docstring exists for can't go red any more — a specimen that widens the document now produces a 30s wait_for_function timeout instead of "the exhibit widened the specimen instead of scrolling inside it". test_the_shipped_long_thread_opens_beside_its_source_in_the_right_margin is the same shape narrower: at height 480 the wait guarantees bottom <= 473 and the assertion behind it is bottom <= 472.5, so half a pixel of the claim survives. Both tests pass on this tree with the new wait deleted, and neither has failed in the last three nightly runs — so these are hardening, and worth waiting on a fact of the resize that the assertion doesn't restate.
Overlap with three open PRs. #157 rewrites the same two page-map keyline assertions, with a shared helper that also derives the address span (1 vs 1–n) instead of hardcoding, and keeps the row's page-map items word asserted; #155 fixes the same ring-walk focus race generally rather than special-casing scope == "the versions menu" and key == "v"; #156 changes the same inputs_sha256 line (inline note there). Whichever way you go, three of these want closing as duplicates.
Still red on this head: test_render_drafts::test_a_held_comment_send_leaves_a_later_reply_box_focused, test_render_drafts::test_a_comment_hidden_by_narrowing_lands_in_its_reply_box, and test_render_options_settled::test_settled_options_collapse_without_going_out_of_reach.
How I checked
- Probe: opened
SAID_PAGEon the live root, dragged the column heading, posted the comment, then readdocument.activeElement— the output quoted above. midComposition→skills/leaf/assets/leaf.js(const midComposition = () =>); the activation gate →skills/leaf/assets/runtime/state-application.js(const willActivate =); the prior bug →skills/leaf/assets/runtime/composing/surface.js, the comment abovefunction activateVisual.- Reverted each change on its own and re-ran the owning test:
test_workspaces_replace_each_other_instead_of_stacking(both widths),test_a_specimen_holds_a_wide_exhibit_inside_the_column,test_coarse_pointer_resize_reach_stays_reachable_without_trapping_scroll, and both ring sweeps for theme.css line 686 — all green without the change. inputs_sha256: recomputeddigest(capture_input_files())on the merged tree at botha48ed44and0b8925e;c51a8720…matches. On834e68cit is77e6dd79…against a checked-in0836f336…, which is the failure in the nightly log.- Re-ran the nine failures this PR doesn't name; six now pass, three listed above still fail.
- Failure lists from runs 33350774450, 33347270702, 33347154927.
|
I measured both sides rather than reading across from the review. On The three the review named have all turned: The 15 node ids, and how I ran themBoth runs were |
|
One failure from run 33350774450 ( It predates the inline-thread change. I reproduced it on Measurement and the shape of the readSame command in three checkouts,
One sample each, and it passes at The assertion is |
The complete nightly suite on `main` caught a stale public example-preview input digest after the preview-handoff and runtime changes were combined with #161. This branch now includes the later main updates from #163 as well, then regenerates through `scripts/example-previews.py`; all nine preview images remain byte-for-byte unchanged. Validation on that merged tree: all 20 tests in `tests/test_site.py` pass, followed by every pre-commit hook. > _This was written by Codex on behalf of max-sixty_
Nightly browser coverage had drifted from the current responsive layout, panel, native-popover, page-map, and inline-thread behavior. This updates those journeys to observe the runtime's settled state and folds in the general rendered-frame wait used by keyboard scope walks.
Review also exposed a runtime issue behind the failures. An accepted anchored comment now opens its inline thread only when that send still owns the typing landing, so a later reply gesture keeps its focus and draft. An untouched reply box that Leaf merely opened and focused no longer blocks a live version, while any actual reply draft—including one the reader cleared back to empty—still holds the version.
The demo and public example previews were regenerated with their owning scripts. The complete local gate passes: 1,574 tests under
uv run pytest --run-nightly tests, followed by every pre-commit hook.