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

SG-36193 Adds named filter support #171

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

Conversation

pscadding
Copy link
Contributor

@pscadding pscadding commented Sep 16, 2024

Adds support for creating more complex filters shown in the filter menu as a preset filter.
This mimics the web UI behaviour in part, although there is no ability to modify the filters from the UI, only toggle which one is used.

There is a separate PR for the panel app listed below and the changes here to the framework are implemented to allow support for the panel app to work. I don't believe any of the included changes would work against implementing this in other apps like loader2 or breakdown app 2, but there would be further work needed to support those apps such as:

  • saving the state of the active preset filter
  • handling docked filter menu mode.

I did do some work into getting it to work in the loader, and had implemented the state storing but I've removed it due to the loader implementation becoming more work on the loader side.

Panel app support is added here:
shotgunsoftware/tk-multi-shotgunpanel#97

Screenshot 2024-10-01 at 13 38 20

I did look at making the preset buttons larger to match the other filter buttons but this became quite involved and in my opinion added unnecessary complexity for this particular use. From what I could tell I could either adjust the styling on all menu items, or I would need to create an manage a widget that gets applied to the menu so that I could style it individually.

python/filtering/filter_menu.py Outdated Show resolved Hide resolved
python/filtering/filter_menu.py Show resolved Hide resolved
python/filtering/filter_menu.py Outdated Show resolved Hide resolved
@pscadding pscadding marked this pull request as ready for review October 1, 2024 13:38
Copy link
Contributor

@staceyoue staceyoue left a comment

Choose a reason for hiding this comment

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

@pscadding Looks good, but I do have a comment about refactoring how preset filters are handled. Let me know if it makes sense, or if you need any more clarification on it.

python/filtering/filter_menu.py Outdated Show resolved Hide resolved
python/filtering/filter_definition.py Show resolved Hide resolved
python/filtering/filter_menu.py Outdated Show resolved Hide resolved
python/filtering/filter_menu.py Show resolved Hide resolved
Copy link
Contributor

@staceyoue staceyoue left a comment

Choose a reason for hiding this comment

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

After more thought, the preset filters should remain as backend-filters (ideally the framework could handle this use case, but it needs a lot more work to do so).

Other than that, this is looking good, just a couple minor comments.

python/filtering/filter_menu.py Outdated Show resolved Hide resolved
python/filtering/filter_menu.py Outdated Show resolved Hide resolved
@staceyoue staceyoue self-requested a review October 16, 2024 17:09
Copy link
Contributor

@staceyoue staceyoue left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

4 participants