Skip to content

js: Migrate dialog, snackbar, and stack menu from MDC to MWC - #238

Open
amotl wants to merge 19 commits into
mainfrom
material-web
Open

amotl wants to merge 19 commits into
mainfrom
material-web

Conversation

@amotl

@amotl amotl commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

About

Migrate a few elements to material-web, an implementation of Material Design 3.

References

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary by CodeRabbit

  • User Interface
    • Updated dialogs, notifications, and stack menus to Material Design components while retaining their existing actions and labels.
    • Stack menus open from their button, adapt to narrow screens, and return focus to the button when closed.
    • Dialogs provide consistent confirm, cancel, and close behavior.
  • Bug Fixes
    • Reopening a notification closes the previous one first, and message length determines how long notifications remain visible.
    • Improved handling of repeated dialog requests and dialogs closed without confirmation.

Walkthrough

This change replaces MDC dialogs, snackbars, and stack menus with Material Web components. It updates component behavior, styles, dependencies, webpack rules, and UI tests.

Changes

Material Web UI migration

Layer / File(s) Summary
Material Web build support
package.json, webpack.config.js, patzilla-ui/navigator/app/results/results-header.js
Dependencies now use @material/web, and css-loader is upgraded. Webpack adds a CSS style sheet import path and sets font and image asset module types. Unused ripple setup code was removed.
Dialog and snackbar migration
patzilla-ui/lib/mdc/dialog-*, patzilla-ui/lib/mdc/dialog.js, patzilla-ui/lib/mdc/snackbar.*, patzilla-ui/navigator/style/material.scss, patzilla-ui/navigator/app/ui/ui.js, patzilla-ui/navigator/style/app.css, patzilla-ui/navigator/style/generic.css, tests/ui/menu.spec.js, tests/ui/project.spec.js, tests/ui/basket.spec.js, tests/ui/export.spec.js
Dialogs now use Material Web slots, actions, and closed-event handling. Snackbars now use a Material Web element and retain the message-length timeout thresholds. Styles and dialog and snackbar test selectors were updated.
Stack menu migration
patzilla-ui/navigator/components/stack/*, patzilla-ui/navigator/app/results/results-header.html, patzilla-ui/navigator/style/app.css, tests/ui/ci.ini, tests/ui/stack-menu.spec.js
The stack menu and opener now use Material Web elements. Menu lifecycle, selection handling, anchoring, and reset focus behavior were updated. Styles and test configuration were adjusted, and a test checks repeated Escape-close and focus-return behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Refactor

Sequence Diagram(s)

sequenceDiagram
  participant StackPlugin
  participant StackMenuWidget
  participant md-menu
  participant md-outlined-button
  StackPlugin->>StackMenuWidget: Create menu anchored to opener
  StackMenuWidget->>md-outlined-button: Focus and set aria-expanded
  StackMenuWidget->>md-menu: Call show()
  md-menu-->>StackMenuWidget: Emit closed event
  StackMenuWidget->>md-outlined-button: Reset aria-expanded
Loading

Possibly related issues

  • ip-tools/patzilla issue 176 — The issue asks about migrating away from the archived MDC library. This PR migrates dialogs, snackbars, and stack menus, so it addresses part of that scope.

Suggested labels: javascript

Merge Risk: Minimal · up to 5c74c

This change moves dialogs, snackbars and the stack menu to Material Web components. Earlier findings on focus handling and test configuration have been addressed, and no unresolved defects remain from this review.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the three migrated components (dialog, snackbar, stack menu) and the change from MDC to MWC (Material Web). The raw summary confirms these are the main changes: dialog.js, snackbar.js,…
Description check Passed The description states the PR migrates a few elements to material-web, an implementation of Material Design 3, and references GH-176. This relates directly to the changeset, which replaces MDC dialog,…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the three migrated components (dialog, snackbar, stack menu) and the change from MDC to MWC (Material Web). The raw summary confirms these are the main changes: dialog.js, snackbar.js, and stack-ui.js/stack-menu.html switch from MDC to Material Web elements. The title is specific and matches the changeset.

Full details: Description check

Explanation

The description states the PR migrates a few elements to material-web, an implementation of Material Design 3, and references GH-176. This relates directly to the changeset, which replaces MDC dialog, snackbar, and menu markup and dependencies with @material/web. The description is brief but on-topic.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit taps the menu wide,
Then watches dialogs change their stride.
A snackbar glows, then closes neat,
The buttons bring focus back to seat.
The burrow’s UI hops to Web!

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 235e445b-4a7b-47bd-9d67-ddf91a8097ca
Commits

Reviewing files that changed from the base of the PR and between 014b15b and 5c74cff.

Files ignored due to path filters: 1

  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing: 2

  • patzilla-ui/navigator/components/stack/stack-ui.js
  • patzilla-ui/navigator/style/app.css

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Recent review details

Context from checks skipped due to timeout: 1

  • GitHub Check: CodeRabbit

Comment thread patzilla-ui/lib/mdc/dialog.js Resolved
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.14%. Comparing base (d59bfcf) to head (5c74cff).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #238   +/-   ##
=======================================
  Coverage   47.14%   47.14%           
=======================================
  Files         118      118           
  Lines       10485    10485           
=======================================
  Hits         4943     4943           
  Misses       5542     5542           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread patzilla-ui/lib/mdc/snackbar.js Resolved
@coderabbitai

This comment was marked as low quality.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Checking this code-generation request.

Comment thread package.json Resolved
@coderabbitai

This comment was marked as low quality.

@coderabbitai

This comment was marked as low quality.

@amotl amotl added the coderabbit-review Tell CodeRabbit to review the patch. label Nov 20, 2026
coderabbitai[bot]

This comment was marked as resolved.

@amotl amotl changed the title js: Migrate from MDC to Material Web js: Migrate dialog, snackbar, and stack menu from MDC to Material Web Nov 21, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Nov 21, 2026
@amotl amotl changed the title js: Migrate dialog, snackbar, and stack menu from MDC to Material Web js: Migrate dialog, snackbar, and stack menu from MDC to MWC Nov 21, 2026
@amotl
amotl marked this pull request as ready for review November 21, 2026 02:05
@amotl amotl linked an issue Nov 21, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coderabbit-review Tell CodeRabbit to review the patch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

js: Migrate away from material-components-web (MDC)

1 participant