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

Full-text search in whiteboard #6066

Open
sojusnik opened this issue Jan 4, 2023 · 8 comments
Open

Full-text search in whiteboard #6066

sojusnik opened this issue Jan 4, 2023 · 8 comments

Comments

@sojusnik
Copy link

sojusnik commented Jan 4, 2023

With huge and text-heavy whiteboards, you sometimes forget where a certain piece of text is located. In such situations, a full-text search would come to the rescue.

To initiate the text search, we could use the default keyboard shortcut in browsers (ctrl+f) or a dedicated button near the zoom and undo/redo buttons. When the text is found, the corresponding text field on the whiteboard should be centred (like shift+2 does).

To be sure, I'm not proposing to have a search function to search for saved whiteboards (by their title and description) in Excalidraw Plus, rather I'm speaking about the ability to search for text within an individual whiteboard, when editing it. Although, a global text search in the Excalidraw Plus interface for all saved whiteboards, showing the found text as a snippet for context, would be handy as well.

Edit: Somehow I overlooked similar requests, linking them here for the sake of overview:
#5435
#3826

@7flash
Copy link
Contributor

7flash commented Jan 5, 2023

I have implemented temporary solution for myself by syncing all the elements from all my documents into local database, then using LyraSearch to find relevant elements and then loading chosen document at needed position from database into active canvas.

@sojusnik
Copy link
Author

sojusnik commented Jan 5, 2023

@7flash Sounds interesting, but I'm afraid that your current workaround is too complicated for the use case of a normal Excalidraw user.

@sojusnik
Copy link
Author

sojusnik commented Apr 7, 2023

@zsviczian from https://github.com/zsviczian/obsidian-excalidraw-plugin did an awesome work implementing basic search functionality by means of custom tools. Huge thanks for that!

I wonder if this feature could be transferred to Excalidraw as well, since on large whiteboards you might easily forget where you've mentioned certain things and a search function would come very handy in such situations.

The current search implementation in the Obsidian plugin shows all results at once, which can be overwhelming on bigger whiteboards, because all the results are so zoomed out to fit on the whole screen, so you can't really see the search results in detail. This could be solved by having a button and/or keyboard shortcut to jump to the next search result, like "ctrl+g" (which is commonly used in other apps for that), which will show only one search result zoomed in (like "shift+2" does now when an object is selected). Another press of "ctrl+g" should jump to the next search result and so on, while "shift+ctrl+g" would jump to the previous search result.

Ideally, a pop-up should show the count of all search results, and when jumping from one result to another this count should change, like from 1/8 to 2/8 and so on.

@7flash
Copy link
Contributor

7flash commented Apr 8, 2023

Indeed, when switching in between search results, it should zoom into each one. Also particular result might be a very long text, and in this case it's important highlight the exact match line and column.

In my implementation, it's actually adding two temporary text elements ">" and "<" at the position of match. What do you think could be better highlighing solution?

Also, in my case, search is triggered by selecting any text element and pressing search hotkey, that triggers search across elements content of selected element as a search phrase. Do you think it's viable alternative to normally entering search phrase to input field?

@sojusnik
Copy link
Author

sojusnik commented Apr 8, 2023

In my implementation, it's actually adding two temporary text elements ">" and "<" at the position of match. What do you think could be better highlighing solution?

Maybe just a simple yellow overlay would be enough, something like:
grafik

Also, in my case, search is triggered by selecting any text element and pressing search hotkey, that triggers search across elements content of selected element as a search phrase. Do you think it's viable alternative to normally entering search phrase to input field?

I think both are valid and useful ways to search, i.e. either press a hotkey and then type your search query or select one or several words in a text element and then press the hotkey to initiate the search (if I understood you correctly).

@7flash
Copy link
Contributor

7flash commented Apr 8, 2023

Yeah that makes. In my implementation though there is no search text field at all. Just type a search query as a new text element, select it and press hotkey.

@7flash
Copy link
Contributor

7flash commented Apr 8, 2023

Which makes sense in the context of another feature I was building, - Command Palletes, inspired by AoE4 hotkeys. I found it convenient to apply different commands such as search or OpenAI query directly to selected elements with hotkeys.

@7flash
Copy link
Contributor

7flash commented Jan 23, 2024

Currently, I am doing vector search over OCR texts of all images on the canvas, saved in sqlite-vss

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

No branches or pull requests

2 participants