Skip to content

fix: avoid stale targets in the keyboard attribute sweep - #4399

Merged
leaf-agent merged 9 commits into
mainfrom
fix/issue-4256
Oct 28, 2026
Merged

leaf-agent merged 9 commits into
mainfrom
fix/issue-4256

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

The stale-key sweep chooses, scrolls and measures a random control in one browser task, clicks its screen coordinates, and types through actual browser focus. It retains neither a node handle nor an ordinal across tasks, avoiding the detached-target waits reported in #4256. It keeps forty seeded steps, readiness and settling waits, forced key repaint comparisons, and the browser watches.

The input paths expose two watch corrections and three redundant writers. Native modal dismissal retains the gesture that puts its fields away; timer closes and disallowed backdrop presses still report passive words loss. The swap watch distinguishes a single control line from a list growing across several wrapped lines, while oversized replacement controls still fail. A drag grip leaves a no-travel click without a temporary zero translation. On me separators keep their group's identity when its first item changes, avoiding a card moved out and back during Lit reconciliation. An offline file editor does not enter a busy state for a read that immediately refuses. The card layout, drag geometry, offline refusal and live file-save behavior remain the same; these writer changes add no intended visual state. The committed kernel is rebuilt.

Validation:

  • On head 5d89c86c847b470f10fe63f40dc2c8ea5f8d40a7, the release-notes and file-editor sweeps reproduced their CI write-watch failures locally. After the latest corrections, release-notes, deck and file-editor each pass with the watches active.
  • The added offline-editor check fails the write watch before its correction and passes afterward; the existing live file-editor save/retry regression passes.
  • pnpm run check passes, including all 695 runtime tests and 85 Worker tests. The browser build, pinned Ruff lint/formatting, Prettier and ESLint checks pass.
  • Earlier increments verified the no-travel thread-card and composer presses, the github-discoveries sweep, modal dismissal, wrapping lists, and the dynamic-widgets, code-comparison and ship-review sweeps.
  • The latest release-notes startup comparison against that head loads 42 code requests on both versions through upgrade and server-state presentation, with 19 fewer JavaScript bytes. Neither arm reports startup layout shifts.

The previously stated readiness hold for #4581 and #4582 is cleared by these reproductions and passing checks. The new head still needs its queued review and CI result; with await_ci: false, that review and the CI landing follow-up own verification after this push.

Closes #4256. Closes #4581. Closes #4582.

Select visible indices from the full control list and act through locators, so scrolling or focus can replace a node without invalidating an element handle or shifting the visible-only index. Keep all forty attempts and fail if the sweep loses every visible control.

Closes #4256
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

The three cases reported in #4256 pass at this head, but CI has not validated the repair. In run 40472126654, ideas-to-implement timed out waiting for the full-list locator at index 32; release-notes resolved index 63 to the panel's data-row="inspection" button, then lost it during scrolling and timed out waiting for that index. Using the full list avoids visibility alone shifting indices, but DOM changes can still invalidate the ordinal.

The same run also reported stale keys in review-a-fix after Zoom out (Previous retained ArrowLeft until repaint), and an unchanged-write finding in deck (children of div.lf-fp-on-list). I have not established whether those failures are inherited. The separate review run was refused by Tend's PR creation rate limit before posting a review.

The active tend-land repair run 40473546265 owns the follow-up. I am leaving the branch unchanged so that run can repair and verify this head without concurrent edits.

Choose, scroll and measure a candidate in one browser task, then send real pointer input and type through actual focus. The sweep no longer relies on a detached handle or an ordinal that a panel repaint can remove. It keeps forty seeded input steps and the existing key and browser-watch assertions.

The previous locator driver reproduced a 120-second timeout on ideas-to-implement. Five focused cases complete the key comparisons with coordinate input after merging current main. Browser teardown still reports independent writes tracked in #4581 and #4582; the file-editor diagnostic also reproduces with main’s unmodified driver.

Refs #4256
@leaf-agent leaf-agent changed the title fix: resolve replacement controls in the stale-key sweep fix: avoid stale targets in the keyboard attribute sweep Oct 28, 2026
@leaf-agent

Copy link
Copy Markdown
Collaborator Author

Pushed the Ruff formatting correction as 0c913b0. The pinned Ruff 0.16.1 formatter reproduced the failure on the previous head; formatting and lint checks now pass for the modal-watch test file. This increment changes formatting only.

CI run 40672052168 on a6c6bc4 also reported six stale-key sweep teardown errors: answer-row resizing on code-comparison and ship-review, a redundant margin-preview style write on github-discoveries, equivalent On me children on release-notes and deck (#4582), and file-editor availability writes (#4581). The modal words-loss diagnostic from the preceding run did not recur. I have not confirmed whether the remaining failures are pre-existing.

With await_ci: false, this push hands the new head to its triggered review and CI landing follow-up. Those runs retain the unresolved diagnostics above; this push does not establish readiness to merge.

The coordinate sweep exposes answer lists that grow for several flex lines. The swap watch treated the tallest arrival as if it sized the whole list. Require the taller place to fit that occupant plus its own padding and borders before reporting a single-line sizing fault. Keep positive cases on wrapping-enabled rows, and exercise list growth and contraction.
A pointer click with no travel wrote translate: 0px and removed it in the same task. Keep zero displacement without an inline translation, avoiding redundant style writes on both the margin card and composer. Extend the shared drag handoff cases to cover a no-travel press while retaining the drag assertions.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The merge verdict remains withheld because the PR description explicitly says this is not ready to merge: the release-notes, deck and file-editor sweep diagnostics remain unresolved (#4582, #4581). That stated readiness hold must be cleared before landing this repair.

Key each list separator by its group rather than its first item, so undoing the first Done card does not move a surviving card out and back during Lit reconciliation. Offline file reads refuse immediately; do not expose a transient busy state for those reads. Preserve live read/save serialization and the captured editor refusal.

The release-notes and file-editor sweeps reproduced the write-watch findings before the changes. Release-notes, deck and file-editor pass afterward with watches active. The added offline-editor regression fails before and passes after; the live save/retry regression passes. pnpm run check passes all 695 runtime and 85 Worker tests. Rebuild the committed kernel.
@leaf-agent
leaf-agent merged commit 302c2ff into main Oct 28, 2026
5 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-4256 branch October 28, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant