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

Add built-in search in code function #1905

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

luizzeroxis
Copy link
Contributor

@luizzeroxis luizzeroxis commented Sep 6, 2024

Description

Added a search in code option (Ctrl+Shift+F or in the Search menu) that's meant to replace the Search.csx script. It's faster to open, has that shortcut, and has all the options in one screen. Related issues: #545, #942, #1814

test3

Caveats

There's definitely improvements to be made

Notes

Mostly copied from Search.csx and ClickableTextOutput, so it's a little messy. Using LoaderDialog sucks, not sure if that should be improved or there should be a new loading bar inside the window itself. That rich text box should probably be a table or list or something. Searches should be cancellable. Also I'm not sure how to deal with all those threads being used, might not be 100% thread-safe.

Copy link

github-actions bot commented Sep 6, 2024

Fix loader dialog not closing when caching is used
Fix result counts
Results actually sorted
Only one window allowed
Focus on textbox when opening
@luizzeroxis luizzeroxis marked this pull request as ready for review September 9, 2024 00:51
@luizzeroxis luizzeroxis deleted the new-search branch September 14, 2024 01:21
@luizzeroxis luizzeroxis restored the new-search branch September 14, 2024 01:23
@luizzeroxis luizzeroxis reopened this Sep 14, 2024
@VladiStep
Copy link
Member

  1. Have you checked the RAM usage for large search results?
  2. Is it possible to save (export) the search results?
  3. What are the advantages of using the table layout instead of text?

@luizzeroxis
Copy link
Contributor Author

@VladiStep

  1. Have you checked the RAM usage for large search results?

Did some quick tests in Visual Studio right now:

Snapshots № 1 is after loading DELTARUNE Chapter 1 & 2 DEMO's data.win, № 2 is after opening the search and getting to a text box, and № 3 is after showing the search results.

  • Searching "test" (419 results)

    • Before
      crop_old_test
    • After
      crop_new_test
  • Searching "a" (160805 results)

    • Before
      crop_old_a
    • After
      crop_new_a
  1. Is it possible to save (export) the search results?

Yes, you can right click and copy all, or select the ones you want to copy. You can paste it in a spreadsheet if you want

  1. What are the advantages of using the table layout instead of text?

The main reason is performance, the text box lagged massively when displaying large amounts of results. Other than that, most software uses a list of some kind when doing this sort of search. Sure, maybe in a grid it repeats too much the code name, but we could add a sort of grouping by that. The full line isn't visible (although you can hover over it to see it in full), but it's probably possible to make each line individually taller and with word wrap, but perhaps that's too cluttered in a grid format. BUT, uh, I just think it looks neater.

@VladiStep
Copy link
Member

Oh, wow, nice!

Copy link
Contributor

@Miepee Miepee left a comment

Choose a reason for hiding this comment

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

no full review yet.

  1. more gui screenshots?
  2. This feels like something that should be mostly implemented in the Lib, not the GUI. Mostly for resusability.

@luizzeroxis
Copy link
Contributor Author

@Miepee

  1. more gui screenshots?

What more do you want me to show? Everything is in that window pretty much.

  1. This feels like something that should be mostly implemented in the Lib, not the GUI. Mostly for resusability.

I don't think there's a lot that can be moved out, unless you want some sort of generic function that searches everything to be used in the CLI, but I don't know exactly how that works. If you're using the command line I imagine you'll want to extract all the code files and search there with regular tools. I think that if and when this ever needs to be reused, do the move it then.

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.

3 participants