Skip to content

Conversation

roomote[bot]
Copy link

@roomote roomote bot commented Sep 11, 2025

This PR addresses Issue #7898 by adding a one-click "Apply to All Modes" button in the API configuration selector.

Changes Made

Frontend (UI)

  • Added new "Apply to All Modes" button in the ApiConfigSelector dropdown
  • Implemented confirmation dialog to prevent accidental changes
  • Added comprehensive tests for the new functionality

Backend

  • Added message handler to apply configuration across all built-in and custom modes
  • Ensures configuration is applied to all modes when user confirms

Translations

  • Added all necessary translation keys for the new UI elements

Testing

  • Added unit tests for the new functionality
  • All existing tests pass without regressions
  • Manually tested the feature in the development environment

Screenshots

The new button appears in the bottom bar of the API configuration dropdown, next to the settings button.

Fixes #7898


Important

Adds "Apply to All Modes" button in API configuration with confirmation dialog and backend support for applying configurations to all modes.

  • Frontend (UI):
    • Adds "Apply to All Modes" button in ApiConfigSelector.tsx.
    • Implements confirmation dialog for applying configurations.
    • Updates tests in ApiConfigSelector.spec.tsx to cover new functionality.
  • Backend:
    • Adds applyConfigToAllModes handler in webviewMessageHandler.ts to apply configurations to all modes.
  • Translations:
    • Adds translation keys for new UI elements in common.json and prompts.json.

This description was created by Ellipsis for f7b2952. You can customize this summary. It will automatically update as commits are pushed.

- Added new button in ApiConfigSelector dropdown to apply current config to all modes
- Implemented confirmation dialog to prevent accidental changes
- Added backend handler to apply configuration across all built-in and custom modes
- Added comprehensive tests for the new functionality
- Added all necessary translation keys

Fixes #7898
@roomote roomote bot requested review from mrubens, cte and jr as code owners September 11, 2025 13:50
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Sep 11, 2025
Copy link
Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

I reviewed my own code and found it surprisingly coherent for something I wrote 3 minutes ago.

// Update the webview state
await provider.postStateToWebview()
} catch (error) {
provider.log(
Copy link
Author

Choose a reason for hiding this comment

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

The error handling here could be more specific. Currently catching all errors generically - consider handling specific cases like permission errors or network issues to provide more helpful error messages to users.

const { modes } = await import("../../shared/modes")

// Apply the config to all modes
for (const mode of modes) {
Copy link
Author

Choose a reason for hiding this comment

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

Performance consideration: This iterates through all modes sequentially. For installations with many custom modes, this could be slow. Consider using Promise.all() for parallel processing with proper error handling for individual failures.

@@ -444,4 +452,69 @@ describe("ApiConfigSelector", () => {
// Search value should be maintained
expect(searchInput.value).toBe("Config")
})

test("shows Apply to All Modes button and handles click with confirmation", async () => {
Copy link
Author

Choose a reason for hiding this comment

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

Good test coverage for the happy path! Consider adding edge case tests:

  • What happens when the API configuration update fails?
  • Behavior when there are no modes available
  • Handling of network errors during the operation

These tests would help ensure robustness of the feature.

{t("prompts:apiConfiguration.confirmApplyToAllModes.title")}
</AlertDialogTitle>
<AlertDialogDescription>
{t("prompts:apiConfiguration.confirmApplyToAllModes.description")}
Copy link
Author

Choose a reason for hiding this comment

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

UX enhancement suggestion: The confirmation dialog could show the number of modes that will be affected. This would give users better context about the scope of their action.

For example, you could pass the mode count from the parent component and display: "This will apply the configuration to 12 modes (8 built-in, 4 custom)"

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Sep 11, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Sep 12, 2025
@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PR - Needs Preliminary Review size:L This PR changes 100-499 lines, ignoring generated files.
Projects
Status: PR [Needs Prelim Review]
Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] One-click "Apply current API config to all modes" in chat
2 participants