Skip to content

fix(accordion): add default expand icon for AccordionSummary - #556

Merged
sm1990 merged 4 commits into
wso2:mainfrom
ajirthan:fix/514-accordion-expand-icon
Jul 21, 2026
Merged

fix(accordion): add default expand icon for AccordionSummary#556
sm1990 merged 4 commits into
wso2:mainfrom
ajirthan:fix/514-accordion-expand-icon

Conversation

@ajirthan

@ajirthan ajirthan commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Purpose

Accordions previously had no default disclosure icon, so headers looked like static text and were hard to discover as expandable (#514).

This PR:

  • Sets a theme-default expandIcon (ChevronDown) on MuiAccordionSummary, with medium font weight and hover styles for clearer hierarchy
  • Updates Accordion Storybook stories with id / aria-controls, docs notes, an explicit ChevronDown expandIcon story, and a Plus/Minus custom expand-icon story

Related Issues

Related PRs

  • N/A

Checklist

  • Followed the CONTRIBUTING guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
  • Unit tests provided. (Add links if there are any)
  • Storybook stories updated/added (if applicable)

Security checks

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

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

Next review available in: 46 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d4a1629f-a0ad-4654-9365-32c7a8ef931b

📥 Commits

Reviewing files that changed from the base of the PR and between 2c0e9ac and ebbf9a0.

📒 Files selected for processing (2)
  • packages/oxygen-ui/src/styles/OxygenThemeBase.test.tsx
  • packages/oxygen-ui/src/styles/OxygenThemeBase.ts
📝 Walkthrough

Walkthrough

AccordionSummary now has a default ChevronDown icon, medium font weight, and hover styling in the Oxygen theme. Accordion Storybook examples add explicit id and aria-controls attributes, document expand-icon behavior, and introduce examples for explicit and custom icons. The custom example controls expansion state and switches between Plus and Minus icons while disabling default wrapper rotation.

Sequence Diagram(s)

sequenceDiagram
  participant Storybook
  participant OxygenThemeBase
  participant AccordionSummary
  participant ReactState
  participant ExpandIcons
  Storybook->>OxygenThemeBase: Load Accordion theme defaults
  OxygenThemeBase->>AccordionSummary: Set ChevronDown expand icon
  Storybook->>AccordionSummary: Render accessible summary and panel associations
  Storybook->>ReactState: Track custom expansion state
  ReactState->>AccordionSummary: Provide controlled expansion
  AccordionSummary->>ExpandIcons: Render Plus or Minus
Loading

Suggested reviewers: jeradrutnam

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR addresses #514 by adding a default chevron, hover/cursor styling, and ARIA/storybook updates.
Out of Scope Changes check ✅ Passed The added storybook examples and docs are directly tied to the accordion disclosure-icon work.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly matches the main change: adding a default expand icon for AccordionSummary.
Description check ✅ Passed The description follows the template and covers purpose, related issue, checklist, and security checks.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@ajirthan ajirthan changed the title fix(accordion): add default expand icon for AccordionSummary (#514) fix(accordion): add default expand icon for AccordionSummary Jul 15, 2026
@sm1990

sm1990 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

@ajirthan shall we add unit tests for this as well

@ajirthan

Copy link
Copy Markdown
Contributor Author

@ajirthan shall we add unit tests for this as well

Ack.

@ajirthan
ajirthan force-pushed the fix/514-accordion-expand-icon branch from 7b365cb to 2c0e9ac Compare July 20, 2026 08:18

@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/oxygen-ui/src/styles/OxygenThemeBase.ts`:
- Around line 181-187: Update the AccordionSummary `root` styling to target the
nested Typography class for `fontWeight`, using the existing medium typography
value; leave the hover background and cursor rules 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3b0d6601-b98a-49f1-a4be-4a491629578c

📥 Commits

Reviewing files that changed from the base of the PR and between 72f8414 and 2c0e9ac.

📒 Files selected for processing (2)
  • packages/oxygen-ui-docs/stories/Surfaces/Accordion.stories.tsx
  • packages/oxygen-ui/src/styles/OxygenThemeBase.ts

Comment thread packages/oxygen-ui/src/styles/OxygenThemeBase.ts
@ajirthan

Copy link
Copy Markdown
Contributor Author

Added unit tests for the theme-default AccordionSummary expand icon (default / override / null) in packages/oxygen-ui/src/styles/OxygenThemeBase.test.tsx.

@sm1990
sm1990 merged commit a255565 into wso2:main Jul 21, 2026
7 checks passed
@ajirthan
ajirthan deleted the fix/514-accordion-expand-icon branch July 21, 2026 08:59
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.

Accordions doesn't look collapsible

2 participants