Skip to content

feat(button-set): add rename button set feature#189

Merged
kubrickcode merged 1 commit intomainfrom
develop/shlee/188
Nov 30, 2025
Merged

feat(button-set): add rename button set feature#189
kubrickcode merged 1 commit intomainfrom
develop/shlee/188

Conversation

@kubrickcode
Copy link
Owner

Add button set rename functionality

  • Implement RenameSetDialog component and renameButtonSet API
  • Refactor generic updateButtonSet to single-purpose renameButtonSet
  • Auto-sync activeSet when renaming the currently active set
  • Improve accessibility (ARIA role="alert")
  • Add 6 test cases including edge cases

@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 delivers a new feature allowing users to rename their custom button sets. It involves a complete implementation from the user interface, with a new dialog for renaming, to the backend logic, including a dedicated API method and robust error handling. The change also ensures that the active button set is correctly maintained during a rename operation, providing a seamless user experience.

Highlights

  • New Feature: Rename Button Set: Introduced the ability to rename existing button sets through a new UI component and dedicated API.
  • API Refactoring: The generic updateButtonSet API has been refactored into a more specific renameButtonSet API, improving clarity and single responsibility.
  • Active Set Synchronization: The system now automatically updates the active button set if the currently active set is renamed, ensuring consistency.
  • Accessibility Improvements: Enhanced accessibility by adding ARIA role="alert" to relevant UI elements.
  • Comprehensive Testing: Added 6 new test cases, including edge cases, to ensure the robustness of the rename functionality.
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

@kubrickcode kubrickcode linked an issue Nov 30, 2025 that may be closed by this pull request
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 feature to rename button sets, which includes a new API endpoint, a new dialog component, and refactoring to improve code structure. The changes are well-implemented and include comprehensive tests. My review includes a few suggestions to improve test code reusability, adhere to the style guide by removing magic strings, enhance accessibility in the UI, and increase the robustness of the new dialog component.

@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 feature to rename button sets. The implementation is well-structured, including a new RenameSetDialog component, a dedicated renameButtonSet API, and comprehensive test cases. The refactoring from a generic updateButtonSet to a specific renameButtonSet function is a good improvement that aligns with the single responsibility principle. My review includes suggestions to improve test maintainability by reducing code duplication, enhance type safety by using schema validation, and adhere to the project's coding style regarding alphabetical ordering of object keys. Overall, this is a solid contribution.

Comment on lines 384 to 391
const renameData = message.data as { currentName?: string; newName?: string } | undefined;
if (!renameData?.currentName || !renameData?.newName) {
throw new Error(MESSAGES.ERROR.renameRequiresBothNames);
}
const updateResult = await buttonSetManager.updateButtonSet(updateData.id, {
buttons: updateData.buttons,
name: updateData.name,
});
if (!updateResult.success) {
throw new Error(updateResult.error || "Failed to update button set");
const renameResult = await buttonSetManager.renameButtonSet(
renameData.currentName,
renameData.newName
);

Choose a reason for hiding this comment

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

medium

Using as for type casting is unsafe and discouraged by the style guide. 1 Instead of casting, you can use zod for robust validation, which is already used elsewhere in this file. This ensures type safety and makes the code more resilient to changes in the message data structure.

Consider defining a schema for renameData and parsing the message data with it.

        const renameDataSchema = z.object({
          currentName: z.string().min(1),
          newName: z.string(),
        });
        const parseResult = renameDataSchema.safeParse(message.data);
        if (!parseResult.success) {
          throw new Error(MESSAGES.ERROR.renameRequiresBothNames);
        }
        const { currentName, newName } = parseResult.data;
        const renameResult = await buttonSetManager.renameButtonSet(
          currentName,
          newName
        );

Style Guide References

Footnotes

  1. The style guide prohibits unsafe type bypassing methods like as and recommends using type guards or validation.

Add button set rename functionality
- Implement RenameSetDialog component and renameButtonSet API
- Refactor generic updateButtonSet to single-purpose renameButtonSet
- Auto-sync activeSet when renaming the currently active set
- Improve accessibility (ARIA role="alert")
- Add 6 test cases including edge cases
@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 effectively introduces the button set renaming feature, including the necessary backend API changes, a new dialog component, and comprehensive test cases. The refactoring of updateButtonSet into a more focused renameButtonSet function is a good improvement that aligns with the single responsibility principle. My review includes a couple of suggestions to enhance test code maintainability and improve accessibility in the new dialog.

@kubrickcode kubrickcode merged commit 8692516 into main Nov 30, 2025
6 checks passed
@kubrickcode kubrickcode deleted the develop/shlee/188 branch November 30, 2025 10:29
@kubrickcode
Copy link
Owner Author

🎉 This PR is included in version 0.9.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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Button set name editing feature

1 participant