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

FR: Search a file in diff and extract view #1674

Open
jetchirag opened this issue Apr 1, 2023 · 12 comments · May be fixed by #1749
Open

FR: Search a file in diff and extract view #1674

jetchirag opened this issue Apr 1, 2023 · 12 comments · May be fixed by #1749
Labels
type:enhancement Improvement of an existing function

Comments

@jetchirag
Copy link
Contributor

The problem

For discussion regarding
https://github.com/borgbase/vorta/wiki/Google-Summer-of-Code-2023-Ideas#search-a-file-in-diff-and-extract-view

TLDR; There's currently no option to filter/search items in diff or extract. This FR aims to add this function.

Requested Solution

Initially proposed GUI:
image

After suggestions from @m3nu and @real-yfprojects, removed the additional filter options as it gets too cluttered.

I too think that adding widgets for all filter options isn't viable. I was thinking of implementing something like the filter syntax for github issues.

New design:
image

and a dropdown which automatically adds supported search syntax.
image

Syntax for search pattern:

  • change-type:
  • starts-with:
  • ends-with:
@jetchirag jetchirag added the type:enhancement Improvement of an existing function label Apr 1, 2023
@real-yfprojects
Copy link
Collaborator

starts-with:
ends-with:

Instead of these options we could support the python regex syntax.

@diivi
Copy link
Contributor

diivi commented Apr 2, 2023

Yes, and an explicit search button instead of the currently implied live reload (or an enter press) would be better UX.
I was thinking of a popup dialog for all extra filters because a big text field for numeric input like size less than doesn't fit well.

A popup for advanced search keeps it simple by default and powerful when needed.

Advanced Search - Where we can have multiple fields together instead of searching by just one field, and changing the field to search again (which does not help cases where multiple filters should be taken into account simultaneously).

Regex support will solve all problems related to names and strings, while the advanced search popup could do this for numeric and complex filters (dates/sizes/etc.)

@real-yfprojects
Copy link
Collaborator

Advanced Search - Where we can have multiple fields together instead of searching by just one field, and changing the field to search again (which does not help cases where multiple filters should be taken into account simultaneously).

The idea was to have a syntax similar to the search feature on github. E.g. change-type:modified myfile size:>1MB

@diivi
Copy link
Contributor

diivi commented Apr 2, 2023

The idea was to have a syntax similar to the search feature on github. E.g. change-type:modified myfile size:>1MB

I think the dialog would be easier to use without referring to documentation (supported keywords) of any kind, but this works as well.

@real-yfprojects
Copy link
Collaborator

I think the dialog would be easier to use without referring to documentation

You are right. Would the dialog be open alongside the diff view while sorting or will there be an apply button that closes it? The dialog could also be used to construct the search syntax and insert it into the search bar.

@diivi
Copy link
Contributor

diivi commented Apr 2, 2023

The dialog could also be used to construct the search syntax and insert it into the search bar.

Yes, will help in changing the values faster.

Would the dialog be open alongside the diff view while sorting or will there be an apply button that closes it?

I personally like clicking buttons or pressing keys more than seeing changes live. So I would prefer an apply button that would close it. This will also solve the cluttering problem as it will just add an Advanced... button to the simple search UI.

Whenever a value is given to the dialog for a particular filter, it would append it to the search bar according to the search syntax, and consecutive changes (probably smaller shifts in value), would be quicker to make.

@i1sm3ky
Copy link
Contributor

i1sm3ky commented Apr 2, 2023

The idea was to have a syntax similar to the search feature on github. E.g. change-type:modified myfile size:>1MB

Just an idea but I think we could also do something like: "change-type: modified size: >1MB" above or below the search bar to see all the applied filters at once, And when hovered over the filter tags it would give a tooltip telling about it. And the user could simply change the filter value or click on the tag to remove or disable it.
Also when typing the filter tag manually it could provide autocomplete which would direct the user towards the correct tags.
I don't know if this could be understood just by words or not but I'll make a mockup as soon as I get free and share it here.

@diivi
Copy link
Contributor

diivi commented Apr 2, 2023

Sounds a bit complex, but yes, maybe a mockup will make your point clearer.

@i1sm3ky
Copy link
Contributor

i1sm3ky commented Apr 2, 2023

I guess yes, I'll get the mockup done as soon as possible.

@jetchirag
Copy link
Contributor Author

If search field already consists filters like change-type:, adding another widget just to show it sounds redundant to me.

@i1sm3ky
Copy link
Contributor

i1sm3ky commented Apr 2, 2023

If search field already consists filters like change-type:, adding another widget just to show it sounds redundant to me.

That's a thing, but the separated view will make it easier to look at all the selected filter tags and edit them, instead of scrolling left-right to find the tag and the value if there are a lot of filter or a long value or attribute.

@real-yfprojects
Copy link
Collaborator

Also when typing the filter tag manually it could provide autocomplete which would direct the user towards the correct tags.

That's a good idea.

@jetchirag jetchirag linked a pull request Jul 11, 2023 that will close this issue
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Improvement of an existing function
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants