Skip to content

fix(core): show active state on open dropdown button EIX-84 - #2684

Open
alexkaduk wants to merge 3 commits into
mainfrom
feature/EIX-84
Open

fix(core): show active state on open dropdown button EIX-84#2684
alexkaduk wants to merge 3 commits into
mainfrom
feature/EIX-84

Conversation

@alexkaduk

@alexkaduk alexkaduk commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

💡 What is the current behavior?

While a dropdown menu is open, ix-dropdown-button does not keep a lasting active visual state on the trigger. The trigger can look idle even though aria-expanded is true, so the open menu can appear disconnected from its control.

GitHub Issue Number: #1402
Jira: EIX-84

🆕 What is the new behavior?

  • While the dropdown is open (aria-expanded="true"), the inner button’s theme CSS variables are remapped to their --active counterparts (including hover → active) so the trigger keeps the Figma Active look for the whole Expanded state.
  • Label and icon-only triggers are covered; nested usages that compose ix-dropdown-button (e.g. breadcrumb truncate, date picker month/year, split button, tabs overflow) pick up the same behavior.
  • Component tests assert the open trigger background matches the Active button token.

🏁 Checklist

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

  • 🦮 Accessibility (a11y) features were implemented N/A — visual Expanded state only; aria-expanded already present
  • 🗺️ Internationalization (i18n) - no hard coded strings N/A
  • 📲 Responsiveness - components handle viewport changes and content overflow gracefully N/A
  • 📕 Add or update a Storybook story N/A — existing previews sufficient
  • 📄 Documentation was reviewed/updated siemens/ix-docs N/A — docs site will reflect behavior via existing Usage examples; no API docs change
  • 🧪 Unit tests were added/updated and pass (pnpm test) dropdown-button CT updated; pnpm run test.ct -- --grep dropdown-button passed
  • 📸 Visual regression tests were added/updated and pass (Guide) open-state snapshot likely needs update after intentional UI change
  • 🧐 Static code analysis passes (pnpm lint)
  • 🏗️ Successful compilation (pnpm build, changes pushed)

👨‍💻 Help & support

Summary by CodeRabbit

  • Bug Fixes
    • Dropdown buttons now display a clear active visual state while their menus are open.
    • Updated styling applies consistently across supported button variants, including icon-based triggers.
  • Tests
    • Added visual regression coverage to verify expanded-state styling for text and icon dropdown buttons.

@changeset-bot

changeset-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b14eab7

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

@netlify

netlify Bot commented Jul 30, 2026

Copy link
Copy Markdown

Deploy Preview for ix-storybook ready!

Name Link
🔨 Latest commit 80c8159
🔍 Latest deploy log https://app.netlify.com/projects/ix-storybook/deploys/6a71f078126c700008dba8b0
😎 Deploy Preview https://deploy-preview-2684--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.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

ix-dropdown-button now uses active theme styling while expanded. Regression tests cover text and checkbox-icon triggers. A patch changeset documents the update.

Changes

Dropdown Button Active State

Layer / File(s) Summary
Expanded active styling
packages/core/src/components/dropdown-button/dropdown-button.scss, packages/core/src/components/dropdown-button/dropdown-button.vars.scss
Adds scoped dropdown-button tokens and applies active theme variables for supported variants when aria-expanded="true". Updates triangle, border-radius, and focus outline variables.
Expanded active validation
packages/core/src/components/dropdown-button/dropdown-button.ct.ts, .changeset/dropdown-button-expanded-active.md
Adds regression tests for text and checkbox-icon triggers and documents the patch release behavior.

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

Suggested reviewers: dhalimov

🚥 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 change: showing the active state when the dropdown button is open.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/EIX-84

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.

@alexkaduk
alexkaduk marked this pull request as ready for review July 30, 2026 11:25

@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/dropdown-button/dropdown-button.ct.ts`:
- Around line 107-192: Add an axe-based regression test in dropdown-button.ct.ts
that mounts a dropdown-button with a dropdown item, opens it to the expanded
state, and runs the existing accessibility scan against the expanded component.
Assert that the scan reports no violations, reusing the established
regressionTest and axe-test helpers from the file.
🪄 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: fcf9de8d-7b2d-4970-9adf-f6fd0160b723

📥 Commits

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

📒 Files selected for processing (3)
  • .changeset/dropdown-button-expanded-active.md
  • packages/core/src/components/dropdown-button/dropdown-button.ct.ts
  • packages/core/src/components/dropdown-button/dropdown-button.scss

Comment thread packages/core/src/components/dropdown-button/dropdown-button.ct.ts
@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2026

Copy link
Copy Markdown

@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/dropdown-button/dropdown-button.scss`:
- Line 14: Remove the parentheses surrounding the condition in the `@if` rule at
line 14 in the dropdown-button.scss file. The condition `($name != '')` should
be updated to remove the outer parentheses while keeping the condition logic
intact, as required by the scss/at-rule-conditional-no-parentheses linting rule.
🪄 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: 364ba936-eb3e-44f6-a3d2-e506e8d40be2

📥 Commits

Reviewing files that changed from the base of the PR and between cf5a75e and 80c8159.

📒 Files selected for processing (2)
  • packages/core/src/components/dropdown-button/dropdown-button.scss
  • packages/core/src/components/dropdown-button/dropdown-button.vars.scss

@use './dropdown-button.vars' as *;

@mixin triangle($name: '') {
@if ($name != '') {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Remove parentheses from the @if condition.

Stylelint reports scss/at-rule-conditional-no-parentheses at Line 14. This file fails the configured lint rule.

Proposed fix
-  `@if` ($name != '') {
+  `@if` $name != '' {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@if ($name != '') {
`@if` $name != '' {
🧰 Tools
🪛 Stylelint (17.14.1)

[error] 14-14: Unexpected () used to surround statements for @-rules (scss/at-rule-conditional-no-parentheses)

(scss/at-rule-conditional-no-parentheses)

🤖 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/dropdown-button/dropdown-button.scss` at line
14, Remove the parentheses surrounding the condition in the `@if` rule at line 14
in the dropdown-button.scss file. The condition `($name != '')` should be
updated to remove the outer parentheses while keeping the condition logic
intact, as required by the scss/at-rule-conditional-no-parentheses linting rule.

Source: Linters/SAST tools

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