Skip to content

Fix v2 gallery not refetching when filter logic operator changes#3840

Merged
gantoine merged 2 commits into
masterfrom
fix/inverted-status-filter-refetch
Jul 20, 2026
Merged

Fix v2 gallery not refetching when filter logic operator changes#3840
gantoine merged 2 commits into
masterfrom
fix/inverted-status-filter-refetch

Conversation

@gantoine

Copy link
Copy Markdown
Member

Description
Explain the changes or enhancements you are proposing with this pull request.

Fixes #3798.

In the v2 gallery, filters expose a logic operator (any / all / none) alongside their selection. The "none" operator inverts a filter, e.g. selecting the "Finished" and "100%" statuses with none should show every ROM that is not in those states.

The refetch watcher in GalleryShell.vue only watched the filter selection arrays (selectedStatuses, selectedGenres, ...), not the per-filter *Logic operators. As a result, toggling a filter to its inverse updated the galleryFilter store but never triggered a refetch. The change only took effect when the selection itself was edited, or after a reload (URL hydration re-runs the initial fetch), which matches the report that the inverse "sometimes needs a reload to trigger".

The fetch layer (galleryRoms) already sends statusesLogic and the other operators to the backend, so the query was correct all along; only the client-side refetch trigger was missing.

Fix: watch all *Logic operators alongside their selections in GalleryShell.vue, so inverting a filter (or switching any/all/none) refetches immediately.

v1's FilterDrawer/Base.vue already emits a refetch on logic-toggle, so this was v2-specific.

AI assistance disclosure: This change was written with AI assistance (Claude Code). The maintainer reviewed the diagnosis and the fix.

Checklist
Please check all that apply.

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR
  • I've added unit tests that cover the changes

Screenshots (if applicable)

🤖 Generated with Claude Code

The v2 gallery refetch watcher in GalleryShell only watched the filter
selection arrays, not the per-filter logic operators (any/all/none).
Toggling a filter to the inverse ("none") updated the store but did not
trigger a refetch, so the results only changed when the selection itself
was edited or after a reload (URL hydration re-runs the initial fetch).

Watch all *Logic operators alongside their selections so inverting a
filter (e.g. statuses -> "none") refetches immediately.

Fixes #3798

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 19, 2026 23:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@greptile-apps

greptile-apps Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR makes v2 gallery results refresh when a filter logic operator changes. The main changes are:

  • Adds all per-filter logic operators as reactive store refs.
  • Watches those operators alongside their selection arrays.
  • Reuses the existing gallery invalidation and metadata fetch flow.

Confidence Score: 5/5

This looks safe to merge.

  • All added fields are reactive store refs.
  • Every watched operator is included in gallery request construction.
  • Existing request guards prevent repeated watcher notifications from starting duplicate metadata fetches.
  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
frontend/src/v2/components/Gallery/GalleryShell.vue Extends the gallery refetch watcher to include every filter logic operator; no actionable bug was found.

Reviews (1): Last reviewed commit: "Fix v2 gallery not refetching when filte..." | Re-trigger Greptile

greptile-apps[bot]
greptile-apps Bot previously approved these changes Jul 19, 2026
@greptile-apps
greptile-apps Bot dismissed their stale review July 20, 2026 00:46

Dismissed because a newer commit was pushed; Greptile will re-review the current head.

@gantoine
gantoine merged commit a62ff66 into master Jul 20, 2026
11 checks passed
@gantoine
gantoine deleted the fix/inverted-status-filter-refetch branch July 20, 2026 00:50
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.

[Bug] Inverted State Filter isn't working

2 participants