Fix focusmanager index corruption#1760
Conversation
|
Warning Review limit reached
More reviews will be available in 3 minutes and 28 seconds. Learn how PR review limits work. To continue reviewing without waiting, enable usage-based billing in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Fixes a bug in
FocusManagerwhere dynamically registering a new focusable could unexpectedly change the currently focused widget.When the internal focusable list is reordered by
tabIndex,_currentIndexcould become stale and point to a different widget. This change preserves focus identity across registration reordering and adds a regression test covering the scenario.Related Issue
Closes #1759
Which package(s)?
@termuijs/core
Type of Change
type:bug)type:testing)Checklist
needs-starcheck blocks your merge otherwise.bun vitest runbun run buildbun run typecheckCONTRIBUTING.md.type: short description.markDirty()(if your change affects rendering).anytypes without an inline comment explaining why.GSSoC 2026 Participation
https://gssoc.girlscript.org/profile/3652c85d-e890-41f5-a48f-584ed0a7f209Screenshots / Recordings (UI changes)
N/A
Notes for the Reviewer
Reproduction
tabIndex = 10)tabIndex = 20)tabIndex = 5)Before this change:
[C, A, B]_currentIndexremains unchangedBtoAAfter this change:
_currentIndexis updated to track the same focused widgetBA regression test has been added to verify that dynamically registering a focusable that sorts before the currently focused widget does not change focus unexpectedly.