Skip to content

fix(core/menu-category): make sure to not close itself during touch i… - #2682

Merged
nuke-ellington merged 4 commits into
mainfrom
ix-2679-fix-menu-category-touch-event
Aug 5, 2026
Merged

fix(core/menu-category): make sure to not close itself during touch i…#2682
nuke-ellington merged 4 commits into
mainfrom
ix-2679-fix-menu-category-touch-event

Conversation

@nuke-ellington

@nuke-ellington nuke-ellington commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

…nteraction

💡 What is the current behavior?

GitHub Issue Number: #

🆕 What is the new behavior?

🏁 Checklist

A pull request can only be merged if all of these conditions are met (where applicable):

  • 🦮 Accessibility (a11y) features were implemented
  • 🗺️ Internationalization (i18n) - no hard coded strings
  • 📲 Responsiveness - components handle viewport changes and content overflow gracefully
  • 📕 Add or update a Storybook story
  • 📄 Documentation was reviewed/updated siemens/ix-docs
  • 🧪 Unit tests were added/updated and pass (pnpm test)
  • 📸 Visual regression tests were added/updated and pass (Guide)
  • 🧐 Static code analysis passes (pnpm lint)
  • 🏗️ Successful compilation (pnpm build, changes pushed)

👨‍💻 Help & support

Summary by CodeRabbit

  • Bug Fixes

    • Fixed menu categories closing unexpectedly during touch interactions.
    • Categories now remain open when receiving their own close event.
    • Improved handling of interactions between multiple menu categories.
  • Improvements

    • Improved type safety for menu category close events by including the category ID.
    • Added accessibility validation to help ensure menu categories remain compliant.

@netlify

netlify Bot commented Jul 29, 2026

Copy link
Copy Markdown

Deploy Preview for ix-storybook ready!

Name Link
🔨 Latest commit 8903822
🔍 Latest deploy log https://app.netlify.com/projects/ix-storybook/deploys/6a7302ab6c7c4b00088cda5c
😎 Deploy Preview https://deploy-preview-2682--ix-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot

changeset-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8903822

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@siemens/ix Patch
@siemens/ix-angular Patch
@siemens/ix-docs Patch
@siemens/ix-react Patch
@siemens/ix-vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@nuke-ellington, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 34 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8cbe1db4-e186-446b-af29-46ddb6a640c2

📥 Commits

Reviewing files that changed from the base of the PR and between 8bb176e and 8903822.

📒 Files selected for processing (2)
  • .changeset/tall-badgers-reply.md
  • packages/core/src/components/menu-category/test/menu-category.ct.ts
📝 Walkthrough

Walkthrough

ix-menu-category now includes its category ID in closeOtherCategories events and ignores events from itself. Public typings, regression tests, and patch release metadata were updated.

Changes

Menu category event fix

