Skip to content

test: let the comment box rest beside a target after a reaction, Escape or press - #5661

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-5641-rest-tests
Nov 7, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-5641-rest-tests

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

#5428 rests the empty comment box beside the target c would open it on, whenever focus is on a target the user can see. Four tests ran a gesture that leaves focus on such a target and then expected .lf-fab-bar hidden. What they protect is that no comment field stays open, and the resting box is #5428's intended result, so they now check .lf-fab-bar:not([data-lf-rest]). Their other assertions are unchanged.

  • test_a_reaction_returns_focus_to_the_visual_target[keyboard] and [aim]: a reaction returns focus to the diagram part, and the box rests beside it.
  • test_a_declared_visual_part_can_raise_the_same_bar_from_the_keyboard: Escape hands focus back to the part.
  • test_an_aim_at_a_seam_promises_the_element_its_press_takes ("within a pixel of the seam"): Escape returns focus to the aimed item.
  • test_a_picture_in_a_control_stays_the_controls_and_any_other_takes_a_comment: a press on a button icon or a slider's picture leaves focus on that control. CI on main has failed it with the same "visible" message since run 42264154777, and it passes locally both before and after this change.

The first three fail on main ec2799b1d and pass on this branch, run singly with --run-main.

Refs #5641 — automated triage

…pe or press

#5428 stands the empty comment box beside the target `c` would open it
on, so after a reaction returns focus to a diagram part, after Escape
closes the field on an aimed item, and after a press leaves focus on a
control, the bar stands at rest (`data-lf-rest`) where four tests
expected it hidden. What those tests protect is that no field stays
open, so they now assert that of the bar outside its rest. The tests'
other assertions, focus returning to the part and the pending mark
clearing, are unchanged.

Refs #5641
@leaf-agent
leaf-agent merged commit 5f39640 into main Nov 7, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-5641-rest-tests branch November 7, 2026 12:22
leaf-agent added a commit that referenced this pull request Nov 7, 2026
… 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 added a commit that referenced this pull request Nov 7, 2026
…umn (#5662)

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](https://github.com/user-attachments/assets/3c4afe80-8462-486d-8e24-3931a2dbd4d2)
|
![after](https://github.com/user-attachments/assets/18c420f5-2d8a-4938-a039-51fbe69163f1)
|
| Inline suggestion beside a draft |
![before](https://github.com/user-attachments/assets/3a2e1a28-2d43-472b-8a2e-232397b39588)
|
![after](https://github.com/user-attachments/assets/a03330de-b979-4eb7-8e99-64dafa9e3eec)
|

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`:
#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.

<details><summary>Other checks</summary>

- 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.

</details>

Refs #5641 — 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