Skip to content

Conversation

@shinokada
Copy link
Collaborator

@shinokada shinokada commented Dec 10, 2025

fix: #1876

📑 Description

Move createSingleSelectionContext(multiple) out of the $effect() and call it synchronously during component initialization
This ensures that each Accordion creates its own isolated selection context, even when nested inside other components like Tabs

A change to src/lib/accordion/Accordion.svelte that replaces an asynchronous reactive effect with a synchronous call to createSingleSelectionContext(multiple) during component initialization, affecting initialization order and ensuring the selection context is created immediately.

🔍 PR Type

  • Bug fix
  • Feature
  • Documentation
  • Refactor / Code cleanup
  • Build / Tooling
  • Other (please describe)

🚦 PR Status

  • Draft (work in progress, not ready for review)
  • Ready for review ✅

✅ Checklist

  • My code follows the existing code style
  • I have run pnpm lint && pnpm check && pnpm test:e2e and all tests pass
  • CoderabbitAI review has been completed and actionable suggestions were reviewed
  • I have updated documentation if my changes require it
  • My PR is based on the latest main branch (not the published npm version)
  • I have checked accessibility where applicable (ARIA, keyboard nav, etc.)
  • I have reviewed the rendered component in the browser

🧪 Screenshots / Demos (optional)


⚠️ Breaking Changes (optional)


ℹ️ Additional Information

Summary by CodeRabbit

  • Refactor
    • Optimized accordion component initialization for improved nesting correctness and initialization order.

✏️ Tip: You can customize this high-level summary in your review settings.

… and call it synchronously during component initialization
@vercel
Copy link

vercel bot commented Dec 10, 2025

@shinokada is attempting to deploy a commit to the Themesberg Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 10, 2025

Walkthrough

A change to src/lib/accordion/Accordion.svelte that replaces an asynchronous reactive effect with a synchronous call to createSingleSelectionContext(multiple) during component initialization, affecting initialization order and ensuring the selection context is created immediately.

Changes

Cohort / File(s) Summary
Accordion initialization
src/lib/accordion/Accordion.svelte
Removed $effect wrapper from createSingleSelectionContext(multiple) call and moved it to synchronous initialization context

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Single file modification with straightforward timing change (async → sync)
  • No logic alteration beyond context creation initialization

Possibly related PRs

  • fix 1742 #1746: Addresses related Accordion selection context behavior—fixes nesting/initialization order and context mutation concerns
  • fix: #1741 #1761: Modifies single-selection context initialization and reactive vs. non-reactive context handling
  • fix to exeed max depth" #1748: Changes createSingleSelectionContext behavior; directly related to the function being called synchronously in this PR

Poem

🐰 From async hops to rapid feet,
The Accordion now keeps the beat!
No more delays in initialization's dance,
Context blooms with every chance—
Synchronous snacks for nested cheer! 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly describes the main change: moving createSingleSelectionContext(multiple) out of a $effect() and calling it synchronously, which matches the core change in the Accordion.svelte file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description covers all major sections from the template with adequate detail. Author references issue #1876, clearly explains the technical change, selects Bug fix as PR type, marks status as Ready for review, and completes most checklist items.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@shinokada shinokada merged commit 77e7eea into themesberg:main Dec 11, 2025
1 of 2 checks passed
@shinokada shinokada deleted the fix-accordionitem branch December 28, 2025 17:08
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 do not work inside tabs

1 participant