From ae569c0f9a458285b912c43f9e2542b411da8315 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Thu, 4 Jun 2026 07:14:15 -0400 Subject: [PATCH] fix(gallery): ruff C408 (dict literal) + panel auto-open on deep-link MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rewrite facets() common/plat_scope as dict literals (C408). Open the refine panel via a watch on hasRefineFilters rather than reading filter state at bar-setup time — the parent applies the URL query in its onMounted, after the bar child has set up, so the initial read was always the default (empty) state. Co-Authored-By: Claude Opus 4.8 (1M context) --- backend/app/services/gallery_service.py | 16 ++++++++-------- .../src/components/gallery/GalleryFilterBar.vue | 11 +++++++---- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/backend/app/services/gallery_service.py b/backend/app/services/gallery_service.py index 5002af8..b5060f3 100644 --- a/backend/app/services/gallery_service.py +++ b/backend/app/services/gallery_service.py @@ -431,10 +431,10 @@ class GalleryService: column predicate on ImageRecord. """ _require_single_filter(tag_ids, post_id, artist_id) - common = dict( - tag_ids=tag_ids, post_id=post_id, - artist_id=artist_id, media_type=media_type, - ) + common = { + "tag_ids": tag_ids, "post_id": post_id, + "artist_id": artist_id, "media_type": media_type, + } # total — the full active filter (the headline result count). total = (await self.session.execute( @@ -448,10 +448,10 @@ class GalleryService: # platforms — scope minus the platform selection. Inner-join # provenance→source and COUNT(DISTINCT image) per platform (a # cross-posted image counts under each of its platforms). - plat_scope = dict( - common, untagged=untagged, no_artist=no_artist, - date_from=date_from, date_to=date_to, - ) + plat_scope = { + **common, "untagged": untagged, "no_artist": no_artist, + "date_from": date_from, "date_to": date_to, + } src = aliased(Source) plat_stmt = ( select(src.platform, func.count(distinct(ImageRecord.id))) diff --git a/frontend/src/components/gallery/GalleryFilterBar.vue b/frontend/src/components/gallery/GalleryFilterBar.vue index 7d17896..a19063f 100644 --- a/frontend/src/components/gallery/GalleryFilterBar.vue +++ b/frontend/src/components/gallery/GalleryFilterBar.vue @@ -79,7 +79,7 @@