Skip to content

Conversation

@KubrickCode
Copy link
Owner

Settings were lost because Store changes were not auto-saved to VS Code Settings

  • Add queueSave pattern to prevent race conditions on consecutive updates
  • Show vscode.window.showErrorMessage on save failures
  • Throw explicit error when configWriter is missing to prevent silent failures
  • Branch save logic by LOCAL/WORKSPACE/GLOBAL scope

fix #194

@github-actions github-actions bot added the refactor Refactoring code label Dec 2, 2025
@KubrickCode
Copy link
Owner Author

/gemini review

@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 addresses a critical issue where changes made within the application's store were not being automatically saved to VS Code settings, leading to data loss. It refactors the store synchronization logic to establish a robust bidirectional sync, ensuring that any modifications to buttons, button sets, or the active set are consistently persisted to the configured VS Code settings or local storage. The changes include a new queuing mechanism for saves, improved error reporting, and support for different configuration scopes.

Highlights

  • Bidirectional Synchronization: Implemented a comprehensive bidirectional synchronization mechanism between the application's internal store and VS Code settings to prevent data loss and ensure consistency.
  • Robust Save Mechanism: Introduced a queueSave pattern to handle rapid consecutive updates gracefully, preventing race conditions and ensuring data integrity during persistence.
  • Error Handling and User Feedback: Added explicit error handling for save failures, displaying user-friendly error messages via vscode.window.showErrorMessage and throwing errors for missing configWriter in non-local scopes.
  • Configuration Scope Support: The save logic now correctly branches based on the configuration target (LOCAL, WORKSPACE, GLOBAL), ensuring settings are persisted to the appropriate scope.
  • Comprehensive Testing: New test suites have been added to validate the bidirectional sync for buttons, button sets, and active set across different scopes, including tests for circular update prevention and error scenarios.
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.

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 bidirectional synchronization between the application's store and VS Code settings, which is a crucial feature to prevent data loss. The implementation of a queueSave pattern to manage consecutive updates and prevent race conditions is well-executed, and the accompanying tests are thorough, covering various scenarios including error handling and circular dependency prevention. My review includes a few suggestions to enhance the implementation, primarily focusing on resolving a potential race condition in the save logic, improving adherence to the coding style guide, and reducing minor code duplication. Overall, this is a well-structured and important update.

@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 implements bidirectional synchronization between the application's store and VS Code settings, which is a great improvement to prevent data loss. The changes include adding a save queue to handle consecutive updates gracefully, showing error messages on failures, and handling different configuration scopes.

My review focuses on improving adherence to the coding style guide and ensuring robust error handling. I've pointed out a few places where magic strings and numbers can be replaced with constants, and a scenario where a silent failure could occur.

Overall, the implementation is solid and the new tests provide good coverage for the new functionality.

Settings were lost because Store changes were not auto-saved to VS Code Settings

- Add queueSave pattern to prevent race conditions on consecutive updates
- Show vscode.window.showErrorMessage on save failures
- Throw explicit error when configWriter is missing to prevent silent failures
- Branch save logic by LOCAL/WORKSPACE/GLOBAL scope

fix #194
@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 bidirectional synchronization between the application store and VS Code settings, addressing the issue where store changes were not automatically saved. The changes include a queueSave pattern to handle consecutive updates, explicit error handling for missing configWriter, and branching save logic based on the configuration scope (LOCAL/WORKSPACE/GLOBAL). The new tests comprehensively cover the bidirectional sync for buttons, button sets, and active set, as well as circular update prevention and error handling. The dispose method now correctly unsubscribes from store listeners, which is a good improvement for resource management. The implementation generally adheres to the repository's coding conventions, particularly regarding error handling and modularization.

@KubrickCode KubrickCode merged commit 81eac22 into main Dec 2, 2025
1 check passed
@KubrickCode KubrickCode deleted the develop/shlee/194-4 branch December 2, 2025 15:55
@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

2 participants