Skip to content

fix: keep a tab set's open-panel stop from the reach pass, and select the editor's line instead of typing into the previewed table - #7604

Merged
leaf-agent merged 3 commits into
mainfrom
fix/issue-7532-render-files
Nov 29, 2026
Merged

leaf-agent merged 3 commits into
mainfrom
fix/issue-7532-render-files

Conversation

@leaf-agent

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

Copy link
Copy Markdown
Collaborator

Two fixes for test_a_double_click_on_the_rendered_copy_types_at_its_line_in_the_editor.

A tab set's open panel kept losing its Tab stop to the reach pass (browser/runtime/dom/reach.ts). Since #7585 ported lf-tabs to Effect UI, its arrival roves the open panel's tabindex="0" after the reach pass has already recorded the panel as a scroll candidate. On its next paint, returnStop took that 0 back, as it did any 0 on a candidate. So the open panel lost the Tab stop lf-tabs gives it, and the write watch reported null → 0 → null as unchanged write: tabindex on lf-tab#…--preview. That failure reproduces on every run at main 1026a7485 and at #7585 (b9b4884d1), and never at its parent 6e1977ac0. It turned this PR's test job red once main was merged in. returnStop now gives back only a stop wearing the pass's own data-lf-lent-reach-stop mark, and lendStop leaves alone a 0 that another owner wrote. The header of mayScroll already said the pass "takes back only that". A new runtime test in tests/runtime/reach.test.mjs fails without the change and passes with it.

The test's keystroke reflowed the previewed table (macOS teardown shift). To show where the double-click left the caret, the test typed Z at the start of | x | gamma |. That gave the Markdown preview's table a new first cell, so its columns reflowed. lf-text-document draws that redraw after native awaits, which input_work_watch.js doesn't follow (tests/AGENTS.md, "Browser errors"). So on a slow runner the reflow landed outside the keystroke's window and was reported as #text in th … moved without input by (2, 0)px. The test now presses Shift+End and asserts the selection is the whole line, which shows the same caret position and changes nothing the preview draws. The underlying limit, that the input watch can't attribute a redraw drawn after a native await, is left as easy to fix as before.

Evidence
  • Reach fix, Linux: the test passes at the merged head; at main without the fix it errors on the unchanged tabindex write. test_tab_reaches_the_open_panel_and_no_closed_one, test_a_scrolling_tab_panel_keeps_nested_headers_on_its_edge and the two borrowed-stop tests in test_render_aim.py pass. The full runtime suite passes (1296 tests), and the browser type check is clean.
  • Keystroke fix, Linux with Chromium slowed 4x (leaf-dev suite flake --cpu-throttle 4): before the change, 3 of 4 copies fail with the same report on a td of that table; with this change, 6 of 6 pass.
  • Keystroke fix, macOS (ci dispatches with flake): at main 6313a6f59, 4 of 12 copies error (46168668757); on this branch before the merge with main, 18 of 18 pass (46235315494).

Refs #7532 — automated triage

…g into the table

The double-click test typed Z at the start of '| x | gamma |' to show the caret's column. That edit added a cell to the preview's table, which lf-text-document redraws after native awaits the input watch doesn't follow, so on a slow runner the reflow landed outside the keystroke's window and the shift watch reported it as a move without input. Shift+End selecting the whole line shows the same column and changes nothing the preview draws.

Refs #7532
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

The red test job here is a different failure in the same test, and it comes from main, not from this change. CI tests the PR merged onto main, which now includes #7585 (lf-tabs ported to Effect UI). Its teardown error, unchanged write: tabindex on lf-tab#written--preview (write watch), reproduces locally on main at 1026a7485 with this change absent. Main's push runs since #7585 were all cancelled as superseded, so none has shown it yet; run 46236419719 on 1026a7485 is the first that can.

This PR's own claim, the shift report from the typed Z, holds on macOS: 18 of 18 copies pass on this branch, where main errored in 4 of 12.

The reach pass gave back any `tabindex="0"` on a scroll candidate that
stopped scrolling or fit, including one another owner wrote. Since lf-tabs
moved to Effect UI (#7585), its arrival roves the open panel's stop after
the reach pass has recorded the panel as a candidate, so the next reach
paint removed it: the open panel of a tab set lost the Tab stop lf-tabs
gives it, and the write watch reported `null -> 0 -> null` as an unchanged
write of `tabindex` on the panel (test_a_double_click_on_the_rendered_copy_
types_at_its_line_in_the_editor, on every run after #7585).

`returnStop` now acts only on a box wearing the pass's own mark, and
`lendStop` leaves a `0` another owner wrote alone, as the header of
`mayScroll` already said the pass does. A runtime test covers a surface
that stops scrolling with another owner's stop on it.
@leaf-agent leaf-agent changed the title test: show the editor's caret by selecting its line instead of typing into the previewed table fix: keep a tab set's open-panel stop from the reach pass, and select the editor's line instead of typing into the previewed table Nov 29, 2026
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

The tabindex teardown error from #7585 is now fixed on this branch in 94f134e, along with a merge of main. reach.ts's returnStop used to take back any tabindex="0" on a scroll candidate, and that included the stop lf-tabs gives its open panel on arrival. It now takes back only a stop the reach pass lent and marked. The test passes locally at the merged head, and a new runtime test in tests/runtime/reach.test.mjs fails without the change. The description has the details. Main's push run 46236419719 should show the same error until this lands.

@leaf-agent
leaf-agent merged commit 8845c2b into main Nov 29, 2026
8 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-7532-render-files branch November 29, 2026 07:30
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