next: double-tap favorites stories and galleries, a story has a ♡
MergedThis pull does three things. It makes the comment form a full-width field with a "Sign in to comment" prompt. It adds a ♡ Action to grain-stories and grain-story-archive that writes social.grain.favorite with the story's uri and starts done from viewer.fav. It bumps vendor/hud to 34a6147, which centres the comments sheet and draws the ♡ in the top row. The view JSON matches the existing Action pattern. I found nothing wrong in the vendored changes: the centred sheet, the Escape guard on open dialogs, the signed-out redirect in act, and the tint for a done bar action in HUDKit.
I did not run it, and I did not check that 34a6147 exists on hud-next. The author's checks and the iOS caveat in the body are noted. Merge only once that HUD commit is on hud-next.
Since my approval at 51c4d70, the pull adds "like": "Favorite" to the Slides in grain-stories and grain-story-archive. It also bumps vendor/hud to 55ed487. That bump adds a double-tap that runs the ♡ and bursts a heart where it landed. It does this on web and in HUDKit, and HUDKit's bar now also takes Actions that sit inside a Stack.
The like value matches the ♡ Action's label, "Favorite", in both views. The vendored double-tap only runs the Action when it isn't done yet, so it never un-favorites. The web tap delay applies only when like is set. I found nothing wrong.
Two things remain from the body and are unchanged. The double-tap is new since the body, and the body still lists it as a shortcoming, so it should be updated. Nobody has tried HUDKit's double-tap on a device. I did not run any of it.
Since my approval at 3ab81ef, the pull merges the base and adds a "like": "Favorite" to the Gallery in grain-feed.json and grain-gallery-view.json. A double-tap on a photo then runs the gallery's ♡. In both views a ♡ Action labelled "Favorite" exists (feed line 786, gallery view line 498), so the names match. The base merge is not the pull's own change, and I didn't review it. I read only the two JSON lines. I did not run anything.
The body is still out of date. It lists double-tap as a shortcoming, and the pull now has it for stories and galleries. The body also says nothing about the gallery change. No one has tried HUDKit's double-tap on a device.
Since my approval at d14532d, the pull's own changes look like the vendor/hud bump to d74c7fe and an update to GrainUITests. I read all of the diff from d14532d to the head, and I did not run anything.
- HeartBurst fix: The change in
DoubleTap.swiftfires the burst once on appear. It setsshown = trueinonAppear, withshownas the keyframe trigger, because a non-repeating animator otherwise holds its first value, which is invisible. That reads correctly. I have not seen it on a device. - UI test:
testStoryCommentsnow checks that the ♡ sits between the 💬 and the ⋯, each 44pt apart.testGalleryZoomnow taps the card below the picture, since a double-tap on the picture favorites. Both match the new behaviour. - View JSON diffs: The diff also shows changes to the comment and form views:
maxremoved, Reply and Comment relabelled "Post", and a reply prefilled with the author's handle. It also shows gallery "more" tiles withlimitandwhere. These look like they came in with a base merge rather than from this pull, so I did not review them as the pull's own.
The body is still out of date. It lists double-tap as a shortcoming, and the pull now has it for stories and galleries.
Thanks. I've rewritten the body to cover all of it: the double-tap on stories, feed cards and gallery pages is now under What changes rather than Shortcomings. Galleries are included, with the single-tap rules (the gallery page opens the lightbox after about 250ms, a feed photo opens nothing).
HUDKit's double-tap has now been run on the iOS simulator as a stand-in signed-in viewer whose writes stayed local. That run found one bug: the heart never appeared on iOS. The burst's keyframe animator had repeating: false, which holds its first, invisible frame. HUD d74c7fe (app/shell) plays it once as it appears, and vendor/hud is now at d74c7fe. After that fix, on stories, feed cards and gallery pages, a double-tap favorites with the burst and makes one write. A second double-tap writes nothing, scrolling favorites nothing, and on a gallery page a double-tap does not open the lightbox.
The ♡ sitting between the 💬 and the ⋯ broke testStoryComments's 44pt check, so that test now checks 💬, ♡ and ⋯, each 44pt apart. testGalleryZoom now opens the gallery from its card's title, because a tap on a feed photo opens nothing. hud-next needs d74c7fe before this deploys.
Since my approval at 9a61892, the only change is in testGalleryZoom. It used to tap a fixed offset below the picture. Now it finds the card's title, scrolling the feed up a little at a time until the title shows, and taps that. The title is the first static text just below the ♡ row. It fails with a screenshot if no title shows. This only makes the test less brittle and matches the behaviour I approved. I did not run it. The body's note about the gallery test is still accurate.
5 passed, 2 skipped
- next: double-tap favorites stories and galleries, a story has a ♡
- main
What changes
A story's comments on a wide window open as a sheet one phone-column wide (480px), centred over the story's picture. Grain web does the same: it draws a story in a 420px column, with its comments sheet inside that column. Before, the sheet started at the frame's column (x≈375) and ran to the right edge, over the black and the side of the picture. On a phone it is still the full-width bottom sheet. In the archive (a screen, not the pager) the sheet lines up with the story's column.
Add a comment… is the sheet's full width at every size.
grain-commentsdraws it as a field (Composestyle: "field"), like Grain web's comment input and the gallery's Add a comment…. Signed out it reads "Sign in to comment". It used to be a button-style Compose: a filled pill no wider than 24rem, which is why it stopped short.A story can be favorited. Each story's top row in
grain-storiesandgrain-story-archivehas a ♡ between its 💬 and its ⋯. It writes asocial.grain.favoritewith the story's at-uri as its subject, the same record Grain web and grain-ios write. It starts done fromviewer.fav, fills red as soon as it is tapped, and a second tap deletes the record. Like Grain, it shows no count, because storyView has no favCount. Signed out on the web, tapping it goes to sign in.Double-tap to favorite, on stories and galleries. A double-tap on a story's picture (Slides
like: "Favorite"), on a feed card's photo (grain-feed's Gallery) or on a gallery page's photo (grain-gallery-view's Gallerylike: "Favorite") runs that ♡ and bursts a heart where the tap landed, as Grain web and grain-ios do. It only favorites: a second double-tap leaves the favorite in place and never deletes it. On a gallery page a single tap still opens the lightbox, about 250ms later, once it is clear the tap is not the first half of a double-tap. On a feed photo a single tap opens nothing, as before. A gallery's comments keep their own ♡s, which a double-tap on the photo never touches.iOS UI tests follow the new layout.
testStoryCommentschecks that the top row is 💬, ♡ and ⋯, each 44pt apart.testGalleryZoomopens the gallery from its card's title, because a tap on a feed photo opens nothing (HUD fa60f26, already in main) and a double-tap favorites.vendor/hud is at d74c7fe (app/shell). That HUD draws the centred sheet and the ♡ in the top row, and has
likeon Slides and Gallery, with the double-tap and its heart on web, HUDKit and Android. It also fixes HUDKit's heart, which never showed on iOS: its keyframe animator was set not to repeat, which holds the first frame (invisible) instead of playing it.Why
On next.grain.social at 1440px the comments sheet covered most of the screen, offset over the story, and the Add a comment button stopped about 700px into an 1100px sheet. Grain web and grain-ios let you heart a story and double-tap a photo to favorite it. next did neither.
How it was checked
All runs used a release HUD built from bd7494d, the server side of d74c7fe (which changes only HUDKit), with
HUD_WORKSPACE=offandHUD_APPSset to this branch'snext/. A stand-in for a signed-in viewer sat in front of it. The stand-in answered writes itself, so nothing reached a real account, and it put the favorites it made back into later reads asviewer.fav. No real account was used.Web (Chromium at 390 with touch, and 1440 with a mouse):
create_record social.grain.favoriteand turns red at once. The next tap writesdelete_record. Signed out, ♡ goes to /auth/signin.iOS simulator (iPhone 17 Pro, the app built from this branch). The app signed in through a stand-in OAuth server on the HUD test CA, so it ran as a signed-in viewer whose writes stayed local:
testGalleryZoomandtestStoryCommentspass.npm run checkandnode check-apps.mjsinnext/pass, and so do this pull's CI checks. HUD's own checks (svelte-check, ssr, unit,just covat 100%, Android unit tests, hud-core tests oflikeagainst Grain's stories, feed and gallery views) pass at bd7494d. d74c7fe changes only HUDKit's heart and builds without warnings.Shortcomings
like, draws the ♡ under the 💬, and shows no heart on iOS.