Skip to content

fix: rest the comment box only in the rail's margin, not over the column - #5662

Merged
leaf-agent merged 2 commits into
mainfrom
fix/issue-5641-rest-side
Nov 7, 2026
Merged

leaf-agent merged 2 commits into
mainfrom
fix/issue-5641-rest-side

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

The resting comment box from #5428 could stand over the page's own words and controls, which its placement header rules out: the box "stands only in the room beside what it is about, the margin its rail stands in". The code withheld it only above or below its target and beside a target the rail doesn't stand by (#5512). A box seated on the target's left, or right of a target that ends short of the column's edge, still stood over the column.

It now rests only on the rail's side, and only where its target reaches the column's edge. railEdge() in margin-layout.js gives that edge, and marginSpot now reads it too. Anywhere else the box waits for c, as #5428 already has it do where there's no room beside the target. c still opens the box in every case.

What changes on screen. Focus on a target that ends short of the column's right edge no longer shows the empty box. That covers an inline link or suggestion, a diagram part, a widget's control, and a question inside a tab panel. Beside a paragraph, a question or another block that reaches the edge, the box still rests in the margin. tests/browser/navigation/test_commenting.py, which holds #5428's behaviours, passes unchanged.

Before After
On me stop in a side-list tab panel before after
Inline suggestion beside a draft before after

In the first, the box covers the "Second" tab the user presses next. In the second, it covers the draft's Edit control.

Tests from #5641 that fail on main ec2799b1d and pass on this branch (--run-main, run singly):

  • test_a_tally_counts_its_regions_obligations_and_walks_them: the box intercepted the tab click.
  • test_g_hints_press_each_visible_page_map_margin_entry: the box intercepted the draft's Edit.
  • test_widget_controller_owns_presentation_across_values_and_lifetimes[light], [shadow-host], [shadow-child] and test_page_owned_registry_and_widget_use_the_captured_public_api: when the widget's value got shorter, a new placement moved the box 29 px with no input. It no longer rests beside that widget.
  • test_an_expanded_diff_file_can_retry_its_failed_chunk_in_place
  • test_a_reaction_returns_focus_to_the_visual_target[keyboard], [aim], test_a_declared_visual_part_can_raise_the_same_bar_from_the_keyboard, test_an_aim_at_a_seam_promises_the_element_its_press_takes and test_a_picture_in_a_control_stays_the_controls_and_any_other_takes_a_comment: test: let the comment box rest beside a target after a reaction, Escape or press #5661 loosened these to accept a resting bar. The box no longer rests beside a diagram part, an aimed item or a button icon, so the second commit restores their original assertion that the bar is hidden, and they pass with it.
Other checks
  • The resting-box and pane tests in test_commenting.py and test_panes.py (-k "rest or box or waits or c_ or press"): 27 passed.
  • pnpm run test:runtime (896 pass), pnpm run check, and pre-commit run --files on both files: pass.

Refs #5641 — automated triage

#5428 stands the empty comment box beside the target `c` would open it
on, and its placement header says the box stands only in "the margin
its rail stands in". The code withheld it only above or below the
target and beside a target the rail doesn't stand by (#5512), so a box
seated left of its target, or right of a target that ends short of the
column's edge, stood on the page's own words and controls. Beside an
On me stop inside a tab panel it covered the panel's "Second" tab; beside
an inline suggestion it covered a draft's Edit control; beside a widget
whose value shortened, the solve slid it across the column with no input.

The box now rests only on the rail's side and only where its target
reaches the column's edge (`railEdge` in margin-layout.js, which
`marginSpot` reads too). Elsewhere it waits for `c`, as #5428 already
has it do with no room beside the target; `c` still opens the box there.

Tests that fail on main and pass with this:
- test_a_tally_counts_its_regions_obligations_and_walks_them
- test_g_hints_press_each_visible_page_map_margin_entry
- test_widget_controller_owns_presentation_across_values_and_lifetimes
  [light], [shadow-host], [shadow-child]
- test_page_owned_registry_and_widget_use_the_captured_public_api
- test_an_expanded_diff_file_can_retry_its_failed_chunk_in_place
- test_a_reaction_returns_focus_to_the_visual_target[keyboard], [aim]
- test_a_declared_visual_part_can_raise_the_same_bar_from_the_keyboard
- test_an_aim_at_a_seam_promises_the_element_its_press_takes

Refs #5641
… press

With the box resting only in the rail's margin, it no longer rests
beside a diagram part, an aimed item or a button icon, so these tests'
original assertion that the bar is hidden holds again. This restores
it, reverting #5661's loosening to the bar outside its rest.

Refs #5641
@leaf-agent
leaf-agent force-pushed the fix/issue-5641-rest-side branch from e6ed784 to 5069e01 Compare November 7, 2026 12:43
@leaf-agent
leaf-agent merged commit 9d35160 into main Nov 7, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-5641-rest-side branch November 7, 2026 13:03
leaf-agent added a commit that referenced this pull request Nov 7, 2026
`test_design_mode_reads_each_shape_of_control_into_the_anchor_its_routes_carry`
has failed on main since #5506. Its "a control's name is its own"
subtest asserts that a field's design label carries no neighbouring
control's words. The `spoken` section had no heading, so the label's
`section:` context came from `main`'s leading `<h1>Settings</h1>`, the
climb #5506 deliberately stopped. Since then the unnamed section is
named by its own words, `Find settings ×`, and the close button's `×`
reaches the field's label through the section's name, not the field's.

The test this case came from
(`test_design_spoken_context_does_not_borrow_a_neighbours_face`, added
in b91b966) gave the section its own `<h2>`. #5409 dropped it when it
merged the case into `CONTROL_SHAPES`, and the subtest kept passing only
because of the #5228 bug that #5506 fixed. This restores a heading on
the section, so the assertion is again about the control's own label,
and #5506's naming stays as it is. No product behavior changes, and
`CONTROL_SHAPES` has no other reader.

**Verification.** The test fails on main `bdc4c03b0` with the issue's
message and passes with this change (35 subtests).

The issue's second test,
`test_render_gate.py::test_scrollbar_clearance_reads_generic_content_and_open_shadow_words`,
already passes on `bdc4c03b0` with no change here. That fits #5662,
which stopped the resting comment box from standing beside a target that
ends short of the column's edge, so the box's `aria-label` no longer
collides with the `First choice` role query.
`test_an_expanded_diff_file_can_retry_its_failed_chunk_in_place` stays
with #5641.

Closes #5645 — 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.

1 participant