Skip to content
Merged
Show file tree
Hide file tree
Changes from 74 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
d2e76e4
fix(Lightbox): a single photo's caption sits on the caption's backing
vjeux Nov 8, 2026
d398515
fix(Lightbox): a single photo's caption shows as a gallery's
vjeux Nov 8, 2026
b64c3d4
feat(Lightbox): a gallery's caption sits in a two-line band
vjeux Nov 8, 2026
50875b6
docs(Lightbox): caption notes and records cover a single photo
vjeux Nov 8, 2026
232f499
test(Layer): the one-gutter check lists Lightbox's full-screen viewer
vjeux Nov 8, 2026
b565bdc
docs(Lightbox): FR1b covers a single captioned video too
vjeux Nov 8, 2026
18d4bb5
Merge main into the caption band
vjeux Nov 8, 2026
9a9b0f7
Merge the caption band's main merge
vjeux Nov 8, 2026
801fa11
docs(Lightbox): FR1b quotes only the owner's exact words
vjeux Nov 8, 2026
f2fdc74
Merge main into the caption band
vjeux Nov 8, 2026
785873b
Merge the caption band's second main merge
vjeux Nov 8, 2026
5877a0e
Merge main's drag to close into the caption band
vjeux Nov 8, 2026
cd2e283
fix(Lightbox): a drag to close fades a gallery's caption band
vjeux Nov 8, 2026
5c56c40
feat(Lightbox): a caption's "more" and "less" are an inline link
vjeux Nov 8, 2026
c6efc6e
Merge the caption band's main merge and inline link
vjeux Nov 8, 2026
926524a
fix(Lightbox): the caption's toggle takes its touch target from Core
vjeux Nov 8, 2026
d6950dc
Merge the caption band's touch target fix
vjeux Nov 8, 2026
d038a4b
Merge main's tempo for the drag to close into the caption band
vjeux Nov 8, 2026
2b0b009
Merge the caption band's main merge for the drag to close's tempo
vjeux Nov 8, 2026
29779c1
Merge main's first truncation measurement into the caption band
vjeux Nov 8, 2026
cff0218
Merge the caption band's merge of main's truncation measurement
vjeux Nov 8, 2026
74a1798
Merge main's nearest-item index into the caption band
vjeux Nov 9, 2026
f4874b7
Merge the caption band's merge of main's nearest-item index
vjeux Nov 9, 2026
ef505e3
Merge main's busy proof test fixes into the caption band
vjeux Nov 9, 2026
f782a98
Merge the caption band's merge of main's busy proof test fixes
vjeux Nov 9, 2026
f53cbe5
fix(Lightbox): "more" and "less" take the caption's colour
vjeux Nov 9, 2026
79b5a27
Merge the caption band's toggle colour fix
vjeux Nov 9, 2026
36836d2
Merge main's Lightbox screen reader and zoom reset changes
vjeux Nov 9, 2026
24cb6d1
Merge the caption band's merge of main
vjeux Nov 9, 2026
48232ac
fix(Lightbox): the caption measures through one shared observer path
vjeux Nov 9, 2026
1c6211d
Merge the caption band's shared observer path
vjeux Nov 9, 2026
c450f37
Merge main
vjeux Nov 9, 2026
7de97bf
Merge the caption band's merge of main
vjeux Nov 9, 2026
0412ac8
fix(Lightbox): the caption's toggle sits on a whole line box
vjeux Nov 9, 2026
84aeecf
Merge the caption band's whole line box for the toggle
vjeux Nov 9, 2026
f27d557
fix(Lightbox): the toggle's place is as tall as the caption's lines
vjeux Nov 9, 2026
12f50c4
Merge the caption toggle place made of line boxes
vjeux Nov 9, 2026
558fa34
fix(Lightbox): an open caption's toggle place shrinks when it widens
vjeux Nov 10, 2026
cd23648
Merge the open caption toggle place that shrinks when it widens
vjeux Nov 10, 2026
547f67e
fix(Lightbox): an opened caption counts its lines without the toggle
vjeux Nov 10, 2026
fceae0c
Merge the opened caption that counts its lines without the toggle
vjeux Nov 10, 2026
59a4256
Merge main
vjeux Nov 10, 2026
2d69149
Merge main
vjeux Nov 10, 2026
2a2aa33
fix(Lightbox): keep internal markers off public data attributes
vjeux Nov 10, 2026
e7e9aef
fix(Lightbox): new text in an open caption counts its lines again
vjeux Nov 10, 2026
766883d
docs(Lightbox): name where focus goes after paging from the toggle
vjeux Nov 10, 2026
5eddce8
Merge the caption band's attribute and recount fixes
vjeux Nov 10, 2026
8e8db8e
fix(Lightbox): a click on the caption band leaves the viewer open
vjeux Nov 10, 2026
36ec042
Merge the caption band's click rule
vjeux Nov 10, 2026
5b1475c
docs(Lightbox): a double-click on a caption zooms the photo
vjeux Nov 10, 2026
b482541
docs(Lightbox): state the desktop click rule in the present
vjeux Nov 10, 2026
d12f0d5
test(Lightbox): a gallery's caption keeps 4.5:1 in light mode
vjeux Nov 10, 2026
61845c0
Merge main
vjeux Nov 10, 2026
a1763d2
Merge the caption band's present-tense click rule and main
vjeux Nov 10, 2026
381fc24
docs(Lightbox): state the caption double-click rule in the present
vjeux Nov 10, 2026
4ecd6d4
test(Lightbox): time the tap after a drag to close as a browser does
vjeux Nov 10, 2026
2ab9123
test(Lightbox): a single photo's caption keeps 4.5:1 in every theme
vjeux Nov 10, 2026
f111a96
docs(Lightbox): FR19's verification row names the black photo again
vjeux Nov 10, 2026
23b396f
test(Lightbox): a single captioned video takes a gallery page's band
vjeux Nov 10, 2026
d30de85
Merge main
vjeux Nov 11, 2026
1e1a1ea
Merge the caption band's merge of main
vjeux Nov 11, 2026
520db91
Merge main
vjeux Nov 11, 2026
34f0792
Merge the caption band's merge of main
vjeux Nov 11, 2026
e0b9691
Merge main
vjeux Nov 11, 2026
5058dc3
Merge the caption band's merge of main
vjeux Nov 11, 2026
230cff7
Merge main
vjeux Nov 11, 2026
07d4ce9
Merge the caption band's merge of main
vjeux Nov 11, 2026
591999d
fix(Lightbox): a new caption is measured as it renders
vjeux Nov 11, 2026
a9c43b7
test(Text): useTruncation keeps its answer while text is expanded
vjeux Nov 11, 2026
d99c0ce
feat(Text): useTruncation takes isExpanded, and Lightbox uses it
vjeux Nov 11, 2026
edea6cf
Merge main
vjeux Nov 11, 2026
5e008ff
Merge main
vjeux Nov 11, 2026
1990c0c
docs(architecture): name observeResizeAfterLayout under INV18
vjeux Nov 11, 2026
b7d1fd4
Merge the caption band's merge of main
vjeux Nov 11, 2026
cdb270a
Merge main
vjeux Nov 11, 2026
c987368
Merge the caption band's merge of main
vjeux Nov 11, 2026
0d55126
Merge main
vjeux Nov 11, 2026
648c343
Merge the caption band's merge of main
vjeux Nov 11, 2026
7480d1d
fix(Lightbox): a gallery's photo box keeps the stage's cursor
vjeux Nov 12, 2026
84d4ec2
Merge the caption band's photo cursor fix
vjeux Nov 12, 2026
e4b4eaf
docs(Lightbox): name the natural-width click gap in the record
vjeux Nov 12, 2026
7282678
Merge the caption band's record of the click gap
vjeux Nov 12, 2026
439bd0c
Merge main
vjeux Nov 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/lightbox-gallery-caption-row.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@astryxdesign/core': patch
---

