Skip to content

Fix(filters): enable 'Filter frames only' toggle when filters configured#10200

Open
prathamesh-patil-5090 wants to merge 1 commit intocvat-ai:developfrom
prathamesh-patil-5090:fix-9956
Open

Fix(filters): enable 'Filter frames only' toggle when filters configured#10200
prathamesh-patil-5090 wants to merge 1 commit intocvat-ai:developfrom
prathamesh-patil-5090:fix-9956

Conversation

@prathamesh-patil-5090
Copy link
Contributor

Add "Filter frames only" option to annotation filters - Issue(#9956)

Motivation and context

  • Problem: Current annotation filters both (a) choose which frames are considered for navigation and (b) which annotations are displayed on the current frame. When reviewing, users often want to jump only to frames that match a condition but still see all annotations on those frames.
  • Goal: Let filters continue to drive frame navigation while optionally showing all annotations on the landed frame.

What we implemented (short)

  • State & action: add annotation.annotations.filterFramesOnly and action SWITCH_FILTER_FRAMES_ONLY (switchFilterFramesOnly()).
  • Behaviour change: fetchAnnotations() uses displayFilters = filterFramesOnly ? [] : filters so display is unfiltered when the flag is ON, navigation still uses the original filters.
  • UI: add a checkbox "Filter frames only" to FiltersModalComponent (disabled when no filters), plus small footer styling.
  • Files touched (high level):
    • cvat-ui/src/actions/annotation-actions.ts
    • cvat-ui/src/reducers/annotation-reducer.ts
    • cvat-ui/src/components/annotation-page/top-bar/filters-modal.tsx
    • cvat-ui/src/components/annotation-page/styles.scss
    • changelog.d/20251204_075011_122prathamesh6002_9956.md

How has this been tested (short)

  • Manual test on local dev: created a task with a test image and labels (Square/Circle/Rectangle), added annotations, applied a label filter, then toggled the checkbox:
    • Checkbox OFF: only annotations matching filter are shown.
    • Checkbox ON: navigation still jumps to frames matching filter, but all annotations on each landed frame are visible.

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment (changelog.d/20251204_075011_122prathamesh6002_9956.md)
  • I have linked related issues

License

  • I submit my code changes under the same MIT License used by this project.

Closes #9956

@prathamesh-patil-5090
Copy link
Contributor Author

@zhiltsov-max check this out

All the fixes are already in place. The implementation is complete with:

✅ Checkbox with proper onChange handler
✅ Visible when isModalConfirmable() returns true (when filter terms are configured)
✅ Keyboard shortcut Shift+F with handler
✅ Styles for the checkbox

@sonarqubecloud
Copy link

@zhiltsov-max
Copy link
Contributor

zhiltsov-max commented Jan 21, 2026

  1. I can see the checkbox working now, but it doesn't seem to do what it says. When enabled, it simply works normally. When disabled, the filter is ignored for frame navigation, but the annotations stay filtered. Have you tested the changes? As an option, we could add 2 selectors - filter frames and filter annotations.
  2. I think, the previous version, where the checkbox was always displayed, was better. In the current version the dialog window gets resized several times during filter configuration, and it's not very obvious that there will be such a button.

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.

An option to filter frames without hiding annotations in UI

2 participants