-
Notifications
You must be signed in to change notification settings - Fork 4k
[fix] DataFrame content width horizontal alignment #12682
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
[fix] DataFrame content width horizontal alignment #12682
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
✅ PR preview is ready!
|
|
This change affects the resizing feature for |
📉 Frontend coverage change detectedThe frontend unit test (vitest) coverage has decreased by 0.0000%
✅ Coverage change is within normal range. |
717a75c to
b8f7769
Compare
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 fixes horizontal alignment for DataFrames when using width="content" in containers with horizontal alignment set. DataFrames with content width were previously wrapped in a full-width container that prevented proper horizontal alignment.
Key changes:
- Disabled resize functionality for DataFrames with
width="content"to allow natural flow and respect container alignment - Removed forced full-width styling from element containers for DataFrames and charts with content width
- Updated E2E tests to verify proper horizontal alignment behavior
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
frontend/lib/src/components/widgets/DataFrame/styled-components.ts |
Renamed prop from isInHorizontalLayout to disableResize and updated styling logic |
frontend/lib/src/components/widgets/DataFrame/ReadOnlyGrid.tsx |
Added width prop to support passing width configuration to DataFrame component |
frontend/lib/src/components/widgets/DataFrame/DataFrame.tsx |
Updated resize disable logic to check both horizontal layout and content width settings |
frontend/lib/src/components/elements/ArrowVegaLiteChart/ArrowVegaLiteChart.tsx |
Passed width configuration to ReadOnlyGrid for charts |
frontend/lib/src/components/core/Block/StyledElementContainerLayoutWrapper.tsx |
Removed forced full-width styling for DataFrames and charts with content width |
e2e_playwright/st_layouts_container_alignment.py |
Updated test to include DataFrame with content width in centered container |
frontend/lib/src/components/widgets/DataFrame/styled-components.ts
Outdated
Show resolved
Hide resolved
3b50f4b to
d403970
Compare
Describe your changes
Fixes horizontal alignment for DataFrames when using
width="content"in containers withhorizontal_alignmentset.Changes Made:
width="content"were wrapped in a full-width container because the resize logic needed it to calculate available width. This wrapper prevented proper horizontal alignment.width="content"is used, resize handles are now disabled (similar to horizontal layouts) to prevent resizing beyond the parent container.width="content".Key Implementation:
The resize disable logic now checks both horizontal layout context AND content width setting. This allows DataFrames with content width to flow naturally and respect container alignment while preventing unwanted resizing.
GitHub Issue Link (if applicable)
N/A
Testing Plan
st_layouts_container_alignment.pyto test DataFrame withwidth="content"in centered containerScreenshots/Demos:
E2E test snapshots will show proper horizontal alignment of DataFrames with
width="content"in centered containers.Additional Notes:
This fix aligns DataFrame behavior with other elements that support
width="content"and properly respect container horizontal alignment.Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.