[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 an inline "more" link, which opens the whole caption over the photo. The whole caption is always the viewer's accessible description.

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 `Link`'s button form in the caption's own type, 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.

@vjeux
7 changes: 7 additions & 0 deletions .changeset/lightbox-single-caption-backing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astryxdesign/core': patch
---

[fix] A single photo's caption in a `Lightbox` now shows as a gallery's does. It sits in the band at the bottom of the viewer, on the caption's backing, which keeps 4.5:1 over any page behind it. The photo centres above it. A caption longer than two lines ends in "more", which opens it in full over the photo. A single photo with no caption shows no band.

@vjeux
7 changes: 7 additions & 0 deletions .changeset/use-truncation-is-expanded.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@astryxdesign/core': patch
---

[feat] `useTruncation` takes `isExpanded`: pass true while the text is shown in full; the hook keeps reporting whether it is cut off when clamped. A Lightbox caption uses it, so its "less" stays while the caption is open.

@vjeux
63 changes: 49 additions & 14 deletions apps/storybook/stories/Lightbox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export const WithZoom: Story = {
},
};

/** Zoom on a photo with a caption, which sits under the fitted photo. */
/** Zoom on a photo with a caption, in the caption band a gallery's pages use. */
export const ZoomWithCaption: Story = {
render: () => {
const [isOpen, setIsOpen] = useState(false);
Expand Down Expand Up @@ -176,11 +176,28 @@ export const GalleryWithZoom: Story = {
};

/**
* A gallery whose captions differ in length: the photo keeps one box
* whichever pages, and so whichever captions, are rendered.
* A gallery whose captions differ in length. The first runs long, so two
* lines cut it short and "more" shows it all. The next runs about two lines,
* one has none, and the last is short. The photo keeps one box on every page.
*/
export const GalleryWithCaptions: Story = {
render: () => {
args: {
media: [
{
...GALLERY_MEDIA[0],
caption:
'A winding path through the forest, past the old mill and down to the river, where the trail turns back toward the village. In autumn the beeches along it turn copper, and on a clear morning you can see the church spire from the bridge before the path climbs the last hill home.',
},
{
...GALLERY_MEDIA[1],
caption:
'Morning fog lifting off the lake, seen from the old stone bridge',
},
GALLERY_MEDIA[3],
{...GALLERY_MEDIA[2], caption: 'Golden hour'},
],
},
render: ({media}) => {
const [isOpen, setIsOpen] = useState(false);
return (
<>
Expand All @@ -190,16 +207,7 @@ export const GalleryWithCaptions: Story = {
<Lightbox
isOpen={isOpen}
onOpenChange={setIsOpen}
media={[
{
...GALLERY_MEDIA[0],
caption:
'A winding path through the forest, past the old mill and down to the river, where the trail turns back toward the village',
},
GALLERY_MEDIA[1],
GALLERY_MEDIA[3],
{...GALLERY_MEDIA[2], caption: 'Golden hour'},
]}
media={media}
hasZoom
/>
</>
Expand Down Expand Up @@ -233,6 +241,33 @@ export const GalleryKeepsIndex: Story = {
},
};

/**
* A single photo whose caption runs long. As on a gallery's page, two lines
* cut it short and "more" shows it all.
*/
export const SingleWithLongCaption: Story = {
render: () => {
const [isOpen, setIsOpen] = useState(false);
return (
<>
<button onClick={() => setIsOpen(true)}>
Open single photo with a long caption
</button>
<Lightbox
isOpen={isOpen}
onOpenChange={setIsOpen}
media={{
...GALLERY_MEDIA[0],
caption:
'A winding path through the forest, past the old mill and down to the river, where the trail turns back toward the village. In autumn the beeches along it turn copper, and on a clear morning you can see the church spire from the bridge before the path climbs the last hill home.',
}}
hasZoom
/>
</>
);
},
};

export const WithCaption: Story = {
render: () => {
const [isOpen, setIsOpen] = useState(false);
Expand Down
6 changes: 5 additions & 1 deletion docs/architecture/react-component-runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
(`design:reduced-motion` DR1–DR3); the touch hit-area expansion; and List's
reorder session, for a collection that adapts the reorderable object to its
own values or whose rows are not `ListItem`s (`createReorderable`'s
plain-element `attach`, `spec:AST-103` FR4b, is not built).

Check warning on line 304 in docs/architecture/react-component-runtime.md

View workflow job for this annotation

GitHub Actions / lint

Project status in a record

"not built"

Check warning on line 304 in docs/architecture/react-component-runtime.md

View workflow job for this annotation

GitHub Actions / lint

Project status in a record

"not built"
Components import
them statically, and the bundler
keeps one copy per page however many components use them. A surface
Expand Down Expand Up @@ -391,7 +391,10 @@
measurement pass: a remaining read names its reason in a comment and happens
once per change, not per frame, or as the before-and-after pair a current
clause requires. INV11's keyboard hook, which makes at most one layout read
per keyboard change, is one instance. (Known implementation gaps include: the
per keyboard change, is one instance. `observeResizeAfterLayout` observes like
`observeResize` without the registration-time call, so a caller's first read
comes from the browser's own first notification after layout (Lightbox's
caption). (Known implementation gaps include: the
chat stream scroll hook reads scroll geometry on every scroll event, and
about 49 Core source files that call `getBoundingClientRect` are not yet
checked against this rule.)
Expand Down Expand Up @@ -553,3 +556,4 @@
| INV16 (slot presence) | `no-nullish-jsx-guard` strict lint over Core and RichText, with no baseline, and `no-truthy-jsx-guard` strict lint over Core, with no baseline; both catch inline guards only, so review also checks for a presence test hoisted into a variable, converted (`!!value`, `Boolean(value)`), made by an early return or a `??` default, or passed through a prop spread, which the lints pass; empty-slot tests that pass `''`, `false`, `true`, and `null` and compare with an omitted slot, plus `0` as content, in Item, MetadataList, ChatSystemMessage, TreeList, TopNavMegaMenu, RichTextEditor, and RichTextEditorToolbar | A slot given `''`, `true`, or `false` draws a wrapper, lane, border, or separator that an omitted slot does not, an element loses the name it has without the slot, `0` does not render, or a new bare nullish or truthiness presence test, inline or hoisted, a truthiness guard past the baseline, a baseline entry added, or a hand-written copy of the check lands |
| INV18 | Review of every added read that forces layout: `getBoundingClientRect`, `getClientRects`, `offset*`, `client*`, `scroll*` (`scrollTop`, `scrollHeight`, and the rest), `inner*` and `outer*`, `visualViewport` geometry, and `getComputedStyle` (evidence gap: no automated finding yet) | A layout read in a per-frame, scroll or resize path that no current clause requires there, a read interleaved with writes, a read without a comment that names its reason, more than one measurement pass per change beyond the before-and-after pair a current clause requires, or JavaScript measurement where CSS placement serves |
| INV18 reorder | Browser tests of a mouse drag in a reorderable List while a wheel scrolls its scroller: one checks the preview, the drop line and the drop, and one traces layout and counts the offset reads | A wheel scroll mid-drag that leaves the drop line or the preview off the pointer, a drop away from the pointer, a layout the read forces, or more than one read in a scrolled frame |
| INV18 (after layout) | `sharedResizeObserver.test.ts` cases for `observeResizeAfterLayout`, and the Chromium trace test that opens a Lightbox gallery on a clamped caption and counts its layouts | A first read in the registration-time call, a first read before the browser's own first notification after layout, or a layout that the caption's first read forces |
2 changes: 1 addition & 1 deletion docs/specs/AST-038-layer-text-boundary/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ and ownership guards MUST remain component-owned when that equivalence is absent
| [useLayer](../../../packages/core/src/Layer/useLayer.tsx) base typography | Existing body family/size/leading are the one equivalent baseline moved into the private shared reset by the text-only implementation. No token/value or precedence change for those three declarations is intended. |
| [Tooltip](../../../packages/core/src/Tooltip/useTooltip.tsx) painted surface | Explicit body type, inverted colors, and content `wordBreak: break-word` are deliberate. Keep them; moving inner declarations outward can change supported overrides even where values match. |
| [Toast](../../../packages/core/src/Toast/Toast.tsx) | Uses body **defaults** for size/leading, surface inversion, and content `overflowWrap: anywhere`. This is not equivalent to replacing them with inherited live body variables. Keep them. |
| [Lightbox](../../../packages/core/src/Lightbox/Lightbox.tsx), menu rows, keyboard hints, chart/radial tooltips | Centered large captions, menu label/supporting type and start alignment, smaller nowrap keyboard hints, and compact chart wrapping remain intentional local presentation. Do not delete them as redundant resets. |
| [Lightbox](../../../packages/core/src/Lightbox/Lightbox.tsx), menu rows, keyboard hints, chart/radial tooltips | Lightbox's caption renders through Text under MediaTheme (`component:Lightbox`). Menu label/supporting type and start alignment, smaller nowrap keyboard hints, and compact chart wrapping remain intentional local presentation. Do not delete them as redundant resets. |
| [useLayer portal writing context](../../../packages/core/src/Layer/useLayer.tsx), [padding reset](../../../packages/core/src/Layout/padding.stylex.ts) | Corrective portals preserve lost direction/writing mode without snapshotting tokens. The existing padding boundary resets its own structural variables. Preserve both; neither is a generic group or text barrier. |
| Button/InputGroup end-cap rules and Collapsible/BottomSheetSwitcher context guards | Already solve distinct membership/ownership problems. Preserve them; the text boundary does not replace sibling classification, nested presentation isolation, or sheet registration scope. |
| `all: unset` on Item/TreeListItem/Collapsible/Stepper/Token/Thumbnail/ChatComposer controls | Local UA/control resets, not layer-root inheritance fixes. No new `all`/`unset`/`revert` layer reset is proposed. ToastViewport's `inset: unset` is geometry; menuWidth's `unset`/`revert` strings are caller-supplied width keywords routed to inline-size rather than `min()`, not a general inheritance reset. |
Expand Down
Loading
Loading