~ knotless Search/
↑↓ move↵ open⇧↵ all results

grain.social/grain

photography-focused photo sharing platform

grain.social
1 collaborator
0
2

next: More galleries from draws three across, without the gallery itself

Merged
Merged chadtmiller.com asked to merge into feature/hud from grain.social/grain:next/more-galleries

What changes

More galleries from @handle on a gallery's page draws three across at every width (a 320-pixel phone to a wide screen), leaves out the gallery being viewed, and still shows up to six others. The view's Covers gets "min": "sm", "columns": 3, "where": { "uri": { "$not": "response.gallery.uri" } } and "limit": 6; its more join asks the actor feed for 7, so six remain whether the gallery drawn is among them or not. The heading shows only where the author has another gallery (joins.more.items.1), so an author's only gallery no longer shows an empty "More galleries from".

vendor/hud is HUD at dec44c85b22abbcd01266202b13d8fc088370d38, which adds {"$not": …} to a where and gives Covers a List's where and limit. HUD resolves those on the server, so the web, iOS and Android draw the filtered items with no client changes. The bump from 1e1bd4a also carries what app/shell gained since then: a story's double-tap ♡ in Slides (a like, its heart bursting), a compose field's limits from its record's lexicon (maxBytes, graphemes) and room, tiles first on a screen meeting the bar (--hud-lead), and the sheet and stack fixes of the shell.

Why

Grain's web (web/src/routes/profile/[actor]/gallery/[rkey]/+page.svelte) draws its "More galleries from" as a GalleryGrid, repeat(3, 1fr) at every width, of the actor feed's first page with the current gallery filtered out, capped at 6 (MORE_COUNT). The HUD page drew 4 across at desktop width and included the gallery itself. grain-ios has no "More from" section on a gallery.

How it was checked

  • node next/check-apps.mjs.
  • HUD's just cov (100% lines and functions), including the new tests: Covers with $not and limit (six of seven, both with the current gallery among them and without it), a List with a $not literal, and the view check of $not.
  • A release HUD at that commit (HUD_WORKSPACE=off, HUD_APPS a copy of this branch's next/) and this app built and served against it, on aaronstevenwhite.io's "Orange Railing" (3n2gk44hcsdvf). In Chromium at 1532, 900 and 390 px wide it showed two rows of three, six galleries, and Orange Railing was not among them. The server-drawn HTML has the same six and --columns: 3. "Underpass", which is not among the newest seven, showed the newest six.
  • The iOS app (Debug, iPhone 17 Pro simulator) pointed at that HUD: two rows of three, the current gallery absent.

Shortcomings

hud-next must run HUD dec44c85b22abbcd01266202b13d8fc088370d38 or later before this deploys. An older HUD refuses the view at startup, because it doesn't know $not or Covers' where and limit.

Approved

The view change in next/views/grain-gallery-view.json does what the body says. The more join asks for 7, and Covers drops the current gallery with $not and shows at most 6, three across at every width. The heading now shows only when joins.more.items.1 exists, so an author with a single gallery gets no empty "More galleries from". Seven then six gives six whether or not the current gallery is in the newest seven. Covers takes min, columns, where and limit as the body describes.

I did not run anything. The checks are your own manual verification, and I found nothing wrong in the diff.

  • Vendor bump is wider than the body says. vendor/hud moves from 1e1bd4ab to dec44c85, and that brings more than $not and Covers where and limit. The diff also carries a Slides double-tap like and heart burst, maxBytes limits and room in compose fields, and --hud-lead negative top margins for bleeding tiles and images. The where and limit resolution is server-side, so none of it appears in the vendored diff. I saw no conflict with this view. The --hud-lead margin only matters when tiles come first on a screen, and the "More" tiles do not. Consider naming these in the body so the deploy note covers everything hud-next has to take.
  • Deploy order. The body already says hud-next must run dec44c85 or later first. An older HUD refuses the view at startup, and the deploy then rolls back.

Named the rest of what the vendor bump from 1e1bd4a carries in the body: Slides' double-tap ♡, compose limits and room, --hud-lead, and the shell's sheet and stack fixes. The deploy order (hud-next at dec44c85 or later first) is in Shortcomings.

Merged as f4d51ea
Part of a stack of 2
  1. next: More galleries from draws three across, without the gallery itself Landed as f4d51ea
  2. main