Skip to content

[Bug Fix] Accordion: sync docs Stimulus controller with gem - #490

Merged
cirdes merged 1 commit into
mainfrom
fix/accordion-docs-stale-controller
Jul 28, 2026
Merged

[Bug Fix] Accordion: sync docs Stimulus controller with gem#490
cirdes merged 1 commit into
mainfrom
fix/accordion-docs-stale-controller

Conversation

@djalmaaraujo

@djalmaaraujo djalmaaraujo commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Fixes #489

Summary

  • The gem's accordion controller was fixed in 0897b2a to toggle the hidden attribute on the content element in sync with the height animation.
  • docs/app/javascript/controllers/ruby_ui/accordion_controller.js is a separate copy (docs bundles its own JS controllers) that was never updated after that fix, so the live preview at rubyui.com/docs/accordion never opened when clicked.
  • Copied the gem's controller verbatim into the docs copy — confirmed byte-identical with diff.

The Accordion component in the gem itself was already correct; no gem changes needed.

Test plan

  • Reproduced the bug on production (rubyui.com/docs/accordion): clicking a trigger did nothing.
  • diff gem/lib/ruby_ui/accordion/accordion_controller.js docs/app/javascript/controllers/ruby_ui/accordion_controller.js → identical.
  • Rebuilt docs assets (pnpm build) locally in the docs devcontainer, ran the Rails dev server, and manually verified in browser: trigger now opens (content reveals, chevron rotates) and closes (content hides, chevron resets) correctly.

Summary by cubic

Sync the docs accordion Stimulus controller with the gem so accordion previews open and close correctly. Fixes #489.

  • Bug Fixes
    • Replaced the docs controller with the gem version to toggle the hidden attribute in sync with the height animation.
    • Removes hidden before measuring height and re-applies it after the close animation to avoid layout/focus issues.

Written for commit c989ae6. Summary will update on new commits.

Review in cubic

The docs app's copy of the accordion controller was never updated when
the gem fixed hidden-content handling in 0897b2a, so
https://rubyui.com/docs/accordion's own preview never opened — clicking
a trigger did nothing since the content stayed `hidden` regardless of
height animation. The gem component itself was already correct.
@djalmaaraujo
djalmaaraujo requested a review from cirdes as a code owner July 27, 2026 20:01

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 1 file

Re-trigger cubic

@cirdes
cirdes merged commit 3c0f35c into main Jul 28, 2026
8 checks passed
@cirdes
cirdes deleted the fix/accordion-docs-stale-controller branch July 28, 2026 12:47
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.

Accordion preview broken on rubyui.com/docs/accordion

2 participants