Skip to content

Conversation

NHristov-sap
Copy link
Contributor

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.

@NHristov-sap NHristov-sap requested a review from unazko August 19, 2025 09:58
@unazko unazko requested a review from Copilot August 22, 2025 14:47
Copy link
Contributor

@Copilot Copilot AI left a 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.

Copy link
Contributor

@unazko unazko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@unazko unazko requested a review from tsanislavgatev August 25, 2025 11:57
@tsanislavgatev tsanislavgatev merged commit befeae7 into main Aug 28, 2025
19 of 20 checks passed
@tsanislavgatev tsanislavgatev deleted the BL_dsc_css branch August 28, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants