Skip to content

Merge or remove 230 duplicate test functions, and leave Copy's press to Copy - #5409

Merged
max-sixty merged 47 commits into
mainfrom
test-consol
Nov 5, 2026
Merged

max-sixty merged 47 commits into
mainfrom
test-consol

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

Test functions fall from 4,576 to 4,346, and test code by about 4,090 lines. At the per-test times of recent push and nightly runs, that saves about 14 of 309 worker-minutes on a push to main and about 18 of 585 on a daily run, two-thirds of it from page opens that merged tests no longer make. Those savings are priced from past runs, not measured.

By tier: model 1,272 → 1,235, process 243 → 242, smoke unchanged at 9, browser 2,605 → 2,446, journeys 447 → 414. tests/runtime is unchanged. Merging cases onto one page with subtests re-indents them, so +6.5k/−10.6k overstates how much test code moved.

A test was removed only where one surviving test reaches the same fixture state by the same route and makes the same assertion; tests/AGENTS.md now says so under "Removing a test another covers". A case that publishes a revision keeps its own page. Agents that read whole files put the true duplicates still left at 2–5% of cases, so most tests that look alike pin different faults.

Behavior changes

  • Pressing Copy in a draft no longer opens the draft's editor, and double-clicking Copy on a message no longer opens its rewrite. lf-draft.js and thread/messages.js now ask worksInside whether a press belongs to a control or link inside them, because the Copy host's empty data-lf-offer is not in PRESSABLE. test_a_double_click_on_a_message_s_copy_is_the_control_s holds the message case, and the draft tests assert the editor stays closed after Copy.
  • delivery_records in src/leaf/codex.py no longer skips a record whose file name is not a valid delivery id. No code writes such a name, and root AGENTS.md's "Stage" makes earlier records disposable.

Coverage given up

  • Three page check acceptance cases from tests/journeys/test_interact_document.py are gone, which an audit rated as thin corners: test_a_version_can_change_the_authored_column_after_a_user_move, test_unreferenced_ids_and_widget_items_may_leave_the_page and test_an_answered_obligation_moves_into_a_collapsed_section_with_its_pick_in_force.
  • One inventory test in tests/browser/test_render_aim.py replaces nine per-shape design-mode flows, so sending is no longer tested per shape. A review found no shape with its own send path.

Testing

This PR's gate, which adds the 85 later-tier files it edits, passed 2,369 tests with one failure: the Firefox case of test_a_caret_is_drawn_at_a_lines_end_and_after_a_list_bullet. That case times out in the same wait_for_function under its former name, test_a_caret_at_a_lines_end_paints_inside_the_field[firefox_browser], on main's last finished push run, so this change doesn't cause it. Locally, the changed model/ and process/ files (1,376 passed, 1 skipped), pnpm run test:runtime (812 passed), pnpm run check:browser and pre-commit pass. Later-tier files this PR leaves unedited run after landing.

This was written by Claude Code on behalf of max-sixty

Behaviors that lost duplicate coverage, each still held by the named test:

- A promise from a probe is refused by name: the wait probe's journey goes,
  and the browser tier's reading probe stays, since both reach driver.js's one
  check.
- A probe module that throws is a gate finding: the journey goes, and
  test_a_failed_probe_import_keeps_its_original_throw_site now also asserts the
  finding's code.
- The trace viewer at rest: the browser test made the same at_rest call on the
  same page as the corpus sweep's at-rest journey, which holds it daily.
- Enter and Space on a summary: test_the_arrows_say_which_way_the_section_under_the_user_goes
  holds it.
- A focused editor in a generated shadow tree keeps an unrelated revision:
  dom-children.test.mjs holds retention for a shadow editor's owner and for
  generated content under the patch root.

