Repository navigation
fix(octane): tolerate retired focused links during keyed moves - #2088
Merged
trueadm merged 1 commit intoOct 15, 2026
Merged
Conversation
1 task done
trueadm
marked this pull request as ready for review
October 15, 2026 12:52
Contributor
Benchmark report
Compares js-framework: 1k/10k row operationsAll 20 timed operations (20 without a verdict)
All 64 work counters are unchanged. Application bundle size (bytes)
11 other measured values are unchanged. Public-import reachability bundles (bytes)
39 other measured values are unchanged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a commit retires a focused link before reordering later keyed rows, the detached link becomes its own root. Its
hostis a URL string, so treating everygetRootNode()result as a ShadowRoot sends a string tocontains()and throws midway through the commit.Only follow
hostthrough a document fragment, the cross-realm node type of a shadow root. This keeps shadow-tree focus preservation while allowing the later reorder to finish after the previously focused link is gone. No work is added to unfocused moves.Validation
nextbase with only the new regression applied.pnpm syncpnpm test(full suite: CI)pnpm typecheck(full suite: CI)Risk / follow-up
A tiny change in the focus-containment walk, shared by both general keyed commits and renderer-free keyed views. It uses the existing cross-realm node-type convention rather than
instanceof ShadowRoot. Hydration and prepare/commit are unchanged. This is a correctness fix, not a claimed bundle reduction. Independent extraction from #2036; it targetsnext.Provenance
Implementation: Codex task · host
com-79386.Need help on this PR? Tag
@codesmith-botwith what you need.Note
Low Risk
Small guard in shared focus-containment logic for keyed commits; behavior unchanged for normal shadow-root and unfocused moves.
Overview
Fixes a crash during keyed DOM moves when the same update removes a focused link before reordering sibling rows.
moveNativeNodeBeforeno longer treats everygetRootNode()result as a shadow root when walking from the focused element. Detached anchors can be their own root, where.hostis a URL string—passing that intoElement.contains()threw mid-commit. The walk now only follows.hostwhen the root is a document fragment (node type 11), preserving focus detection across nested shadow trees without touching unfocused move paths.Adds a regression test: focus a nav link, then in one update hide the link and reverse keyed list inputs; reorder completes and inputs keep their values.
Reviewed by Cursor Bugbot for commit 4c03238. Bugbot is set up for automated code reviews on this repo. Configure here.