Layer / File(s) Summary
Typed close event flow
packages/core/src/components.d.ts, packages/core/src/components/menu-category/menu-category.tsx
The closeOtherCategories event uses a string detail, emits the current category ID, and ignores matching events when hiding the dropdown.
Regression validation and release metadata
packages/core/src/components/menu-category/test/menu-category.ct.ts, .changeset/tall-badgers-reply.md
Tests cover accessibility and self-event handling. Patch release metadata records the fix.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: danielleroux, alexkaduk

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main fix: preventing ix-menu-category from closing itself during touch interaction.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ix-2679-fix-menu-category-touch-event

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/core/src/components/menu-category/test/menu-category.ct.ts`:
- Around line 132-179: Add an accessibility test to the menu-category component
suite using makeAxeBuilder(), covering the mounted menu-category fixture and
asserting that no axe violations are reported. Keep the existing
hydration/render coverage and regression interaction test unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 60444853-17ed-465b-965c-233b5201e0f3

📥 Commits

Reviewing files that changed from the base of the PR and between 60d38b5 and d58a39b.

📒 Files selected for processing (4)
  • .changeset/tall-badgers-reply.md
  • packages/core/src/components.d.ts
  • packages/core/src/components/menu-category/menu-category.tsx
  • packages/core/src/components/menu-category/test/menu-category.ct.ts

@JonaMaiss JonaMaiss self-assigned this Aug 5, 2026
JonaMaiss
JonaMaiss previously approved these changes Aug 5, 2026
@JonaMaiss JonaMaiss removed their assignment Aug 5, 2026

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/core/src/components/menu-category/test/menu-category.ct.ts (1)

148-194: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

Add a companion assertion for the "close other categories" case.

This test confirms that a category ignores its own closeOtherCategories event. It does not confirm that a closeOtherCategories event still closes a different category's dropdown. Add a second category dropdown open, then dispatch the event with the first category's ID, and assert the second category's dropdown closes. Without this companion case, a change that breaks the "close other categories" feature (for example, if the listener always returns early) would not be caught here.

♻️ Proposed test extension
     await page.evaluate((id) => {
       window.dispatchEvent(
         new CustomEvent('closeOtherCategories', {
           detail: id,
           bubbles: true,
           composed: true,
         })
       );
     }, sourceCategoryId);

     await expect(dropdownOne).toBeVisible();
+
+    const categoryTwo = page.locator('ix-menu-category').nth(1);
+    const dropdownTwo = categoryTwo.locator('ix-dropdown');
+    await categoryTwo.hover();
+    await expect(dropdownTwo).toBeVisible();
+
+    await page.evaluate((id) => {
+      window.dispatchEvent(
+        new CustomEvent('closeOtherCategories', {
+          detail: id,
+          bubbles: true,
+          composed: true,
+        })
+      );
+    }, sourceCategoryId);
+
+    await expect(dropdownTwo).not.toBeVisible();
   }
 );
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/core/src/components/menu-category/test/menu-category.ct.ts` around
lines 148 - 194, Add a companion assertion to the existing regression test by
opening Category 2’s dropdown alongside Category 1, dispatching
closeOtherCategories with Category 1’s ID, and asserting Category 1 remains
visible while Category 2’s ix-dropdown closes. Reuse the existing category hover
and event-dispatch flow, locating the second category through the visible
menu-category elements.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@packages/core/src/components/menu-category/test/menu-category.ct.ts`:
- Around line 148-194: Add a companion assertion to the existing regression test
by opening Category 2’s dropdown alongside Category 1, dispatching
closeOtherCategories with Category 1’s ID, and asserting Category 1 remains
visible while Category 2’s ix-dropdown closes. Reuse the existing category hover
and event-dispatch flow, locating the second category through the visible
menu-category elements.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a616c29a-1ed6-4ecd-a1ff-7aa0181c8cf5

📥 Commits

Reviewing files that changed from the base of the PR and between d58a39b and 8bb176e.

📒 Files selected for processing (2)
  • packages/core/src/components.d.ts
  • packages/core/src/components/menu-category/test/menu-category.ct.ts

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.changeset/tall-badgers-reply.md:
- Line 5: Rewrite the changeset summary to describe the user-visible behavior:
ix-menu-category remains open during touch interaction. Remove the
implementation detail about checking the component ID.

In `@packages/core/src/components/menu-category/test/menu-category.ct.ts`:
- Around line 148-195: Extend the regression test around categoryOne and the
closeOtherCategories dispatch to open the second menu category first, capture
its dropdown, and assert it is visible before dispatching sourceCategoryId.
After the event, assert the second category’s dropdown is hidden while
dropdownOne remains visible, covering both receiver-side closing and
source-category preservation.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 16cd1cd3-2b87-4de3-9cc6-4e8b6fc1d125

📥 Commits

Reviewing files that changed from the base of the PR and between 09fa2b6 and 8bb176e.

📒 Files selected for processing (4)
  • .changeset/tall-badgers-reply.md
  • packages/core/src/components.d.ts
  • packages/core/src/components/menu-category/menu-category.tsx
  • packages/core/src/components/menu-category/test/menu-category.ct.ts

Comment thread .changeset/tall-badgers-reply.md Outdated
Comment thread packages/core/src/components/menu-category/test/menu-category.ct.ts
@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

@nuke-ellington nuke-ellington added this to the 5.2.0 milestone Aug 5, 2026
@nuke-ellington
nuke-ellington merged commit aea81f5 into main Aug 5, 2026
19 checks passed
@nuke-ellington
nuke-ellington deleted the ix-2679-fix-menu-category-touch-event branch August 5, 2026 11:26
@github-actions github-actions Bot mentioned this pull request Aug 5, 2026
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.

2 participants