Merged onto one page, assertions moved unchanged into subtests: an export's
chart, quiet words and reachable modules; the public package API's import
boundary, formatted words and landing room; About's copies with the
diagnostics dialog; the visual review dashboard's widths and its capture
reading; a reply's Markdown and a suggestion's characters; written module and
image addresses; block margins under density, frames and the column; a wide
table and the quiet word it carries.

Cases dropped: the rest reading's lighter callback, which the ten-times case
covers, and the settling failure's state stage, which log and presented bracket
in READINESS.

No behavior lost all coverage.

> _This was written by Claude Code on behalf of Maximilian Roos_
Four tests repeated what another test already fails on, so they go: the
On view naming the agent, `t` opening a page thread in the panel, the
first `?` opening the command reference, and a seat's send leaving the
user on the thread it started.

Seven tests shared a page with another test of the same kind, so each
moved into that test, unchanged, saving a page open: `c` returning to a
thread's reply, Threads' page order, the menu's chevrons, a menu row
leaving the user on the leaf, a squeezed message head, one rewrite open
across readers, and a folded reply's markup staying in the open seat.

Three parametrized cases fail only where another case already does:
capture's paint under a touch context that drove the same mouse drag,
the uninterleaved case of revealing held progress, and the seated comment
box's row height under a mouse, whose assertion moved into the test that
already opens that box.

No behavior lost all coverage.
…ange

These behaviors lose duplicate coverage. None loses all of it.

Removed, since other tests fail on the same change:
- A marker's press opening its thread in a card with the panel shut.
- A key choice replaying and staying chosen in the next revision, now held by the
  review-queue journey alone.
- A panel thread and Threads leaving on Escape, and g T toggling and standing on the
  thread's row.
- Each pane's reading across the flow and bounded crossing.
- Two routes of `c` and its badge that reach the closed card a kept route reaches.

Merged onto one page, their assertions moved unchanged apart from the value `?` now
types after `c`:
- What a nearest landing counts as already shown.
- The next Tab after the reference or a panel view closes.
- A reading place naming a projected datum.
- Letters in a selected passage's comment field, and the page's keys once it closes.
- An obligation walk revealing a pin under hidden annotations.
- A card on a display: contents target following its parts' visibility.
- An answered obligation under Done.
- A pane's withheld row, and its pin on a carrier through boxes that scroll nothing.
- Filtering the reference and the Page Map at each window.
- A thread card's side and width at three windows.

A failing render check's screens are now read from the failing check the refusal test
already runs, which spares a second browser run.
Behaviors that lost a duplicate and keep a test that fails on the same change:

- An empty bootstrap handover leaving Space to the browser, now proved only by
  the runtime test of bootstrap.js.
- An external link's treatment at page open, which lost its geometry assertions
  in #4724 and was left a subset of the navigation and projected-link tests.
- Undo's menu row showing then taking, a page loaded after an undo, a bounded
  pane carrying the comment field, and accepting a suggestion resolving its
  thread in one event.
- A thread's age advancing without a state read, which the message age test
  reads on two surfaces.

Two tests merge into ones already making the same gestures. The suggestion undo
test now holds the comment marks and focus assertions, and the navigation keys
test now covers Shift+Space by its cancellation rather than by Chrome scrolling.
The comment field's return test gains the width the pane test read.

Dropped parametrized cases that no distinct fault breaks: the shift watch's
synthetic activation repeated across inputs and its clean activation, which
`late` runs first; a 40px passive shift the timer-clock test repeats; effect-free
and overflow-free controls; closed shadow roots crossed with departures; a
transform crossed with anchor faults the cascade decides; the 1x latency of a slow
send; and the first history answer's full product of answer and focus.

No behavior lost all its coverage. The shift watch keeps its fault matrices: a
crediting rule's case usually fails alone, by reading of the cases and of
shift_watch.js where a case turned on it.
These lost duplicate coverage, each keeping a test that fails on the same
change:

- A page made again at a deleted path starting unclaimed, and a lock taker
  following a replaced path, each have one model test per mechanism.
