borgbase / vorta

Desktop Backup Client for Borg Backup
https://vorta.borgbase.com
GNU General Public License v3.0
1.98k stars 130 forks source link

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

Open jetchirag opened 1 year ago

jetchirag commented 1 year ago

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:

real-yfprojects commented 1 year ago

starts-with: ends-with:

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

diivi commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

i1sm3ky commented 1 year ago

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

jetchirag commented 1 year ago

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

i1sm3ky commented 1 year ago

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 commented 1 year ago

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.