feat(web): galleries grid view with cover thumbnails - #719
Conversation
Refine the workspace galleries tab so gallery contents are scannable at a glance instead of a text-only table. - Grid view (default) with a per-gallery cover thumbnail, plus a Grid/List toggle that persists via ?view= and localStorage (workspace-galleries-view). Covers reuse media-load's bindMediaFallbacks, so a 404'd cover degrades to a glyph tile (handles the already-failed/cached case a plain error listener misses); empty and non-image-cover galleries show the same glyph. - API: the enriched galleries list (/v1/workspaces/:ws/galleries) gains an additive previewUrl per gallery — the cover resolved from cover_item_id, else the first item, built purely from the object key (no extra R2 reads), still images only. Two batch helpers (firstItemKeyForGalleries, itemKeysByIds) avoid an N+1. The cheaper bearer projection is untouched. - Trim the byline to "Ordered sets of media behind one public link." - Move the "Working with galleries" CLI help into a new /docs/galleries page, linked from the rail tip; drop the inline details block. - Hide the rail's quick-actions on this tab.
|
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (2)
🚫 Excluded labels (none allowed) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
uploads-api | 2858c5d | Commit Preview URL Branch Preview URL |
Aug 20 2026, 07:19 PM |
The /me/workspaces/:name/galleries exact-shape assertion in me.test.ts predates the additive previewUrl field; expect it (null for the no-item gallery).
What
Refines the workspace Galleries tab so a gallery's contents are scannable at a glance instead of a text-only table.
?view=andlocalStorage(workspace-galleries-view.ts, sibling of the files tab'sworkspace-files-view.ts). The old table is still available in List view, unchanged.media-load.ts(bindMediaFallbacks) wiring — a cover whose bytes 404 degrades to a glyph tile, including the already-failed/cached case a plainerrorlistener misses. Empty galleries and non-image covers show the same glyph.GET /v1/workspaces/:ws/galleries) gains an additivepreviewUrlper gallery — the cover resolved fromcover_item_id, else the first item, built purely from the object key (no extra R2 reads), still images only. Two batch helpers (firstItemKeyForGalleries,itemKeysByIds) avoid an N+1. The cheaper bearergallerySummaryprojection is untouched, andGalleryListSummaryDtostays a strict additive superset.Ordered sets of media behind one public link, linkable to a pull request or issue.→Ordered sets of media behind one public link./docs/galleriespage, linked from the rail tip; wired into the docs nav, sitemap,llms.txt/llms-full.txt, docs hub, and prev/next nav.showQuickActions={false}), matching the screenshots tab.Why
The text table made it hard to tell galleries apart. A cover thumbnail per gallery is the fastest way to answer "what's in this one," which is what the grid gives.
Notes on scope / altitude
previewUrldeliberately skips video-poster resolution on the list path (glyph tile for video covers) to keep it head-free; adding posters later is strictly additive (nullable field, client already degrades).workspace-galleries-view.tsis kept as a sibling ofworkspace-files-view.tsrather than folding both into a shared factory — flagged in review as a possible future refactor, deferred to avoid churning the shipped files tab + its tests.@uploads/apiand@uploads/web, both on the changesetsignorelist.Testing
routes-workspace-galleries— addedpreviewUrlcases (cover resolution, empty →null, non-image/video cover skipped).workspace-uigrid/toggle/cover-fallback render tests; newworkspace-galleries-viewresolver suite.?view=, list view intact, the media-load glyph fallback flippingdata-failed+ revealing the glyph on a failed cover, the tip's/docs/gallerieslink, and Quick Actions removed.oxfmt,oxlint,astro check,changeset:lintall clean.