-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: Add export/import buttons to mode selector popover (#6320) #6323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds export and import functionality directly to the mode selector popover, allowing users to manage modes without leaving their current context. The implementation follows the existing ModesView pattern for consistency.
- Added hover-triggered export buttons for each mode using the Upload icon
- Added an import button to the popover footer that opens an inline dialog
- Implemented state management for tracking export/import operations with loading states
- Add export button for each mode (visible on hover) - Add import button in popover footer matching IconButton styling - Implement import dialog with project/global level selection - Add state management for export/import operations - Handle message responses for export/import results - Ensure perfect vertical alignment with existing buttons Fixes #6320
- Replace raw button with IconButton component for consistency - Add proper error handling with inline error messages - Add aria-label to export button for accessibility - Add unique IDs to radio inputs in import dialog - Add comprehensive test coverage for export/import functionality
- Convert uncontrolled radio inputs to controlled components - Add selectedImportLevel state to track selected import level - Reset import level to default when dialog is closed - Addresses Copilot review feedback about potential state inconsistency
- Change OR (||) to AND (&&) operator for conditional opacity classes - Fixes issue where string operand would always be truthy - Addresses additional Copilot review feedback
5722bd1 to
63fcac7
Compare
- Replace codicon-cloud-download with Download icon to match ModesView - Update Button styling to match other footer buttons - Update tests to check for SVG icon instead of codicon class
…ence - Add check to ensure message event handler only processes relevant messages - Prevents ModeSelector from interfering with integration test message handling - This should fix the intermittent integration test timeouts
daniel-lxs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution! I've reviewed the changes and found that all the previous review comments have been successfully addressed. The implementation looks good overall with just 2 minor suggestions for improvement.
Description
import.export.modes.mp4
Fixes #6320
This PR adds export/import functionality directly to the mode selector popover, allowing users to manage modes without navigating away from their current context.
Changes Made
Added Export Buttons: Each mode in the popover now has an export button that appears on hover
exportModemessage to VSCode backendAdded Import Button: Added an import button in the popover footer
Import Dialog: Implemented inline import dialog matching ModesView pattern
importModemessage to VSCode backendState Management: Added necessary state variables for tracking operations
isExporting: Tracks which mode is being exportedisImporting: Tracks import operation statusshowImportDialog: Controls import dialog visibilityTesting
Verification of Acceptance Criteria
Screenshots/Demo
The import button is now perfectly aligned with the marketplace and settings buttons in the popover footer.
Checklist
Important
Adds export/import buttons to
ModeSelectorpopover, enabling mode management directly from the UI with new state management and tests.ModeSelector.tsx, visible on hover, usingUploadicon.Downloadicon, opens import dialog.importModemessage.isExporting,isImporting,showImportDialogstate variables inModeSelector.tsx.ModeSelector.export-import.spec.tsxfor export/import button visibility, message sending, and dialog behavior.This description was created by
for b48e8c8. You can customize this summary. It will automatically update as commits are pushed.