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

Improvements for predefined filters #243

Closed
4 tasks done
variar opened this issue Jan 20, 2021 · 13 comments
Closed
4 tasks done

Improvements for predefined filters #243

variar opened this issue Jan 20, 2021 · 13 comments
Assignees
Milestone

Comments

@variar
Copy link
Owner

variar commented Jan 20, 2021

Some ideas

  • Add import/export in predefined filters dialog
  • Add context menu to search input to create predefined filter
  • Add buttons to move filters up and down in predefined filters dialog (as in highlighters)
  • Allow to set individual patterns to "fixed string" mode
@variar variar added this to the 2021.next milestone Jan 20, 2021
@twardakm
Copy link

Hi @variar , I like the ideas you mentioned and I want to contribute to this feature because I heavily use it at work. For now I'll start with:

  • Add import/export in predefined filters dialog.

Cheers!

@variar variar assigned variar and twardakm and unassigned variar Jan 24, 2021
@variar
Copy link
Owner Author

variar commented Jan 24, 2021

Thanks, @twardakm! Improving my daily work scenarios is exactly how I got involved in glogg development. Unfortunately @nickbnf has been inactive for a long time, so no klogg features can be merged upstream.

twardakm added a commit to twardakm/klogg that referenced this issue Jan 31, 2021
twardakm added a commit to twardakm/klogg that referenced this issue Feb 1, 2021
twardakm added a commit to twardakm/klogg that referenced this issue Feb 1, 2021
twardakm added a commit to twardakm/klogg that referenced this issue Feb 1, 2021
@twardakm
Copy link

twardakm commented Feb 1, 2021

@variar I have one question in context of predefined feature. Is there any particular reason why you refactored collection type to:

using Collection = std::unordered_map<QString, QString>;

unordered_map tends to be unordered and it drives me crazy, because I don't have alphabetical order of my filters, which would be preferred way for me.

Thanks!

@variar
Copy link
Owner Author

variar commented Feb 4, 2021

@twardakm my bad, I've overlooked ordering issue. For highlighters manual ordering is important, but for these filters alphabetical should be completely fine. Should be changed to std::map :)

variar pushed a commit that referenced this issue Feb 4, 2021
@variar
Copy link
Owner Author

variar commented Feb 4, 2021

Fixed unorderd_map in 0974b57

twardakm added a commit to twardakm/klogg that referenced this issue Feb 18, 2021
twardakm added a commit to twardakm/klogg that referenced this issue Feb 21, 2021
@redfellow
Copy link

I like the idea of predefined filters, but it would be nice if we had something that's the opposite. So basically, show everything except lines matching filtered value. Perhaps a checkbox to invert a rule?

@variar
Copy link
Owner Author

variar commented Feb 24, 2021

@redfellow inverse checkbox can be helpful. Right now there is no support for such "inverted" filters in klogg internals. I hope to implement it in next release.

@xaljer
Copy link

xaljer commented Mar 6, 2021

predefined filters is a cool feature! I think the simple version of this is the -f option of grep, which can specify patterns in text files.
And i think it's would be better if klogg can also support use a file as predefined filter. Using files as predefined filter could split user data from klogg configuration and compatible with the workflow of grep like tools. Single file is also easy to share.

I know it's quite same with the import/export feature by klogg conf file. But the simple file format of grep can be more general and compatible with different workflow, without depend klogg, and klogg own conf file is suite to support more complex options like specify if case sensitive for every pattern.

@twardakm
Copy link

twardakm commented Mar 6, 2021

Hi @xaljer , your idea seems interesting, it would also fit my workflow, but I want to make sure we understand it the same way.

How I would see such feature is to add an option to specify directory in which there is a number of files, each file specifies one filter, where name of the file is filter name, and content is filter content.

In terms of practical implementation, I think it would be best to implement something similar to Highlighters sets - so you can specify multiple sets of filters, e.g. one set of filters per project you are working on, and for every set you can either add filters manually or specify directory with grep-like pattern files.

Let's wait for @variar opinion, but I like it very much, and would be eager to help with implementation.

@xaljer
Copy link

xaljer commented Mar 7, 2021

Hi @twardakm , yes, we got the same idea here. But I think we can talk more about details.

I think may be we can simplify concepts. We could just say "filter". A filter can be specified by inputting a regex in klogg manually, or specified by a file (could be in any directory).

“specify directory", you said, I think we can understand it as multi-selection of files under a directory, but there is no limitation that files under different directories.
And sorry I am not quit understand you said about "sets of filters". I think klogg could just show predefined filters like currently, and user select one or more of them. If one project use two files, just pick those two filters. I am just worry about group filters may make UI complex.

@twardakm
Copy link

@xaljer , your idea about specifying file per filter makes more sense that mine :)

I will start implementing it once I have some time!

variar pushed a commit that referenced this issue Mar 31, 2021
@variar
Copy link
Owner Author

variar commented Apr 21, 2021

I like the idea of predefined filters, but it would be nice if we had something that's the opposite. So basically, show everything except lines matching filtered value. Perhaps a checkbox to invert a rule?

@redfellow Button to invert match rule is now available in builds >= 21.04.0.886

variar added a commit that referenced this issue Jun 8, 2021
Internal storage for predefined is changed to list-like. That way
ordering can be user-defined and not related to filter names.
variar added a commit that referenced this issue Jun 8, 2021
Predefined filter pattern should be escaped if pattern is representing
fixed string with special characters
@variar variar self-assigned this Jun 8, 2021
@variar variar modified the milestones: 2021.next, 2021.06 Jun 8, 2021
@variar
Copy link
Owner Author

variar commented Jun 10, 2021

Moved ideas about filter patterns in files to separte issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants