Skip to content

[WC-3547]: Data Grid 2 Stack top bar in narrow containers - #2389

Open
yordan-st wants to merge 2 commits into
mainfrom
fix/datagrid-narrow-top-bar-stacking
Open

[WC-3547]: Data Grid 2 Stack top bar in narrow containers#2389
yordan-st wants to merge 2 commits into
mainfrom
fix/datagrid-narrow-top-bar-stacking

Conversation

@yordan-st

@yordan-st yordan-st commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Pull request type

Bug fix (non-breaking change which fixes an issue)


Description

_datagrid.scss's top-bar container query targets #{$root}-padding-top, which no element ever carries — the class is widget-datagrid-paging-top. The footer counterpart directly above it is spelled correctly, so this looks like a typo from when the two blocks were written.

Effect: Data Grid 2's top bar has never stacked its content vertically in containers narrower than 500px, while the footer always has. One word changed.

Worth reviewing with care despite the size: because the rule has never applied, fixing it changes narrow-width layout for the first time. Below 500px the top bar now switches to column-reverse and centres its zones, matching the footer's behaviour and the original intent.

Found while investigating WC-3505; split out so Gallery and Data Grid 2 changes stay separately reviewable. Ticket created.

What should be covered while testing?

  1. Place a Data Grid 2 with pagination Above grid and multi selection with Show selection count = Top.
  2. Put it in a container narrower than 500px, or shrink the browser until the grid container crosses that width.
  3. The top bar should stack vertically (pagination above the selection count, column-reverse) with both zones full width and centred — the same way the footer already behaves.
  4. Above 500px, nothing should change from current behaviour.

@yordan-st yordan-st changed the title fix(data-widgets): stack Data Grid 2 top bar in narrow containers [WC-3547] Data Grid 2: Stack top bar in narrow containers Aug 17, 2026
@yordan-st
yordan-st force-pushed the fix/datagrid-narrow-top-bar-stacking branch from ed6cf3f to 22cfe17 Compare August 18, 2026 09:36
@yordan-st
yordan-st marked this pull request as ready for review August 18, 2026 09:36
@yordan-st
yordan-st requested a review from a team as a code owner August 18, 2026 09:36
@github-actions

This comment has been minimized.

@yordan-st yordan-st changed the title [WC-3547] Data Grid 2: Stack top bar in narrow containers [WC-3547]: Data Grid 2 Stack top bar in narrow containers Aug 19, 2026
@yordan-st
yordan-st force-pushed the fix/datagrid-narrow-top-bar-stacking branch from 22cfe17 to 7d4f572 Compare August 20, 2026 08:48
@github-actions

This comment has been minimized.

@yordan-st
yordan-st force-pushed the fix/datagrid-narrow-top-bar-stacking branch 2 times, most recently from 388fca9 to da6ae80 Compare August 21, 2026 13:42
@github-actions

This comment has been minimized.

gjulivan
gjulivan previously approved these changes Aug 31, 2026
The top bar container query targeted $root-padding-top instead of
$root-paging-top, so the narrow-width rule has never applied and the top bar
never stacked below 500px. Its footer counterpart is spelled correctly.
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

AI Code Review

✅ Approved — no issues found


What was reviewed

File Change
packages/modules/data-widgets/src/themesource/datawidgets/web/_datagrid.scss One-character typo fix: #{$root}-padding-top#{$root}-paging-top in the @container widget-datagrid-header narrow-width rule
packages/modules/data-widgets/CHANGELOG.md [Unreleased] entry added under Data Grid 2 / Fixed

Skipped (out of scope): dist/, pnpm-lock.yaml


Positives

  • The fix is surgically minimal — one token changed, nothing else touched.
  • Cross-verified against WidgetTopBar.tsx:15 and Datagrid.editorPreview.tsx:55: the rendered class is widget-datagrid-paging-top, confirming the old selector never matched any element and the new one matches correctly.
  • The footer counterpart (@container widget-datagrid-footer … #{$root}-paging-bottom) is identical in structure, so the fix makes the two blocks symmetric — easy to audit at a glance.
  • CHANGELOG entry is present, user-facing, and free of implementation details, matching the repo convention.
  • PR description is exemplary: explains root cause, the never-applied nature of the old rule, expected behaviour change, and a concrete test plan with exact widget configuration steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants