Skip to content

refactor: add zustand-based central state store#213

Merged
kubrickcode merged 2 commits intomainfrom
develop/shlee/194
Dec 2, 2025
Merged

refactor: add zustand-based central state store#213
kubrickcode merged 2 commits intomainfrom
develop/shlee/194

Conversation

@kubrickcode
Copy link
Owner

@kubrickcode kubrickcode commented Dec 2, 2025

  • Add zustand, zundo dependencies
  • Create AppStore (buttons, buttonSets, configTarget, activeSet)
  • Support selective subscription via subscribeWithSelector middleware
  • Provide singleton pattern and reset function for testing

Add one-way Settings → Store sync layer

  • StoreSync class: detect settings changes and auto-update Store
  • Extract resolveButtonsWithFallback utility to eliminate duplicate fallback logic
  • Apply guard flag pattern for future bidirectional sync

fix #194

- Add zustand, zundo dependencies
- Create AppStore (buttons, buttonSets, configTarget, activeSet)
- Support selective subscription via subscribeWithSelector middleware
- Provide singleton pattern and reset function for testing

fix #194
Add one-way Settings → Store sync layer
- StoreSync class: detect settings changes and auto-update Store
- Extract resolveButtonsWithFallback utility to eliminate duplicate fallback logic
- Apply guard flag pattern for future bidirectional sync

fix #194
@github-actions github-actions bot added the refactor Refactoring code label Dec 2, 2025
@kubrickcode kubrickcode changed the title Develop/shlee/194 refactor: add zustand-based central state store Dec 2, 2025
@kubrickcode kubrickcode marked this pull request as ready for review December 2, 2025 13:48
@kubrickcode
Copy link
Owner Author

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a significant and well-executed architectural change by adding a central state store using Zustand. The new AppStore and StoreSync components are well-structured, thoroughly tested, and adhere to the project's coding conventions. The refactoring to extract resolveButtonsWithFallback also improves code modularity. My review includes suggestions to improve the atomicity of state updates for better performance and consistency, and a note on an unused dependency.

@kubrickcode kubrickcode merged commit 0093243 into main Dec 2, 2025
14 checks passed
@kubrickcode kubrickcode deleted the develop/shlee/194 branch December 2, 2025 13:53
@kubrickcode
Copy link
Owner Author

🎉 This PR is included in version 0.10.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactoring code released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

State Management System

1 participant