You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c83f03d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(Lightbox): a caption that grows past two lines gets "more"
A gallery caption re-measured its clamp only when its box resized, a
page attached, or the caption opened or closed. New text in a box that
kept its two lines never got "more". The clamp now comes from Text's
own truncation check, which also follows new text: useHeldTruncation,
a variant of useTruncation internal to core, keeps the answer while the
caption is open, so the toggle stays mounted, with its focus, as the
caption closes. useTruncation's public options do not change, and only
the held variant runs a layout effect, so Text and Heading run no new
effect. Lightbox still measures the toggle's place and the open
caption's scroll, now on new text too.
A closed dialog lays its caption out at no size, so Lightbox measures
the caption again as the dialog opens, before the first paint: the
first frame that shows a clamped caption already ends it in "more".
The changeset now says that a gallery's caption keeps 4.5:1, and the
record lists a single photo's caption, which has no backing, as a gap
in FR17.
Copy file name to clipboardExpand all lines: .changeset/lightbox-gallery-caption-row.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,6 @@
4
4
5
5
[feat] A Lightbox gallery's caption sits in a band two lines tall under every photo, so the photo keeps one size and place from item to item. A photo with no caption keeps the band's space without its backing. A longer caption shows two lines, the second ending in a "more" button, which opens the whole caption over the photo. The whole caption is always the viewer's accessible description.
6
6
7
-
The viewer is a media surface: its controls, caption and counter take the theme's dark surface tokens through `MediaTheme`. The caption is body `Text` whose lines start at one edge, "more" and "less" are a ghost `Button`, and the band clears the screen's bottom edge and its safe area. The caption sits on a backing that keeps it at 4.5:1 over any photo. A tap that opens the viewer paints no focus ring on its first control, and paging from a focused "more" or "less" keeps focus in the viewer.
7
+
The viewer is a media surface: its controls, caption and counter take the theme's dark surface tokens through `MediaTheme`. The caption is body `Text` whose lines start at one edge, "more" and "less" are a ghost `Button`, and the band clears the screen's bottom edge and its safe area. A gallery's caption sits on a backing that keeps it at 4.5:1 over any photo. A tap that opens the viewer paints no focus ring on its first control, and paging from a focused "more" or "less" keeps focus in the viewer.
// New text, past two lines, in a box that keeps its height.
315
+
last?.appendData(
316
+
' The trail climbs past the old mill, crosses the river on stepping stones, and winds back through the beeches to the car park at the top of the hill.',
0 commit comments