Skip to content
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

Trigger full text search when Ctrl + Enter is pressed in note autocomplete #585

Merged
merged 7 commits into from
Nov 20, 2024

Conversation

SiriusXT
Copy link
Contributor

When searching for notes, title search sometimes fails to find the desired note.

This PR enables full-text search directly by pressing Ctrl + Enter.

@eliandoran
Copy link
Contributor

Hi, @SiriusXT .

Could you please provide a little bit more context about this PR?

  1. Where exactly would a user benefit from this feature? For example, the Jump-to-note feature already has a full text search bound to Ctrl+Enter.
  2. We most certainly need to find a way to inform the user about this feature, otherwise there will be no way to tell of its existence.

@SiriusXT
Copy link
Contributor Author

  1. I was also inspired by "Jump to Note," but when typing text into the input field and failing to find the desired note, pressing Ctrl + Enter does not trigger a jump to full-text search. Instead, it opens the "Create New Note" dialog. Currently, the only way to perform a full-text search is by either clicking the "Full-text Search" button with the mouse or moving the focus out of the input field.

  2. Primarily, in a new blank tab or the "Jump to Note" dialog, if the title search doesn't yield the desired note, we can use Ctrl + Enter to quickly jump to full-text search. This avoids the need to copy the search query, open the full-text search page, and paste the query again to perform the search.

  3. Of course, it is also acceptable to limit this feature to the input fields in new tabs and the "Jump to Note" dialog. Listening to all autocomplete input fields (including those in "Insert Note" or "Clone Note") won’t cause negative impact since the listener is only activated by Ctrl + Enter.

  4. The search_placeholder for the input field can be updated from "Search for a note by its name" to "Search for a note by its name, press Ctrl + Enter to jump to full-text search."

@SiriusXT SiriusXT marked this pull request as draft November 17, 2024 03:24
@SiriusXT SiriusXT marked this pull request as ready for review November 17, 2024 04:20
Copy link
Contributor

@eliandoran eliandoran left a comment

Choose a reason for hiding this comment

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

What do you think instead of adding Ctrl+Enter for a full text search to have an entry underneath "Create and link child note 'foo'" that says "Search for 'foo'" (or similar)? I'm afraid altering the placeholder will turn the text longer and harder to interpret. And I don't think it will affect efficiency too much, since it will be arrow down + enter instead of Ctrl + Enter.

@SiriusXT
Copy link
Contributor Author

Placing "Search for 'foo'" below "Create and link child note 'foo'" might confuse users who initially intend to search by name. Therefore, I placed "Search for 'foo'" at the end of the options, as users typically consider full-text search only when a name-based search yields no results. In this case, the "Search for 'foo'" entry appears as they scroll.

Additionally, allowing Ctrl+Enter to trigger the "Search for 'foo'" entry could be a solution, like this:
图片
Of course, it is also fine not to listen for this shortcut key, just a minor suggestion.

@eliandoran
Copy link
Contributor

@SiriusXT , looks perfect now.

I was thinking as a future improvement to the search function, maybe we could add icons to the two special actions? Or even add icons of the notes.

@eliandoran eliandoran merged commit cdf8490 into develop Nov 20, 2024
1 check passed
@eliandoran eliandoran deleted the sirius_patch_2 branch November 20, 2024 16:54
@eliandoran eliandoran changed the title Triggers full text search when Ctrl + Enter is pressed in note_autocomplete. Trigger full text search when Ctrl + Enter is pressed in note autocomplete Nov 20, 2024
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