Skip to content

feat(ECX-579): add Drawer component and wide Constrain variant - #7220

Merged
hevele-moda merged 4 commits into
mainfrom
ECX-579
Aug 17, 2026
Merged

feat(ECX-579): add Drawer component and wide Constrain variant#7220
hevele-moda merged 4 commits into
mainfrom
ECX-579

Conversation

@hevele-moda

Copy link
Copy Markdown
Contributor

Ref ECX-579.

Adds two small, additive primitives needed for ECX-579's larger-PLP-image A/B test in discovery:

  • Drawer: a persistent, non-modal panel that pushes adjacent layout over when open (no backdrop/portal/focus-trap), for the collapsible desktop filter panel.
  • Constrain: new optional size?: 'medium' | 'wide' prop (default 'medium', fully backward-compatible) for the wider PLP layout.

Also includes an unrelated fix: npm run storybook was broken for everyone (ignore-not-found-export-webpack-plugin deep-imports a webpack internal path that moved in newer webpack 5 releases) — replaced it with a small local plugin with equivalent behavior.

Adds a persistent, non-modal drawer primitive that pushes adjacent
layout over instead of overlaying it, for the ECX-579 larger-PLP-image
A/B test's collapsible filter panel.
Adds an optional size prop ('medium' | 'wide', default 'medium') so
consumers can opt into a wider, uncapped layout width without changing
the default behavior for existing usages. Needed for ECX-579's larger
PLP product images.
…plugin

ignore-not-found-export-webpack-plugin deep-imports
webpack/lib/ModuleDependencyWarning, which moved under lib/errors/ in
newer webpack 5 releases, breaking `npm run storybook` entirely.
Replaces it with a small local plugin that achieves the same warning
filtering via warning.constructor.name, with no dependency on
webpack's internal file layout.
@hevele-moda
hevele-moda requested a review from a team as a code owner August 17, 2026 11:43
Copilot AI lite review requested due to automatic review settings August 17, 2026 11:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds new UI primitives to support ECX-579’s larger-PLP-image experiment and unblocks local Storybook by replacing an unmaintained webpack warnings plugin.

Changes:

  • Introduces a new Drawer component (non-modal, layout-pushing panel) with styles, tests, and a Storybook story.
  • Extends Constrain with an additive size?: 'medium' | 'wide' prop and corresponding styling.
  • Replaces ignore-not-found-export-webpack-plugin with a local Storybook webpack plugin to filter “export was not found” warnings.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/components/index.ts Re-exports Drawer from the components barrel.
src/components/Drawer/index.ts Adds Drawer module barrel export.
src/components/Drawer/Drawer.tsx Implements the Drawer component markup and class toggling.
src/components/Drawer/Drawer.test.tsx Adds unit tests for child rendering and open/closed class behavior.
src/components/Drawer/Drawer.stories.tsx Adds a Storybook example demonstrating layout push behavior.
src/components/Drawer/Drawer.scss Adds width/transition-based drawer styling.
src/components/Constrain/Constrain.tsx Adds size prop and wide variant class toggle.
src/components/Constrain/Constrain.scss Adds Constrain--wide styling.
package.json Removes the unmaintained Storybook webpack warning plugin dependency.
package-lock.json Removes the same dependency from the lockfile.
.storybook/main.js Switches Storybook config to use the new local warnings plugin.
.storybook/ignoreNotFoundExportWarningsPlugin.js Implements local plugin to filter “export was not found” warnings.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/components/Drawer/Drawer.scss
Comment thread src/components/Drawer/Drawer.test.tsx
- Hide the drawer's contents from focus and assistive tech while
  closed (visibility: hidden, delayed on close so the width transition
  still animates visibly, immediate on open).
- Assert on a stable data-testid instead of DOM traversal in the test.
Copilot AI review requested due to automatic review settings August 17, 2026 11:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated no new comments.

Suppressed comments (1)

src/components/Constrain/Constrain.tsx:18

  • The new size prop changes the rendered CSS class (Constrain--wide), but the existing Constrain test only checks that children render. Since this file already has a test suite, it would be good to add a unit test asserting (a) default size does not add Constrain--wide and (b) size="wide" does add it, to prevent regressions in the new API.
  <div
    className={classNames('Constrain', { 'Constrain--wide': size === 'wide' }, className)}
    {...rest}
  >

@hevele-moda
hevele-moda merged commit 7fae603 into main Aug 17, 2026
3 checks passed
@hevele-moda
hevele-moda deleted the ECX-579 branch August 17, 2026 11:55
moda-automation-devops pushed a commit that referenced this pull request Aug 17, 2026
# [21.14.0](21.13.0...21.14.0) (2026-08-17)

### Features

* **ECX-579:** add Drawer component and wide Constrain variant ([#7220](#7220)) ([7fae603](7fae603))
@moda-automation-ci

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 21.14.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants