Add experimental composer toggle for image grid/carousel layout

Behind the new `composer:image_layout_toggle:enable` feature gate, show
a pill button in the composer toolbar (next to the labels button) when a
post has 2-4 images. The button switches the draft between the legacy
`app.bsky.embed.images` shape (grid) and the newer
`app.bsky.embed.gallery` shape (carousel, previously only used for 5+
images). Gallery embeds now always render with the carousel layout so
the choice is reflected for viewers.

The button is wrapped in a one-time tooltip nudge, following the same
pattern as the threadgate button, and emits a
`composer:imageLayout:toggle` metric.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SvDXhHEBCjAfokEFK8pHt8
This commit is contained in:
Claude
2026-07-05 10:11:00 +00:00
parent 79a16094f1
commit 9f5d5a539b
11 changed files with 210 additions and 4 deletions
+9
View File
@@ -0,0 +1,9 @@
import {device, useStorage} from '#/storage'
export function useImageLayoutNudged() {
const [imageLayoutNudged = false, setImageLayoutNudged] = useStorage(device, [
'imageLayoutNudged',
])
return [imageLayoutNudged, setImageLayoutNudged] as const
}
+1
View File
@@ -62,6 +62,7 @@ export type Device = {
demoMode: boolean
activitySubscriptionsNudged?: boolean
threadgateNudged?: boolean
imageLayoutNudged?: boolean
inviteFriendsFollowersPromoDismissed?: boolean
/**
* Selected color theme for the Invite Friends QR card.