Fix BarWidget CSS leakage by scoping selectors#35
Open
RedZapdos123 wants to merge 1 commit intokoaning:mainfrom
Open
Fix BarWidget CSS leakage by scoping selectors#35RedZapdos123 wants to merge 1 commit intokoaning:mainfrom
RedZapdos123 wants to merge 1 commit intokoaning:mainfrom
Conversation
Scope BarWidget CSS classes under a widget-specific container and localize control button queries to the widget container. Add regression tests to prevent global selector and document-level query regressions. Closes koaning#26. Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
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.
Description:
Issue #26 reported that BarWidget CSS leaked into other notebook outputs because generic selectors such as .container and label were globally applied.
This PR updates BarWidget styling, and control selection to use widget scoped classes in both source, and bundled JS paths, preserving styling isolation across notebook outputs.
It also adds regression tests that cover selector scoping and container scoped control selection.
Closes #26.
Checklist:
ruff check tests/test_bar_widget_scoping.py.pytest -q tests/test_bar_widget_scoping.py.pytest -q.The validation screenshots of the tests run (include visual test), locally on WSL: