Repository navigation
Conversation
Adds an Images only / Videos only / Both menu to the Gallery titlebar and Image Map header, sharing one per-project setting. Gallery, date-board and image-map endpoints accept an optional media_kind filter applied server-side; omitted keeps both kinds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Gallery and Image Map always showed images and videos together. This adds a media-type filter, Both (default), Images only and Videos only, as a menu in two places that share one setting:
The setting is saved per project with the other Gallery settings, such as sort order.
Backend: an optional
media_kindquery parameter (image|video) on these endpoints:/api/v1/gallery/items/,/items/location,/items/names,/item_names/api/v1/virtual_boards/by_date/{date}/item_names/points,/cluster_labels,/status,/searchand/search_by_imageGallery listings use sparse pages with authoritative totals and absolute positions, so the filter is applied in SQL. Totals, names, pages and location ranks all cover only the requested kind. On the image map,
media_kindoverridesinclude_videos. Cluster cache keys andvisible_hashare computed over the served kinds.Other behavior:
Related Issues / Discussions
None.
QA Instructions
Manual (
pnpm dev:mockininvokeai/frontend/webv2, or against a real backend with images and videos on the same board):Automated:
pnpm check:releaseininvokeai/frontend/webv2passes. That covers lint, all unit and browser tests, architecture performance and build budgets (no baselines re-recorded), project-file journeys and accessibility.pnpm lint && pnpm testininvokeai/frontend/apipass after regeneratingopenapi.jsonandschema.ts.uv tool run ruff@0.11.2 checkandformat --checkpass.uv run --no-sync pytest -n 4: all pass except 3 tests intests/app/routers/test_app_info.py. Those fail on main too whenever a builtinvokeai/frontend/webv2/distis present, because routes added inside the test land after the UI catch-all. Withdistabsent, all 36 tests in that file pass.Screenshots of both menus in dark and light themes, and of the Gallery at 280px and 350px, were checked during development. I can attach them on request.
Review
Findings resolved before opening:
IconRadioMenufrom@platform/ui/Menu, fed by a shared Gallery options definition. This adds no modules or requests to the editor's initial graph.Remaining limitations:
Compatibility / Rollout
media_kindis optional on every endpoint. Omitting it reproduces the previous queries exactly, so webv1 and older clients are unaffected.openapi.jsonandschema.tswere regenerated. The diff is additive.mediaFiltervalue lives in the Gallery widget's persisted values. A missing or unknown value parses to Both.Checklist
What's Newcopy (if doing a release after this PR)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.