-
Notifications
You must be signed in to change notification settings - Fork 280
refactor(ui5-dynamic-side-content): replace resize handler with container queries #12054
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…S container queries
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the DynamicSideContent component to replace the existing ResizeHandler-based breakpoint detection with CSS container queries. This modernization enables styling based on the component's container size rather than relying on JavaScript resize handling and CSS class-based span calculations.
Key changes:
- Replaced ResizeHandler with ResizeObserver for breakpoint detection
- Migrated from CSS class-based layout system (ui5-dsc-span-*) to container query-based responsive design
- Updated test logic to verify actual CSS width values instead of CSS class presence
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
packages/fiori/src/DynamicSideContent.ts | Core refactoring from ResizeHandler to ResizeObserver, removed span-based layout logic, added container query support |
packages/fiori/src/themes/DynamicSideContent.css | Complete CSS rewrite using container queries with @container rules for responsive breakpoints |
packages/fiori/src/DynamicSideContentTemplate.tsx | Updated template to use dynamic CSS classes from component |
packages/fiori/test/pages/DynamicSideContent.html | Updated toggle button display logic to use new _isToggleEnabled property |
packages/fiori/cypress/specs/DynamicSideContent.cy.tsx | Modernized tests to check actual CSS width values instead of deprecated span classes |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Currently, every component that has responsive paddings or visualisation based on a specific breakpoint apply class / attribute to the corresponding size and this class / attribute is used to style the component. Usually this class / attribute rely on the component width, where width is observed by resize handler in order to detect changes.
With current PR we want to start to use container queries. Container queries enable applying of styles to an element based on the size of the element's container.