- A Codex command's claim naming its thread, harness and default agent moves
  from a journey to the model test that already claims under a real Codex.
  The record's exact key set stops being asserted: `service.CLAIM` owns it.
- Journeys that re-proved lower tiers go: a re-selection keeping pending input,
  session end releasing a page, and a transferred Codex receipt.
- Two Codex Stop journeys on one fixture become one, with every assertion moved
  beside the unchanged snapshot, and an App Server delivery's receipt joins the
  test of its order.
- Cases that take the same route drop: the steady queue delivery, which the
  retry case runs in full; two of Pi's four message and cancel combinations;
  the Codex reconnect reminder; a re-vendor under another selection; a direct
  `receive_delivery` beside `delivery ack`; Pi's pointer confirmation, which
  Claude Code's shares; an action delivery's malformed start; two of a deep
  directory's owner and arrival combinations; and the deploy gate's second
  failure code.

One behavior loses all coverage: skipping delivery records named under an
earlier id vocabulary. No current code writes such a name, and Stage makes old
records in the state home disposable.
These tests fail on the same product change as a test that stays, so each
behavior below keeps one test that would catch it, at the lowest tier that holds
it. No behavior is untested that a user depends on.

Behaviors that lost duplicate coverage:

- Revising a page after a decision. When #2020 removed the gate between a version
  and the log, each of its refusal tests became an "allows" test reading only the
  check's exit code, so they all fail together on a new gate. One test each stays
  for a suggestion, a moved card, a draft, a dropped group and a generated child.
- A question in a reply and how it ends; to-dos surviving a lost seat or widget;
  who may end a to-do; a start reopening a closed page.
- Addressed replies: the fence on a superseded reference, a foreign session, retry
  idempotence, activating the source, and an answer declaring nothing.
- Package selection and `package init`: bundled and path selection, its path
  argument, a symlinked registry, an aliased source. The case-aliased init tests
  skipped on Linux CI; the path primitive's test holds them on every platform.
- `test_package_init_starts_one_checked_upgraded_widget` ran `page check --render`
  in its own browser; the prepared-install journey runs the same commands on the
  same starter and draws it, which saves 29 seconds a night.

Parametrized cases that took one path: a sample's child and a sample fixture go
through one gate at either door, so one case per door tests the door. A filename's
spelling and the form that imports it are read apart, so the full cross of the two
goes. A package has no user or project scope any more, so those cases go, as do the
generated-child mutations the dropped `creates` dominates.

Three tests protected nothing, so nothing replaces them:

- The nested-pick test asserted the absence of a finding that no longer exists in
  src, on a page whose exit code rests on no rule about nesting.
- The `x-space` beside `x-says` test held the absence of a validator nobody
  proposes, for a pair of keys no bundled widget declares together.
- The retired `label` and `recommended` test kept two names out; adding one back
  is a decision, and an undeclared attribute being refused stays tested.
Browser tests that re-proved one behavior, or each opened a page for independent
checks of it, now share a page or give way to the stronger test.

Merged onto one page, with the same assertions as subtests: nested hint chips,
partly clipped hints, search's focus handling, pictures in controls, a visual
target's one proxy and Escape parent, the aim at a seam, the armed page's promises,
where the aim stands on a field and a cell, capture of a control's own words,
code colouring, a change card's word runs and forwarded first entry.

Removed as covered by a stronger test, with no behavior losing coverage: search
travel to an offscreen match, Suggest without reactions, forgetting a heard hint
after a scroll (now the runtime's hint-session test), a repeated passage's anchor,
and a rewritten quote's thread label. Dropped the parametrized cases that read the
same state on the same path: the light response ring, near context growth, the
`true` editing value where the page also holds it, the bare obligation quote,
three focus-lifetime removals, and two of the four diff metadata source and posture
pairs.

Behavior that lost all coverage: an anchor from an older log, either with its
context clipped at a section's edge or with no prefix, resolving as it did when
written. Stage makes logs from earlier runtimes disposable and no current capture
writes those anchors. A short stored context and ambiguity without a document-order
fallback stay covered.
Five browser tests go because another test fails on the same fault: undoing a
playground's choice (the select and page-drawn playground tests), a quotation
in a playground (the Node playground-view test), a playground's values refused
at admission (the model's instance-contract test), a workspace body clearing
the panel (the end-room test's plain case), and a detached widget ignoring news
(the Node LeafElement test). A thread naming a widget an agent sent folds into
the test of the same thread, its one further assertion moved over unchanged.

Tests reading one page now run on it as subtests: the list of parts, stacked
sticky headers and focus in them, the covered-words check, a board's words and
grips, a card's title and prose, cancelling a drag, a long outline, a change's
arrival, and the obligation walk.

Two cases stop running because no fault separates them from the case that
remains: reduced motion on a suggestion's margin row, whose test no longer
opens the panel that case was added for, and a phone diff's headers with no
preparation held, since the held case's other two files take that route. No
behavior loses its only test.
No behavior loses all its coverage. The decisions below remove duplicate
coverage or page opens.

Removed because a kept test fails on the same change:

- A box that stops scrolling sideways drops its continuation mark: the
  ancestor-style test goes through the same reread, classify and paint.
- The root scrolls the document, an open view scrolls itself, and the panel
  takes no room: the wheel test and the auxiliary-surface test read these.
- A drawing the room can hold is shown whole: the drawing placement test has a
  rail row and a drawing wider than the column.
- A draw that throws keeps its authored nodes and the next reading draws over
  it: `leaf-element.test.mjs` proves this, and the failed-soft test consumes the
  console report naming the widget.
- A draft's faces in the panel's page comment: it is the same field as the
  panel's reply, with no rule by name.

Merged onto one page as subtests, with their assertions moved unchanged:

- A question's marks and rows at rest, and the mark under its own press.
- Each obligation shape's heading, joined cells and picked ring.
- A nested obligation's arity and commands.
- A diagram's room and its scheme, and a declared width on screen and on paper.
- Which scrolling boxes the sweep lends a Tab stop.
- A quiet action's press and a quiet toggle's chosen mode, which now also runs
  in Firefox.
- Shift+Enter and Tab in a draft, and the caret at a line's end and after a
  bullet.
- The cases of the arrow-key tests, the open-fence test and the row reference
  test.

Each case that shares a draft field now empties it first by keys. The row
reference's read puts its probe write inside `lfUnwatched`, since a second read
on one page restates the style.

The two tests of widget work staged into a shadow tree build one page and make
one move, so they are one test. It reads the marker's display before the move
rather than pinning `flex`, which #5375 made `grid`, so a marker that keeps its
display across the boundary passes. That literal failed on main's latest push.

`test_a_caret_at_a_lines_end` fails in Firefox on main, in last night's run and
the latest push; the merged test's line-end subtest fails there the same way.

`tests/render_cases_widgets.py` keeps `DRAWN_PAST_A_RAIL_PAGE`, which nothing
reads now, so vulture reports it until it is deleted.
…in-reply precondition live

The margin-reply growth test's check that the transcript starts unclipped named a case, 6, that no longer runs, so it never held.
# Conflicts:
#	tests/browser/widgets/test_threads.py
# Conflicts:
#	tests/browser/widgets/test_threads.py
# Conflicts:
#	tests/browser/widgets/test_threads.py
# Conflicts:
#	tests/browser/widgets/test_threads.py
# Conflicts:
#	tests/browser/widgets/test_threads.py
# Conflicts:
#	tests/browser/widgets/test_threads.py
…record skip

The menu's Undo row keeps its own test, since a menu closing after its press can put
away what the press showed. An item's comment field in a bounded pane is a case again.
The completing stamp now runs on a version without the widget, the state the removed
to-do test read. delivery_records stops skipping old-vocabulary names, which no code
writes and root AGENTS.md's Stage makes disposable.
… they repeat

A second pass over the navigation tests, reading every test body in the eight
files. Opening a page is about half of browser time, so most of this runs the
cases of one behavior on one page as subtests: `c` and its badge across each
card route, the restored place in a pane, opening a comment on a visible
target, a form control's keys, and how an inner scope shadows an outer one. No
merged test lost an assert or expect statement, checked by comparing the old
tests' statements with the merged ones. A case that can leave a layer up runs
last or is followed by what closes it, so its failure doesn't fail the next.

Duplicate coverage dropped:

- `g z` on a tall item through an outer pane: the test of a pane in a pane has
  the harder fixture and now also holds the pane's scroll padding and the
  history entry.
- The shared image viewer in a light popover: `seatModal` takes the same branch
  for a shadow popover and only adds the sheet.
- Words drawn outside their block read on the first reading: the breakpoint
  case reads the same measure after an earlier reading.

One test lost all coverage. The test of the `opened_tab` helper protected no
user-facing behavior, and the helper's users still fail if it stops returning a
tab, but a tab it leaks now goes unreported.

The merge of first-pass work also carries main's rename of `.lf-fp-quote` to
`.lf-thread-quote` into tests/browser/widgets/test_threads.py.

> _This was written by Claude Code on behalf of max-sixty_
Five groups of browser tests on one behavior now share a page, each case in a
subtest on its own thread or draft, with any case that writes to the log last:

- the walk up through a user's messages, including its view and changed words;
- a card at the window's foot growing back after a rewrite;
- a long rewrite keeping its caret in view, in the panel and the page's flow;
- a draft's editor keeping words in place, for its blocks and wrapped lines;
- a finger's reach on a draft's toolbar.

Two cases go because a kept case holds the same fixture, gesture and assertion:
the panel case of a message's age (Transcript computes it for every surface) and
the plain reply case of a discarded rewrite handing back Resume writing (the
emptied-composer case runs the same gestures with one more step before them).

No behavior loses all coverage. test_a_card_at_the_windows_foot_grows_back now
reads the words' first line where it read the message body's top.

Also share the composer's held-paste setup, use paste_image where the upload is
not held, and remove branches on constants the parametrization never varied.
A second pass over eight files, reading every test body. Most of what
falls out is page opens: tests of one behavior on one kind of page now
share it, with their assertions moved unchanged.

Behaviors that lost duplicate coverage:

- A widget's late draw keeps its revision: the runtime test in
  project-data.test.mjs holds the same widget in the same order.
- Data written during a held read arrives through the trailing read:
  test_a_source_that_returns_under_an_unfinished_reading_stays_current
  holds a read the same way. Deleting acceptData's `taken` order left
  the removed test passing, since the page's one read slot delivers the
  held answer first, so the crossing it was named for never happened;
  framework-application.test.mjs is what fails on that change.

Behaviors that lost all coverage, neither of them shipped:

- A fraction chip keeping its width: `.work-progress` and its tabular
  figures exist only in the work test fixture.
- A roster row keeping its text node across a poll: the row is that
  fixture's one Lit template, whose text node Lit keeps whether or not
  the row redraws, so a spurious redraw could not fail the test.

Cases dropped: a selective reader's root turn, which starts with its
widget already drawn; Threads' route at 1440 wide; the alias test's
patch-text form, which reads the same file records as the manifest form
it keeps; the task hierarchy on the fixture's own tasks.
No behavior loses its coverage. Duplicate coverage goes from these:

- A page another session took after a hook listed its pages gets no plan.
  `test_a_hook_renews_no_page_another_session_took_after_it_listed_its_pages`
  reaches the same check on a stale listing and asserts more.
- A turn whose reply write faults still closes. The two tests had one fixture and
  one fold ending, so they are one test on the observer's route, which also reads
  the activity reading coming off.
- A reply reservation lapses once its turn is not the open one. One test now has
  an arm per condition, and the closing arm also checks that a late commit yields.
- An embedded delivery carries the page's whole batch in log order. One page now
  holds the action, the settled input and the resolve that three tests held apart.
- A queue owes nothing until it is finished, then every moved card. One test now
  has a page arm and a thread arm, and the page arm also reads On me.

These parametrized cases go, since each fault tried that failed one also failed a
case kept: a late delta on a completed turn, a stale snapshot with no earlier fold, a
newer prompt during Stop with no input pending, and a first delivery of an untitled
thread.

Each removal and merge was checked by applying a product fault to the base and
reading which tests failed. That kept several apparent duplicates, each the only
test failing on its fault: a page claimed mid-turn with no transcript, a provider
start naming a closed turn, and a Codex Stop that declines to offer.
…th pointer routes

Nine tests each opened a page per control shape to run a comment flow. One
reader decides what a shape targets (`designTargetAt` and its `capture`), and
the press and the picker both go through it. The composer and the log carry the
anchor unread: outside anchor resolution, only the aim's name and an anchor's
label read `anchor.part`, and the registry's schema checks only the field's type
and which fields may accompany it.

One test now holds those shapes on one page. It reads each shape's anchor and
inventory entry, walks the picker's map to hear each announced as captured, and
presses each shape with a browser default or a handler of its own, by the plain
press and the picker's press, up to the comment opening on it. A failed case
undoes what it left, so it can neither cascade into the next case nor hide it.
Out of the mode, the same presses take effect, which proves they landed.

These behaviors lost their per-shape send: a repeated control's distant context,
a closed select's words, a label and its input, an associated label, spoken
context, a generated tab, table and inline and clipped labels, regions, and named
pictures. Sending stays covered by whether the anchor quotes words, by each route,
in the repeated-control, visible-face and native-textarea tests. No behavior lost
all coverage. A revision keeping a captured quote exact moved to the visible-face
test.

The horizontal rail test drops its class case, which differs from the inline case
only in how one computed transform reaches the target.

The comment growth tests stay. The placement solver's tests never hold a surface
by its foot or place one beside a target taller than the room, and each browser
test starts from a state no other reaches.
…pens fewer

No user-facing behavior loses coverage. Each merge moves its assertions unchanged, and
a statement-by-statement comparison of old and merged tests finds none missing.

Tests folded into one on a shared page or journey:

- A card's way out, by every route that brings it a thread: `t`, a second note or
  marker, a send from a control, and that send with Threads open.
- Focusing a marker opening no card, now in the test of what a location groups.
- The Page Map's search: filtering in place and walking its rows.
- A live version keeping the user on a marker and in its card.
- A finger's keys opening the Page Map on its first row, in the small-screen sheet's
  finger case.
- `o` hiding the annotation layer and the panel's field saying so.
- An obligation marker's selection, label and name.
- A cluster's keyboard arrival and its arrow walk.
- Opaque contribution identity in the margin and the Page Map.
- The new-rail and new-pin cases, a bounded region's two reflows and the tone test's
  two colour schemes, each now subtests on one page.

A shared-page case now puts away what it opened even when it fails, so one failure
doesn't cascade into the next.

Cases dropped because they exercise no different path: `prose-1207` of the live-page
column test, one pixel from `prose-1208` with the rail's threshold near 958px, and the
workspace case with no `data-rail`, since a workspace ignores the attribute.

Also repairs a reading #5375 left stale. It moved a margin row's seat to `margin-left`,
which the grouping test's `needed` still summed, so that test has failed on main since.
The term was zero before #5375, so the assertion means what it meant then.
# Conflicts:
#	tests/browser/widgets/test_threads.py
A press on Copy copied and also opened the editor, since the click reached the draft
retargeted to the copy control's host, which the press check didn't recognize. The
check now reads the event's composed path, so it sees the button inside the shadow tree.
Each pane's reading across a width change keeps its test, since its survivor read only
one pane. The panel's thread ages by the clock, since it draws through another path than
the card and inline cases. A lease follows a path renamed aside as well as one deleted.
Retiring a logged action's verb runs a re-selection that really changes the layer, since
an unchanged one returned before reading. A refused stamp says why, which a bare nonzero
exit would pass on a crash.
# Conflicts:
#	tests/browser/threads/test_seated_threads.py
An audit of duplicate removals found they lost coverage when each factor of the removed
test survived in a different test, or the survivor reached the end from an easier state.
A refusal test reading only the exit code also passes on a crash.
The draft's composed-path check answered the question `worksInside` already owns, and a
double click on a code block's Copy in the user's own message still opened its rewrite,
since the click reaches the message retargeted to the control's host. Both now ask
`worksInside`, which matches that host by its offer mark. The margin grouping test reads
the row's own width, since its sum read only the marker and passed a group of any width.
tests/AGENTS.md gives a case that publishes a revision a page of its own. Folding these
two saved one page opening and republished the first version between them.
As with the current-location tests, tests/AGENTS.md gives a case that publishes a
revision a page of its own, and folding these saved one page opening.
# Conflicts:
#	browser/runtime/thread/messages.js
#	tests/browser/projection/test_visual_review.py
@max-sixty
max-sixty merged commit 1b3e077 into main Nov 5, 2026
3 of 4 checks passed
@max-sixty
max-sixty deleted the test-consol branch November 5, 2026 05:56
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]>
leaf-agent added a commit that referenced this pull request Nov 7, 2026
…refox (#5674)

In Firefox, an input method's composition that starts over selected
words in Leaf's text field is dropped. `compositionstart` names the
selected words as its range, the composition commits, and the field
still holds the old words. A bare CodeMirror 6.43.15 page in the same
Firefox replaces the selection, and so do a plain textarea and a
contenteditable. The loss comes from the field's shadow root, the same
Firefox defect `field-editor.js`'s `beforeinput` handler already works
around for typed words. That handler skipped compositions, because a
composition's `beforeinput` can't be cancelled. Now, on a composition's
first `insertCompositionText` over a selection, the editor takes the
selected words away itself, so the composition starts at a collapsed
caret. The deletion is an `input.type.compose.start` change, which
CodeMirror's history joins with the composed words, so one undo brings
back the original text. EditContext fields and updates after the first
are left alone.

This is why
`test_a_caret_is_drawn_at_a_lines_end_and_after_a_list_bullet[firefox_browser]`
timed out. Playwright's `insert_text` reaches Firefox as a composition,
so the test's select-all-and-replace never replaced anything, and the
field never shrank to the one line the wait expects. #4844 added that
step to the test's predecessor, which already failed at `09e524975`,
before #5409 merged the two tests. The caret assertions themselves
needed no change.

Tests:
- The caret test passes in both engines.
- `test_words_typed_over_formatted_words_replace_them_in_firefox` now
also puts an input method's words over a whole and a partial selection,
and undoes them. Without the `field-editor.js` change it fails, with the
field still holding `aa **bold** zz`.
- Also passing: `test_render_words_watch.py`, the Chromium IME test
`test_a_pointer_send_finishes_the_words_an_input_method_holds`,
`drafts/test_draft_editing.py`, `drafts/test_composer.py`, `pnpm run
test:runtime`, `pnpm run check:framework`, and pre-commit.

`tests/words_watch.js` also needed a fix. It settled a `leaf-text` edit
at the field's first announcement, so the deletion's announcement made
it miss the composed words that arrive after Firefox's own `input`, and
it reported "aa **bold**" as words that left the screen. Now a native
`input` that arrives after its field's edit has settled reopens the
edit. An earlier attempt that held every composition until its native
input broke the Chromium IME test, so the watch change is limited to
this reopening.

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

2 participants