Skip to content

Conversation

@elianiva
Copy link

@elianiva elianiva commented Oct 4, 2025

Related GitHub Issue

Closes: #8234

Roo Code Task Context (Optional)

Description

This PR adds ability to automatically select the imported mode, making it more obvious if the mode has been successfully imported or not.

Test Procedure

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

Documentation Updates

Additional Notes

Get in Touch

@elianiva


Important

Automatically select the first imported mode after a successful import, updating global state and UI accordingly.

  • Behavior:
    • Automatically selects the first imported mode after a successful import in CustomModesManager and webviewMessageHandler.
    • Updates global state with importedSlugs and switches to the first imported mode.
  • UI:
    • ModesView.tsx updated to handle mode import dialog and switch to the imported mode.
  • Tests:
    • Added tests in CustomModesManager.spec.ts to verify mode import and selection behavior.

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

@elianiva elianiva requested review from cte, jr and mrubens as code owners October 4, 2025 11:22
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. enhancement New feature or request labels Oct 4, 2025
Copy link

@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 found some issues that need attention related to performance and consistency around the new auto-select behavior.

// Import rules files (this also handles cleanup of existing rules folders)
await this.importRulesFiles(importMode, rulesFiles || [], source)

importedSlugs.push(importMode.slug)
Copy link

Choose a reason for hiding this comment

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

[P2] Performance: importModeWithRules performs updateCustomMode inside the loop (each call reads/merges/writes and triggers state refresh). With multiple modes this causes redundant work plus an extra refresh after the loop. Consider batching: write all mode updates in-memory and perform a single write/refresh at the end of the loop to reduce IO and recompute overhead.

// Switch to the first imported mode if available
if (result.importedSlugs && result.importedSlugs.length > 0) {
const firstImportedSlug = result.importedSlugs[0]
await updateGlobalState("mode", firstImportedSlug)
Copy link

Choose a reason for hiding this comment

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

[P3] Consistency: The mode is set both via updateGlobalState("mode", firstImportedSlug) and by emitting importedSlug for the UI to set visualMode. This dual-path selection works but splits responsibility between backend state and frontend UI. Consider driving selection from one path (e.g., only emit a mode change message and rely on postStateToWebview), so side-effects and telemetry remain centralized.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Oct 4, 2025
@elianiva
Copy link
Author

elianiva commented Oct 6, 2025

I incorrectly linked the PR lol so someone else did another implementation, see: #8521
closing

@elianiva elianiva closed this Oct 6, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Oct 6, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Oct 6, 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 Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Gate semantic search until initial indexing completes (pause/skip)

2 participants