Skip to content

Conversation

@ianmcburnie
Copy link
Member

Fixes #219

@ianmcburnie ianmcburnie requested a review from Copilot February 8, 2026 02:15
Copy link

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

Adds documented menu-button-level events for select/change, aligning event listeners with the menu-button widget rather than the underlying menu element.

Changes:

  • Adds a dedicated handler for "makeup-menu-change" and dispatches "makeup-menu-button-change".
  • Dispatches "makeup-menu-button-select" on select and refactors collapse/focus logic into a shared helper.
  • Updates docs example to listen on widget.el for the documented menu-button events.

Reviewed changes

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

File Description
packages/ui/makeup-menu-button/src/index.js Splits change vs select handling, dispatches documented menu-button events, and centralizes collapse behavior.
docs/ui/makeup-menu-button/index.js Updates example listeners to the new menu-button event targets/types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

this.menu.el.removeEventListener("makeup-menu-change", this._onMenuItemChangeListener);
}

// this should maybe be moved to expander as an option callback for after collapse
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

This comment is speculative and not actionable as-is. Consider converting it into a tracked TODO (ideally referencing an issue) or removing it once a decision is made, so the codebase doesn’t accumulate ambiguous guidance.

Suggested change
// this should maybe be moved to expander as an option callback for after collapse
// TODO: Move this logic to Expander as an option callback that runs after collapse.

Copilot uses AI. Check for mistakes.
Comment on lines 86 to 93
_collapseMenuAfterTimeout() {
const widget = this;

setTimeout(function () {
widget._expander.expanded = false;
widget._buttonEl.focus();
}, 150);
}
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

The timeout duration 150 is a magic number and the const widget = this pattern makes the helper harder to read/maintain. Consider extracting the delay into a named constant (e.g., COLLAPSE_DELAY_MS) and using an arrow function in setTimeout so this can be used directly.

Copilot uses AI. Check for mistakes.
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.

makeup-menu-button: Docs mention non-existent custom events

1 participant