Skip to content

feat: Add search functionality to mode selector popup and reorganize layout #6140

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Jul 23, 2025

BEFORE

image

AFTER

image

Related GitHub Issue

Closes: #6128

Roo Code Task Context (Optional)

This PR was implemented using Roo Code's Issue Fixer mode, which analyzed the GitHub issue requirements and implemented the solution following the technical specifications provided in the issue.

Description

This PR transforms the mode selector popup to include search functionality and reorganizes the layout for better usability. Key implementation details:

Search Implementation:

  • Added fuzzy search using the Fzf library for intelligent mode discovery
  • Search input styled to match the API configuration selector pattern
  • Real-time filtering with case-insensitive matching on mode names, slugs, and descriptions
  • Clear search button (X) for easy reset

Layout Reorganization:

  • Moved marketplace and settings buttons from header to bottom for cleaner hierarchy
  • Converted instruction text to a tooltip with info icon to save space
  • Info icon positioned on the left of "Modes" title for visual balance

Technical Improvements:

  • Consistent spacing aligned with SelectDropdown component patterns
  • Proper React Hook dependency arrays and useCallback optimization
  • All existing functionality preserved with enhanced UX

Test Procedure

Automated Testing:

  • All existing ModeSelector unit tests pass (2/2)
  • All chat component tests pass (174/174)
  • TypeScript compilation successful
  • ESLint passes with no warnings

Manual Testing Steps:

  1. Open VSCode with Roo Code extension
  2. Access mode selector popup
  3. Verify search input appears at top with "Search modes..." placeholder
  4. Type in search box - verify real-time filtering works
  5. Test fuzzy search with partial matches and typos
  6. Click X button to clear search - verify it clears and maintains focus
  7. Verify marketplace and settings buttons work at bottom
  8. Hover info icon next to "Modes" title - verify tooltip shows instruction text
  9. Select different modes - verify all selection functionality works

Cross-platform Testing:

  • Tested on macOS with both light and dark VSCode themes
  • Keyboard navigation and screen reader accessibility maintained

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

Before: Original mode selector with header text and buttons at top
After: New mode selector with search functionality and reorganized layout

The provided before/after screenshots show the transformation from the old layout with instruction text at the top to the new streamlined design with search functionality and improved organization.

Documentation Updates

  • No documentation updates are required.

The changes enhance existing functionality without changing user-facing APIs or requiring new documentation.

Additional Notes

Design Decisions:

  • Used Fzf library for fuzzy search to match existing patterns in SelectDropdown
  • Positioned info icon on left of title for visual balance with button icons on left side
  • Maintained all existing keyboard shortcuts and accessibility features
  • Preserved telemetry tracking and first-time usage indicators

Get in Touch

@roomote


Important

Adds search functionality and reorganizes layout in ModeSelector.tsx, enhancing usability with fuzzy search and UI improvements.

  • Behavior:
    • Adds fuzzy search to ModeSelector.tsx using Fzf library for mode discovery.
    • Real-time filtering with case-insensitive matching on mode names, slugs, and descriptions.
    • Clear search button (X) added for easy reset.
    • Moves marketplace and settings buttons to bottom of the popup.
    • Converts instruction text to a tooltip with an info icon.
  • UI Components:
    • Updates ModeSelector.tsx to include search input and reorganized layout.
    • Adjusts spacing and alignment for consistency with SelectDropdown patterns.
  • Internationalization:
    • Updates various language files (e.g., chat.json in locales/en, locales/es, locales/fr, etc.) to include new strings for search functionality.
  • Technical Improvements:
    • Optimizes React Hook dependency arrays and uses useCallback for performance.
    • Ensures all existing functionality is preserved with enhanced UX.

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

…layout

- Add fuzzy search functionality with Fzf library for better mode discovery
- Move marketplace/settings buttons to bottom of popup for cleaner layout
- Convert instruction text to tooltip with info icon for space efficiency
- Align search input styling with API configuration selector pattern
- Improve spacing consistency throughout the component
- Add 'Search modes...' placeholder text for better UX
- Fix React Hook dependency arrays and useCallback optimization

Resolves #6128
@Copilot Copilot AI review requested due to automatic review settings July 23, 2025 22:24
@hannesrudolph hannesrudolph requested review from mrubens, cte and jr as code owners July 23, 2025 22:24
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. UI/UX UI/UX related or focused labels Jul 23, 2025
Copy link

@Copilot Copilot AI left a 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 enhances the mode selector popup by adding fuzzy search functionality and reorganizing the UI layout for improved usability. The changes include implementing real-time search filtering, moving buttons to the bottom bar, and converting instruction text to a space-saving tooltip.

  • Added fuzzy search with Fzf library for intelligent mode filtering
  • Reorganized layout by moving marketplace/settings buttons from header to bottom
  • Converted instruction text to tooltip with info icon to save vertical space

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 23, 2025
- Replace hardcoded 'Search modes...' placeholder with t('common:ui.search_placeholder')
- Replace settings namespace usage with hardcoded 'No results found' to match SelectDropdown pattern
- Ensures proper internationalization and consistent namespace usage
- Add new modeSelector.searchPlaceholder key to all language files
- Update ModeSelector to use chat:modeSelector.searchPlaceholder instead of generic search placeholder
- Provides more contextual and user-friendly search placeholder text
- Maintains consistency across all 18 supported languages

Co-authored-by: Roo Code Translate Mode
@hannesrudolph hannesrudolph moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Jul 23, 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 Jul 23, 2025
- Added translation key 'modeSelector.noResults' for the hardcoded 'No results found' text
- Added auto-focus functionality to search input when mode selector popover opens
- Updated all language files with appropriate translations
hannesrudolph added a commit that referenced this pull request Jul 24, 2025
- Add search functionality at the top with fuzzy search
- Move settings button to bottom left
- Add title and info icon on bottom right
- Match exact layout and spacing from ModeSelector
- Create new ApiConfigSelector component
- Update ChatTextArea to use new component
- Remove unused imports to fix linting
- Replace requestAnimationFrame with direct state updates for better clarity
- Implement two-tier search: prioritize mode names/slugs over descriptions
- Mode names now always appear before description matches in search results
Copy link
Collaborator

@daniel-lxs daniel-lxs left a comment

Choose a reason for hiding this comment

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

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jul 24, 2025
@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer PR - Needs Review size:L This PR changes 100-499 lines, ignoring generated files. UI/UX UI/UX related or focused
Projects
Status: PR [Needs Review]
Development

Successfully merging this pull request may close these issues.

Add search functionality to mode selector popup and reorganize layout
2 participants