feat: add :focus-visible and :focus-within support#1771
feat: add :focus-visible and :focus-within support#1771RedZapdos123 wants to merge 3 commits intofb55:masterfrom
Conversation
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
📝 WalkthroughWalkthroughAdded support for two focus-related pseudo-classes— Changes
Sequence Diagram(s)sequenceDiagram
participant Engine as Selector Engine
participant Adapter as Adapter (isFocused / isFocusVisible)
participant DOM as Element Tree
Engine->>Adapter: query isFocusVisible(element)?
Adapter-->>Engine: true / false / undefined
Engine->>DOM: if :focus-within -> getChildren(node)
DOM-->>Engine: child nodes (breadth-first)
Engine->>Adapter: query isFocused(descendant)?
Adapter-->>Engine: true / false / undefined
Engine->>Engine: cacheParentResults(next) -> mark ancestor matches
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
|
✅ Actions performedReview triggered.
|
|
Added the missing docstring for focusWithinPseudo in src/pseudo-selectors/filters.ts to address Docstring Coverage. Validation ReRun:
@coderabbitai review |
|
✅ Actions performedReview triggered.
|
|
I feel the current code changes in the commit are fine, and the CodeRabbit is just being too nitpicky. I have resolved all of the code review comments by CodeRabbit. |
Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
Description:
Verification:
Resolves #1768
The validation screenshot of the tests run, locally:
Summary by CodeRabbit
New Features
Documentation
Tests