Skip to content

Conversation

@ldm0
Copy link
Collaborator

@ldm0 ldm0 commented Dec 21, 2025

No description provided.

Copy link

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 adds the ability to trigger an immediate search (bypassing the debounce delay) when the user presses Enter in the search input field. This improves the user experience by allowing users to explicitly initiate a search without waiting for the debounce timer.

Key Changes:

  • Added an immediate option to the search queue mechanism to bypass debouncing
  • Implemented Enter key event handling to trigger immediate searches
  • Refactored timer cancellation logic to use the cancelPendingSearches function consistently

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
cardinal/src/hooks/useFileSearch.ts Added immediate option to QueueSearchOptions type and implemented logic to bypass debouncing when the flag is set. Refactored to use cancelPendingSearches() instead of directly calling cancelTimer() for consistency.
cardinal/src/App.tsx Added Enter key handler in onSearchInputKeyDown callback to trigger immediate search. Updated dependency array to include new dependencies. Removed redundant cancelPendingSearches() call since resetSearchQuery() already handles it internally.

The implementation looks solid and follows good practices. The immediate search correctly cancels any pending debounced searches before executing, preventing race conditions. The dependency arrays have been properly updated to reflect the new dependencies. No issues were identified in the changed code regions.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ldm0 ldm0 merged commit d46994f into master Dec 22, 2025
15 checks passed
@ldm0 ldm0 deleted the enter_research branch December 22, 2025 16:43
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