Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Sep 3, 2025

Implements Cmd+F (Mac) and Ctrl+F (Windows/Linux) keyboard shortcuts to focus the search field in the extension popup, improving user experience and accessibility.

Changes Made

SearchBox Component

  • Converted to forwardRef component with useImperativeHandle to expose a focus() method
  • Added input ref for programmatic focus control
  • Maintained all existing styling and functionality

MainScreen Component

  • Added keyboard event listener for Cmd+F/Ctrl+F detection
  • Integrated ref to SearchBox for focus control
  • Added support for focus requests from detail view transitions

IndexPopup Component

  • Added global keyboard handler for detail view scenario
  • When in detail view, Cmd+F navigates back to main screen and focuses search
  • Coordinates focus timing to ensure smooth transitions

Behavior

  • Main screen: Cmd+F/Ctrl+F immediately focuses the search input
  • Detail view: Cmd+F/Ctrl+F returns to main screen and focuses search
  • Cross-platform: Works on Mac (Cmd+F) and Windows/Linux (Ctrl+F)
  • Non-intrusive: Prevents browser's default search dialog from appearing

Screenshots

Before pressing Cmd+F:
Before Cmd+F

After pressing Cmd+F and typing:
After Cmd+F

The search field becomes focused with a blue border and users can immediately start typing their search query.

Fixes the requirement to focus the search field when pressing Cmd+F in the UI.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Copilot Copilot AI changed the title [WIP] Focus Search Field on Cmd + F Key Press in UI Add Cmd+F keyboard shortcut to focus search field Sep 3, 2025
@Copilot Copilot AI requested a review from timrogers September 3, 2025 17:48
Copilot finished work on behalf of timrogers September 3, 2025 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants