Skip to content

Resume writing leaves the combined-selection passage above the window #5182

Closed

Description

@leaf-agent

Resume writing fails its original-passage visibility check with y=-3.046875 and height=27.1875. This is a geometry failure before the returning-frame compositor check and differs from #4469’s missing raster evidence; do not conflate them without reproduction.

Evidence: push run 41576718956.

  • tests/browser/test_render_send_placement.py::test_a_wheel_return_attaches_the_comment_box_in_the_first_visible_frame[combined-selection]

Failed: Resume writing did not reveal its original passage; last reading was {'x': 105, 'y': -3.046875, 'width': 422, 'height': 27.1875}

>           wait_for(

This report triage has not run a local reproduction or established the cause. Reconcile current main, existing repairs and active workers, reproduce the focused boundary, then repair the owner of the rule. Split independent mechanisms if the grouped observations require different fixes. The complete failed log and pytest-results artifact on each run retain the traceback and screenshots.

Cause of a failure tracked in #3985.

Activity

  1. added
    tend-ci-cause
    on Nov 3, 2026
  2. leaf-agent commented on Nov 3, 2026

    @leaf-agent
    CollaboratorAuthor

    Status: cause found and reproduced on current main (0e29ca14b). No fix yet: the two simple repairs I tried each break one side of the conflict.

    Cause: #4833. That PR added a rule (annotation-chrome.css) that sets the root's scroll-padding to 0 whenever a floating comment box or card holds focus. The goal was to stop Chromium's native caret reveal from scrolling the document under a floating editor. But Leaf's own landings read that same scroll-padding as their landing band (geometry.js, landingBand). Resume writing focuses the editor (anchor-travel.js#L171) and then places the passage in the same task (#L187). So it lands with a 0px band, where it should get the 12px landing room plus any head room (base.css#L301). The selected words' line box ends up flush with the window top, and the paragraph box sits 3px above it, which is the y=-3.046875 in the report. clearFor/landedBox run before the focus, so in that one task they read a different band from the scroll that follows.

    On pages with a head room the same landing would put the passage under the top chrome. Any other script landing made while a floating editor holds focus reads the 0px band too.

    Evidence

    Repairs tried, and the ones left
    • Limit the override to an edit: a leaf-text :state(editing) set in #beforeEdit. Clearing it at input covers neither regression, because the reveal comes later. Clearing it two frames later covers the rewrite case but not grows_back, whose first scroll comes from double-click → Enter with no edit. The native reveal also follows selection and focus in a focused floating editor, so the override really is needed for as long as the editor has focus.
    • Scroll before focus in arrive's place: this would fix Resume writing. But an arrival that starts from a focused floating editor would then scroll while that editor still holds focus, and land with the 0px band. Not tried, since it moves the bug rather than removing it.
    • Left: have Leaf's landings read the root's band from its declared custom properties rather than from computed scroll-padding, so the override changes only what the browser's native reveal and scroll anchoring see. That changes geometry.js's contract that landings and scrollIntoView share one band, and it means checking motionBand, which mirrors Chrome's anchoring band, against the override. That is the next experiment for whoever picks this up. The test on main already reproduces the failure, so no separate reproduction PR is needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tend-ci-cause

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions