Skip to content

refactor(stores): convert StatusBarManager to Store-based architecture#214

Merged
kubrickcode merged 1 commit intomainfrom
develop/shlee/194-2
Dec 2, 2025
Merged

refactor(stores): convert StatusBarManager to Store-based architecture#214
kubrickcode merged 1 commit intomainfrom
develop/shlee/194-2

Conversation

@kubrickcode
Copy link
Owner

Remove configManager, configReader, EventBus dependencies and query state directly from Store to simplify component dependencies

  • Replace EventBus multi-event subscription with single store.subscribe
  • Remove ButtonSetManager dependency (activeSet queried directly from Store)
  • Selector-based subscription triggers refresh only on buttons/activeSet changes
  • Add error handling for subscription callback

fix #194

@github-actions github-actions bot added the refactor Refactoring code label Dec 2, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @kubrickcode, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the StatusBarManager by migrating it to a store-based architecture. This change aims to centralize state management, reduce component coupling, and streamline how the status bar reacts to configuration and button set changes, ultimately making the component more maintainable and predictable.

Highlights

  • Dependency Reduction: The StatusBarManager has been refactored to remove direct dependencies on ConfigManager, ConfigReader, EventBus, and ButtonSetManager, simplifying its internal structure.
  • Store-based Architecture Adoption: The StatusBarManager now directly queries state from a centralized application store (appStore), aligning with a more robust state management pattern.
  • Optimized State Subscription: The previous multi-event subscriptions via EventBus have been replaced with a single store.subscribe call, utilizing a selector to trigger refreshes only when relevant state (buttons or activeSet) changes.
  • Improved Error Handling: Error handling has been added to the store subscription callback to gracefully manage potential issues during button refreshes.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@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 is a great refactoring that converts the StatusBarManager to a store-based architecture, which significantly simplifies its dependencies by removing configManager and EventBus. The change to a selector-based subscription with zustand is a solid improvement for performance and maintainability. The test suite has also been updated effectively to reflect these architectural changes.

I've found a few minor areas for improvement related to code style and test duplication that I've detailed in the comments. Overall, this is a high-quality contribution that improves the codebase.

Remove configManager, configReader, EventBus dependencies and query state directly from Store to simplify component dependencies

- Replace EventBus multi-event subscription with single store.subscribe
- Remove ButtonSetManager dependency (activeSet queried directly from Store)
- Selector-based subscription triggers refresh only on buttons/activeSet changes
- Add error handling for subscription callback

fix #194
@kubrickcode
Copy link
Owner Author

/gemini review

@kubrickcode kubrickcode merged commit f5d2ba4 into main Dec 2, 2025
6 checks passed
@kubrickcode kubrickcode deleted the develop/shlee/194-2 branch December 2, 2025 15:02
@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