Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jul 28, 2025

This PR adds export and import functionality to the mode selector popover, allowing users to export the currently selected mode and import modes directly from the mode selection menu.

Changes Made

  • Added export button (codicon-export) that exports the currently selected mode
  • Added import button (codicon-import) that shows an import dialog with project/global options
  • Added state management for import dialog visibility and importing status
  • Added message handler for importModeResult to handle import completion
  • Reused existing export/import functionality from ModesView component
  • Maintained consistent styling with existing UI elements

Implementation Details

  • The export button uses the existing exportMode message type to trigger mode export
  • The import button displays a dialog similar to the one in ModesView, allowing users to choose between project-level and global imports
  • Both buttons are positioned beside the existing "Mode Settings" button in the popover footer
  • The implementation follows the same patterns used in ModesView for consistency

Testing

  • All existing ModeSelector tests pass
  • Manual testing confirms export and import functionality works as expected

Important

Adds export and import buttons to ModeSelector popover, enabling mode export and import with project/global options.

  • Behavior:
    • Adds export button (codicon-export) to export the current mode using exportMode message type.
    • Adds import button (codicon-import) to show import dialog with project/global options.
    • Handles import completion with importModeResult message handler.
  • State Management:
    • Manages showImportDialog and isImporting states in ModeSelector.
  • UI Changes:
    • Positions new buttons beside "Mode Settings" in popover footer.
    • Import dialog allows selection between project-level and global imports.
  • Testing:
    • All existing ModeSelector tests pass.
    • Manual testing confirms export and import functionality works as expected.

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

- Added export button that exports the currently selected mode
- Added import button that shows import dialog with project/global options
- Added state management for import dialog and importing status
- Added message handler for importModeResult
- Reused existing export/import functionality from ModesView
- Maintained consistent styling with existing UI
@roomote roomote bot requested review from cte, jr and mrubens as code owners July 28, 2025 22:47
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Jul 28, 2025
setOpen(false)
if (!isImporting) {
const selectedLevel = (
document.querySelector(
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using React state to track the selected import level instead of relying on document.querySelector. This will simplify state management and improve testability.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 28, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 28, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 28, 2025
roomote bot pushed a commit that referenced this pull request Jul 28, 2025
- Extract shared ImportModeDialog component to eliminate code duplication between ModeSelector and ModesView
- Add comprehensive test coverage for export/import functionality in ModeSelector
- Implement user-facing error notifications with auto-dismiss for import/export operations
- Refactor ModeSelector by extracting ModeSelectorFooter component and useModeSelectorExportImport hook
- Reduce component complexity and improve maintainability
- Remove unused IconButton import

Fixes all critical issues identified in PR #6318 review
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:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants