Repository navigation
fix(Lightbox): a single photo's caption sits on the caption's backing - #10284
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| lab/CommentThread | 358.7 kB (−530 B) · 2.4 kB CSS (0) | — | — · — · — |
| Lightbox · Storybook | 144.3 kB (−574 B) · 11.5 kB CSS (0) | 4,623 (−77) | ✓ · ✓ · ✓ |
| lab/Comments | 365.7 kB (−575 B) · 2.5 kB CSS (0) | — | — · — · — |
Package size: @astryxdesign/core 7.46 MB packed (−2.3 kB); no new dependencies.
Touched components checked; add ci:run-visual or ci:run-rtl to run the full suites.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
This pull request needs an owner decision on its Lightbox spec changes, and it has two blocking findings that need changes either way.
- A single zoomed photo no longer pans on a drag that starts at its side edge, because
useZoomStage.ts(lines 214–227) refuses that pan for every Lightbox rather than only for a gallery whose pager can take it, so please hand the drag off at an edge only in a gallery and add a single-photo test that drags out from an edge. - Against
mainthis pull request is 5,488 changed lines, and since itsStack:line does not match the one in #8197 and #9810 (neither lists this pull request) the stack size exemption does not apply, so please give all three descriptions one identicalStack:line, bottom first with this pull request last, or split the change.
The head adds requirements the current records do not state: the gallery caption-band sentences in component:Lightbox FR1, the new FR17 media-surface rule, and a rewrite of the spec:AST-038 Lightbox row that currently keeps centred large captions. Approval needs an engineering owner to approve or reject those record changes by commenting /approve-spec <full head SHA> on this pull request, and the author can do that as an engineering owner. The review shows before and after captures for both findings.
[Automated review]
1370140 to
702b595
Compare
There was a problem hiding this comment.
This pull request needs an engineering owner's decision on its Lightbox spec changes, and it has two blocking findings that need changes either way.
Approval waits on an engineering owner approving or rejecting three spec changes, as written at this head: component:Lightbox FR1's gallery caption-band sentences (the two-line band, the "more"/"less" button for every pointer, the full caption as the accessible description); the new FR17 media-surface row, which also restyles a single photo's caption as body text on a dark plate; and spec:AST-038's rewritten Lightbox row, which drops the "Centered large captions … remain intentional" guidance. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so if they are an engineering owner.
Blocking findings:
.changeset/pager-settle-tempo.mdsays aCarouselwithhasSnapnow settles at the theme'stempo, but onlyhasSnap={useSnapPaging()}runs the pager (plainhasSnapkeeps CSS scroll snap), so it should read "in aCarouselgivenhasSnap={useSnapPaging()}".- The diff is 5,947 authored lines with no size exemption, because the
Stack:line is not the one #8147 and #8148 carry and it lists #8215, which this head does not contain; give every listed pull request one identical linear line of pull requests that each contain the one below (for example #8197 → #9810 → #10284), or split the change.
Non-blocking: spec:AST-094's FR45 verification row still lists the pager's tempo gap, and the proposed FR1 does not yet state the toggle's expanded state or where focus goes when paging removes it. The single zoomed photo's drag from its edge pans again, as on main.
[Automated review]
702b595 to
2b845bc
Compare
There was a problem hiding this comment.
This stack is waiting on one engineering-owner decision: #8197 and #9810 are approved, and #10284 needs its new Lightbox spec line approved.
#8197
Approved at its current head, with no blocking findings.
#9810
Approved at its current head, with no blocking findings.
#10284
Approval waits on an engineering owner approving or rejecting component:Lightbox FR1b and its verification row, as written at this head: a single photo presents its caption the same way a gallery page does (the two-line band at the bottom of the viewer on the caption's backing, the inline "more"/"less" for every pointer, the photo centred above it, no band without a caption), with no paging controls and the zoomed photo's rubber band as its exceptions. No current record states this. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so if they are an engineering owner. There are no blocking findings beyond that decision.
Non-blocking: the record's "Captioned media" state still says the caption follows the photo in a centred group, FR1b's exception should say a gallery's touch pager takes the edge drag, and the description should say this pull request also carries #8197's busy-proof test rewrite and a merge of main.
Whole stack
No blocking issue across the three pull requests, and the head merges cleanly with main. Each pull request lands only when it and every pull request below it are approved; CI has not run on these drafts yet.
[Automated review]
2b845bc to
e902d9a
Compare
There was a problem hiding this comment.
This stack waits on engineering-owner approvals for #9810 and #10284, and #8197 needs one fix. Each pull request lands only when it and every pull request below it are approved.
#8197
Changes needed:
- Regression: this head conflicts with
main, because the v0.7.10 release deleted.changeset/lightbox-every-pointer.mdand this pull request still edits one line of it; mergemainhere and drop that edit (the merge already in #9810's history does exactly this), then have the record approval re-stamped at the new head.
#9810
No blocking findings. Its own changes are identical to the approved head, but the new head merges #8197 and main, so the record approval no longer applies: an engineering owner re-approves its unchanged record text by commenting /approve-spec <full head SHA> on #9810.
#10284
Approval waits on an engineering owner approving or rejecting component:Lightbox FR1b and its verification row as written: a single photo presents its caption the same way a gallery page does (the two-line band at the bottom of the viewer on the caption's backing, the inline "more"/"less" for every pointer, the photo centred above it, no band without a caption), with no paging controls and the zoomed photo's rubber band as its exceptions. No current record states this. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so if they are an engineering owner. There are no other blocking findings.
Non-blocking: the translator notes for "more" and "less" in en.json still say they follow a gallery caption (Miss), the record's "Captioned media" state still describes the old centred group, and FR1b's exception should say a gallery's touch pager takes the edge drag.
Whole stack
No blocking issue in the combined change: it merges cleanly with main, its records agree with each other, and the touched unit suites pass. CI has not run on these drafts yet.
[Automated review]
|
/approve-spec e902d9a |
There was a problem hiding this comment.
Changes needed before this can land; one rebase fixes all three blocking findings. This pull request is reviewed on its own against main, because #8197 and #9810 no longer list it in their Stack: line and this head does not contain their current heads; its record changes, component:Lightbox FR1b included, carry an engineering owner's /approve-spec for this head, so no spec decision is pending.
- Regression: the stack exemption no longer covers this branch's 6,681 authored lines, so rebase it onto #9810's current head and give #8197, #9810 and #10284 one identical
Stack: #8197 → #9810 → #10284line. - Regression: merging this head into
mainstops on a conflict inpackages/core/src/Lightbox/__tests__/LightboxZoom.interaction.browser.spec.ts, which #9810's current head already resolves. - Miss:
onSettleinLightbox.tsxresets only photos outside the page marked current, so when a swipe's render lands after the settle ends the photo left behind keeps its zoom; #8197's current head fixes this by skipping only the page the pager reports as settled.
Non-blocking: the "more"/"less" translator notes in en.json still say "gallery caption", and the record's "Captioned media" state still describes the old centred caption. The rebased head will need a fresh /approve-spec.
[Automated review]
e902d9a to
fcf9c27
Compare
There was a problem hiding this comment.
Changes requested: #9810 has one blocking finding; #10284 is approved on its own.
#9810: request changes
UseTruncationOptions.isExpanded(packages/core/src/Text/useTruncation.ts:30) is a new public option of@astryxdesign/coreoutside this pull request's declared scope (Lightbox), so nameuseTruncationin the scope, for example with aComponents: Lightbox, useTruncationline under a## Scopeheading in the description, or move the option to its own pull request.
The record changes, component:Text's new "Truncation hook" row included, are owner-approved for this head, so the scope line is a description edit and needs no new commit.
#10284: approve
- No blocking findings: FR1b, its verification row, the "Captioned media" state and the FR11 note are owner-approved for this head, and the owner's desktop decision covers a single item's "more", "less" and band click.
Whole stack: fail
The stack waits on #9810's fix; a pull request lands only when it and every pull request below it are approved, so #9810 lands first. CI could not start on these heads ("CI is full"), so its jobs need a re-run before either pull request merges.
There was a problem hiding this comment.
Approved pending CI: both pull requests in this stack. CI has not run its tests on these heads yet (the run found no room under the CI ceiling), so its jobs need a re-run before either pull request merges.
#9810: approve
- No blocking findings: the record changes,
component:Text's "Truncation hook" row included, are owner-approved for this head, and the description now namesuseTruncationin its scope beside Lightbox.
#10284: approve
- No blocking findings: FR1b, its verification row, the "Captioned media" state and the FR11 note are owner-approved for this head, and the owner's desktop decision covers a single item's "more", "less" and band click.
Whole stack: pass
A pull request lands only when it and every pull request below it are approved, so #9810 lands first, then #10284. A few non-blocking notes stay open on their threads, such as the empty caption band of an uncaptioned gallery page closing the viewer on a mouse click.
This merges meta#9810's head, which merges main.
|
/approve-spec c987368 |
There was a problem hiding this comment.
Approved pending CI: both pull requests in this stack. CI skips its jobs on draft heads, so they run once #9810 and #10284 are marked ready for review, and neither merges before they pass.
#9810: approve
- No blocking findings: its record changes,
component:Text's "Truncation hook" row included, are owner-approved for this head, and its scope namesuseTruncationbeside Lightbox.
#10284: approve
- No blocking findings: FR1b, its verification row, the "Captioned media" state and the FR11 note are owner-approved for this head, and the owner's desktop decision covers a single item's "more", "less" and band click.
Whole stack: pass
A pull request lands only when it and every pull request below it are approved, so #9810 lands first, then #10284. A few non-blocking notes stay open on their threads, such as the empty caption band of an uncaptioned gallery page closing the viewer on a mouse click.
This merges meta#9810's head, which merges main.
There was a problem hiding this comment.
Not approved yet: both pull requests wait on an engineering owner's spec approval for their current heads. No code change is needed; each head only merged the branch below it, and that dropped the earlier approvals.
#9810: waiting on spec approval
- Approval needs an engineering owner to approve, at this head, the record changes it proposes: the Lightbox caption band in FR1, FR19's media surface, AR3's focus after paging, the FR11 desktop click note, the AST-038 Lightbox row, Text's "Truncation hook" row for
useTruncation'sisExpanded, and the INV18 sentence forobserveResizeAfterLayout.
#10284: waiting on spec approval
- Approval needs an engineering owner to approve, at this head, FR1b and its verification row, the "Captioned media" state, FR19's settled state and the FR11 double-click note.
Whole stack: passes. Both heads merge cleanly with main, the records agree, and the only public API change is the optional isExpanded on useTruncation.
Next: an engineering owner, the author included as one, comments /approve-spec <full head SHA> on each pull request with that pull request's own head. A pull request lands only when it and every pull request below it are approved, so #9810 lands first; CI has not run on these draft heads yet. The five non-blocking notes already on this pull request still stand.
Claims and files checked
- Verified in code: a single photo shows its caption in the gallery's band; only paging, Previous/Next, the counter and the arrow keys stay gallery-only; the single photo's own wrapper, plate, caption lift and fit callback are gone; a click on a single photo's band leaves the viewer open; the record's single-item row, state and double-click note match the code; no new public API, data attribute, prop or default in #10284; the removed zoom options are reachable only from Lightbox; the line counts per category are exact.
- Verified in code (#9810): the band, clamp, "more"/"less" as a link-styled button with its 44 px touch area, the full caption as the description, the media surface, the opening ring and the scroll-free focus return, focus after paging, the band click rule,
isExpanded, and the internal after-layout observer; the three dropped data attributes appear nowhere. - Covered by cases in the pull request but not run at this head: contrast in every shipped theme, the single-photo caption spec, the layout traces and the stated test totals.
- Not checkable here: the bundle-size savings and the device results.
- Changesets: the single-photo, gallery-band and
isExpandedentries match the code; the single-photo entry names a photo while a single video changes too, which is narrower than the change. - Files:
Lightbox.tsx,useZoomCore.ts,useZoomStage.ts,useTruncation.ts,sharedResizeObserver.ts, the three changesets, the story, the four records,en.json, both docs and all 15 test files: clear;Lightbox.tsxandLightbox.spec.mdcarry the five non-blocking notes.
|
/approve-spec 648c343 |
There was a problem hiding this comment.
Changes requested: #9810 needs one style fix and #10284 needs two description edits.
#9810: changes requested
- Miss: a zoomable gallery's photo row now shows the hand cursor, beside the photo where a click closes the viewer and over a zoomed photo, because the zoom button moved onto the photo box (
Lightbox.tsx:2018-2031at #9810's head) and itspageMediaZoomTargetstyle (:315-317) sets no cursor, so the reset's[role='button']pointer applies;mainshows zoom-in over the photo, the arrow beside it and grab while zoomed, so move #10284'scursor: inheritrule into this pull request, or record an owner decision for the new cursor.
#10284: changes requested
- Miss: the History lists the commit "FR1b quotes only the owner's exact words" among the "Merges of #9810", but it has one parent and is this pull request's own commit that rewrote FR1b's citation, so list it among the own commits.
- Miss: the Record notes say FR1's cell has 37 characters of slack, but at this head FR1 is the widest cell in the contract table and fills its column, so drop or correct the number.
Whole stack: passes; both heads merge cleanly with main, the records agree, the stack as a whole keeps main's cursor, and the only public API change is the optional isExpanded on useTruncation.
A pull request lands only when it and every pull request below it are approved, so #9810 lands first. A fix commit moves a head, and each moved head needs a fresh spec approval. The five non-blocking notes already on this pull request still stand.
Claims and files checked
- False (#10284): the History files the commit that rewrote FR1b's citation as a merge of #9810; it is this pull request's own one-parent commit.
- False (#10284): FR1's record cell has 37 characters of slack; at this head it fills its column.
- Verified (#10284): a single photo shows its caption in the gallery's band; before, the single caption had no backing; only paging, Previous/Next, the counter and the arrow keys stay gallery-only; the single item's wrapper styles, caption lift and fit callback are gone; a click on a single photo's band leaves the viewer open; the quoted record row matches the record; the line counts per category are exact; the removed zoom options are reachable only from Lightbox; no new public API, data attribute, prop or default.
- Verified (#9810): the caption's element inventory (8 elements, one float); the band, clamp and "more"/"less" as a link-styled button; the full caption as the description; the media surface; the band click rule;
isExpanded; the internal after-layout observer; the three dropped data attributes appearing nowhere;useTruncationnamed in its scope. - Not stated (#9810): the zoom button's move onto the photo box changes a gallery's mouse cursor; no claim covers it (the blocking finding above).
- Covered by cases but not run at this head: contrast in every shipped theme, the single-photo caption spec, the layout traces and the stated test totals.
- Not checkable here: the bundle-size figures, the screenshot matches, the contrast table and the device results.
- Changesets: the gallery-band,
isExpandedand single-photo entries match the code; the single-photo entry names a photo while a single video changes too, which is narrower than the change. - Files (#10284, all 15):
Lightbox.tsxcarries the cursor rule #9810 needs;Lightbox.spec.mdcarries a non-blocking note; the changeset, story,en.json,Lightbox.doc.mjs,useZoomCore.ts,useZoomStage.tsand the seven test files: clear. - Files (#9810):
Lightbox.tsx: the cursor finding and three non-blocking notes;Lightbox.spec.mdandLightboxViewport.a11y.browser.spec.ts: non-blocking notes;useTruncation.ts,useTruncation.doc.mjs,sharedResizeObserver.ts, the two changesets, the story,Text.spec.md, the runtime and boundary records,en.json,Lightbox.doc.mjsand the other test files: clear.
|
Both fixed in the descriptions, with no new commit. #9810's "Minimal DOM" section now counts one float and 8 caption elements, which a Chromium count at 0d55126 confirms in every state. #10284's user impact says the single caption sat under the photo with no backing, and "What changed" drops "plate". |
|
I'll run a full review to re-check this with your note. |
|
Both fixed in the description, with no new commit. The History now lists 801fa11 among this pull request's own commits, and the Record notes say FR1's cell is the widest in its column, with no slack figure. |
The zoom button moved onto a gallery page's photo box, so the reset's button cursor showed a hand beside the photo and over a zoomed photo. The box now takes the stage's cursor: zoom-in over the photo, the arrow beside it and grab while zoomed, as on main.
This merges meta#9810's head, which now carries this pull request's photo-box cursor rule, so it leaves this pull request's own diff.
There was a problem hiding this comment.
Approved pending CI: both pull requests in this stack. CI has not run its tests on these heads yet: both are drafts, and CI runs once they are marked ready for review.
#9810: approve
No blocking findings. The photo box now keeps the stage's cursor, which fixes the earlier cursor finding.
#10284: approve
No blocking findings. The description now lists its own commits and FR1's record cell correctly.
Whole stack: passes; both heads merge cleanly with main, the records agree, and the only public API change is the optional isExpanded on useTruncation.
A pull request lands only when it and every pull request below it are approved, so #9810 lands first. The five non-blocking notes already on this pull request still stand.
Claims and files checked
- Verified (#10284): a single photo or video shows its caption in the gallery's band; before, the single caption sat under the photo with no backing; only paging, Previous and Next, the counter and the arrow keys stay gallery-only; the single item's wrapper styles, caption lift and fit callback are gone; a click on a single photo's band leaves the viewer open; the record's single-item rule and caption state cover one item or a gallery, and the quoted rule matches the record; FR1's record cell is the widest in its column; every own commit is listed in the History; the latest merge only brings #9810's cursor rule and drops this pull request's copy; the per-category line counts are exact; the removed zoom options are reachable only from Lightbox; no new public API, data attribute, prop or default.
- Verified (#9810): the two-line band, the clamp and "more"/"less" as a link-styled button with its expanded state and controlled element; the full caption as the description; the media surface; focus after paging from the toggle; the desktop band click rule;
isExpanded; the internal after-layout observer, not exported; the three dropped data attributes appear nowhere; the scope namesuseTruncation; the photo box keeps the stage's cursor, with a gallery cursor case; the caption's eight elements and one float; the toggle's shared touch target; the line and test-file counts are exact. - Covered by cases but not run at this head: contrast in every shipped theme, the single-photo caption and captioned-video cases, the caption double-click case, the cursor case, the layout traces and the stated test totals.
- Not checkable here: runs on trees not in the repository, the bundle-size figures, the screenshot matches, the contrast table and the device results.
- Changesets: the gallery-band,
isExpandedand single-photo entries match the code; the single-photo entry names a photo while a single video changes too, which is narrower than the change. - Files (#10284, all 15):
Lightbox.spec.mdcarries a non-blocking note;Lightbox.tsx,useZoomCore.ts,useZoomStage.ts, the changeset, the story,en.json,Lightbox.doc.mjsand the seven test files: clear. - Files (#9810, all 26):
Lightbox.tsxcarries three non-blocking notes;Lightbox.spec.mdandLightboxViewport.a11y.browser.spec.tscarry one each;useTruncation.ts,useTruncation.doc.mjs,sharedResizeObserver.ts, the two changesets, the story,Text.spec.md, the runtime and boundary records,en.json,Lightbox.doc.mjsand the other test files: clear.
|
/approve-spec 84d4ec2 |
Beside a photo scaled down to fit, a click within the band as wide as the photo's natural width keeps the viewer open. The record now names it as an implementation gap after its backdrop rule.
This merges meta#9810's head, which names the natural-width click gap in the Lightbox record.
|
/approve-spec 7282678 |
1 similar comment
|
/approve-spec 7282678 |
There was a problem hiding this comment.
Approved pending CI: both pull requests in this stack. CI has not run its tests on these heads yet: both are drafts, and CI runs once they are marked ready for review.
#9810: approve
No blocking findings. One new non-blocking note: the new implementation-gap line under the fine-pointer note names only the photo's natural width, but a click level with the photo also stays open within its caption's width, as on main.
#10284: approve
No blocking findings. Its own changes are as before; the new head only merges #9810's new record line.
Whole stack: passes. Both heads merge cleanly with main, the records agree, and the only public API change is the optional isExpanded on useTruncation.
A pull request lands only when it and every pull request below it are approved, so #9810 lands first. The other five non-blocking notes already on this pull request still stand.
Claims and files checked
- Verified (#10284): a single photo or video shows its caption in the gallery's band; before, the single caption sat under the photo with no backing and had no "more"; only paging, Previous and Next, the counter and the arrow keys stay gallery-only; the single item's wrapper styles, caption lift and fit callback are gone; a click on a single photo's band leaves the viewer open; the record's single-item rule, its exceptions and the caption state match the description's quote; the caption double-click line; FR1's record cell is the widest in its column; the History's last merge brings only the lower pull request's record line; the line counts are exact; the removed zoom options are reachable only from Lightbox; no new public API, data attribute, prop or default.
- Verified (#9810): the size and line counts; the record bullets and their quotes; the scope names
useTruncation; the three dropped data attributes appear nowhere; the caption's eight elements; the new History bullet; the API delta bullets, including the internal after-layout observer and no content watcher of the viewer's own. - Covered by cases but not run at this head: contrast in every shipped theme, the single-caption and captioned-video cases, the band, gap and double-click cases, the cursor case, the layout traces.
- Not checkable here: runs on trees not in the repository, the bundle-size figures, the screenshot matches, the contrast table and the device results.
- Changesets: the gallery-band,
isExpandedand single-photo entries match the code; the single-photo entry names a photo while a single video changes too, which is narrower than the change. - Files (#10284, all 15):
Lightbox.spec.mdcarries a non-blocking note;Lightbox.tsx,useZoomCore.ts,useZoomStage.ts, the changeset, the story,en.json,Lightbox.doc.mjsand the seven test files: clear. - Files (#9810, all 26):
Lightbox.spec.mdcarries two non-blocking notes,Lightbox.tsxthree andLightboxViewport.a11y.browser.spec.tsone;useTruncation.ts,useTruncation.doc.mjs,sharedResizeObserver.ts, the two changesets, the story,Text.spec.md, the runtime and boundary records,en.json,Lightbox.doc.mjsand the other test files: clear.
| close (FR8) are not built for a mouse, a pen or a trackpad: a drag on a | ||
| fitted photo does nothing. | ||
| On a desktop, a click in the viewer outside the photo and the caption band closes it. | ||
| Implementation gap: beside a photo scaled down to fit, a click within the band as wide as the photo's natural width stays open. |
There was a problem hiding this comment.
Non-blocking: the click area beside the photo is as wide as the photo's natural width or its caption, whichever is wider (Lightbox.tsx:1201-1206), and main's own case pins the caption half (LightboxFinePointer.a11y.browser.spec.ts:945, "stays open within it, as on main"). So under a caption that fills the band, a click level with the photo stays open even when the photo is not scaled down, though line 97 says it closes. A wording that covers both:
| Implementation gap: beside a photo scaled down to fit, a click within the band as wide as the photo's natural width stays open. | |
| Implementation gap: beside the photo, level with it, a click within the photo's natural width or its caption's width stays open. |
kentonquatman
left a comment
There was a problem hiding this comment.
Design looks good 👍
|
/approve-spec 439bd0c |
There was a problem hiding this comment.
Approved pending CI. CI has not run its jobs on this head yet: it is a draft, and CI runs once it is marked ready for review. There are no blocking findings, and an engineering owner approved the Lightbox record text (the single-item caption rule, the caption state, the settled media-surface rule and the caption double-click note) at this exact head.
- Non-blocking: the new double-click note says a mouse does not select a caption's text "with zoom", but a single caption cannot be selected without zoom either, so dropping "With zoom," from that half would match what ships.
Claims and files checked
- Verified: a single photo or video shows its caption in the gallery's band at the bottom of the viewer, with the photo centred in the box above it (browser captures; unit cases that fail on the base and pass here).
- Verified: before, the single caption sat bare under the photo with no backing and showed a long caption in full with no "more" (base captures).
- Verified: the caption keeps at least 4.5:1 on the band (measured 17.2:1 in the default theme in light mode, against 4.00:1 on the base).
- Verified: a single photo renders as the track's only page with the gallery's photo box and band, and its own wrapper, caption lift and fit callback are gone.
- Verified: only paging, Previous and Next, the counter and the arrow keys stay gallery-only.
- Verified: a click on a single photo's band leaves the viewer open, and with zoom a double-click on its caption zooms the photo (desktop probes).
- Verified: the record's single-item rule, its exceptions and the caption state match the description's quote, and the line counts and their split are exact.
- Verified: the docs, string descriptions, changeset and new long-caption story follow the change, and the message ids are unchanged.
- Verified: no public API, data attribute, prop, type or default is added or changed (built API surfaces match), and the removed zoom option and member are reachable only from Lightbox.
- Verified: the core typecheck, strict lint on the changed files and the knowledge check pass, and the Lightbox unit files pass at this head.
- Verified: the merge onto
mainkeeps this pull request's own patch identical, its one import conflict keeps both removals, and every commit the History names is in this head's history. - Verified: the gallery renders the same pixels before and after.
- Verified: the earlier owner approval the description links exists; the explicit desktop decision is the owner's later comment on this pull request.
- Not run here: the browser interaction and accessibility specs (single caption, contrast in every theme, caption double-click), the other unit and record-reading tests the description counts, and repeat runs of the tap after a drag to close (one run passes).
- Not checkable here: the device and simulator results (the side-by-side at this head is stated as pending), the bundle-size figures and the screenshot matches at earlier heads.
- Changeset: matches the code; it names a single photo while a single video's caption moves too, which is narrower than the change.
- Files (all 15):
Lightbox.spec.mdandLightbox.tsxeach carry a non-blocking note; the changeset, the story,en.json,Lightbox.doc.mjs,useZoomCore.ts,useZoomStage.tsand the seven test files: clear.
|
Decision: D-20261113-058 Carries the owner's single-photo caption pass to 439bd0c: a real-phone farm side-by-side against her passed head 34f0792 found no major difference on iPhone and Pixel. The Android set at this head is now all on emulators (normal and slow settings on the M5 emulator, reduced motion on a devserver emulator), all cells pass and are verified by Code Quality with a spot check, so the AST-094 DEC-27 requirement is met and nothing further is required on the device side. |
Batch: B7 Lightbox
A single photo now shows its caption in the gallery's band.
User impact
Before, a single photo's caption sat under the photo with no backing, unlike a gallery's band. Now it uses the gallery's band, so the caption, its backing and the photo's place match. The caption keeps 4.5:1 contrast on the band's backing.
Problem and solution fit
A single photo now renders as the track's one page, with the gallery's photo box and band. Only paging stays a gallery's.
Expected behavior and authority
component:LightboxFR1b, as the record states it:Exceptions: a single photo has no Previous, Next, Counter or paging. A drag past a zoomed single photo's edge rubber-bands and returns (FR6). The design owner approved the long caption's desktop behavior at 5eddce8 (
/approve-spec).What changed
Lightbox.tsx: a single photo is the track's one page, with the gallery'spageMediabox and band. Its own wrapper, caption lift and fit callback are gone.isGallerygates only the pager, Previous and Next, the counter and the arrow keys.en.json's notes and a new "Single with long caption" story follow.Lightbox.spec.md: FR1b and the "Captioned media" state cover one item or a gallery.Scope
Writing rubric results
Testing
At 439bd0c, on main b300313, which carries #9810, core
tscis clean, strict ESLint has no warnings on the changed files, andpnpm check:knowledgepasses. The Lightbox, Text, touch hit area, observer and motion unit files pass 1,294/1,294. The tests that read the changed records pass: 38 inuiand 905 innode. In CI's profile (a 4-CPU container, 1 worker), the Lightbox interaction specs pass 154 (4 skips) in Chromium and 146 (12 skips) in WebKit. The Lightbox and Text a11y specs pass 84 in Chromium, main's audit spec included, and 69 (2 skips) in WebKit. Run on main b300313 with this pull request's test files, three proofs fail. The single captioned video unit case fails there. So do the double-click case in both engines and theLightboxSingleCaptionspec, 8 of 8 in both engines. All pass here. The tap after a drag to close passes 5 of 5 runs here.A device side-by-side at 648c343 found no difference from 34f0792 in the caption's behavior. It ran on an iPhone 14 (iOS 26.2 Safari), a Pixel 8 (Android 17 Chrome) and desktop Chromium. It covered the caption's open and close, paging, the single photo and the desktop clicks. One difference comes from main's #11247: in an open viewer, Ctrl+Tab and Meta+Tab now pass to the browser; Alt+Tab still stays in the viewer. The cursor fix after it changes only the mouse cursor. This head's merge changes
Lightbox.tsx, which this pull request also changes, so that run does not carry (spec:AST-094DEC-31). A side-by-side at 439bd0c, against 34f0792, ran on an iPhone 14 and a Pixel 8, in normal and reduced motion. The band on its backing, "more" and "less", and the photo box matched at both heads. One pinch under Remove animations reached 944 × 630 px here and 957 × 638 px there, one take each. Normal-motion pinches matched. The stories' photos did not load on the phones. The Pixel's photo reads used same-size generated images, and the iPhone's pinch had no photo to zoom.Side by side: a single photo beside a gallery's first page, with the same photo and caption. They are shown at 390 px and on a desktop, in light and dark. The band, the text, "more" and the photo's box match; only the gallery's counter and Previous/Next differ.
A short caption sits centred in the same band:
iPhone 17 Pro simulator (iOS 26.2, Safari): a single photo, then a gallery's first page with the same photo and caption. The third shot opens the single photo's caption with "more":
Zoomed by a pinch, the photo fills its box and the band stays put; with no caption, the photo box fills the viewer:
Light mode: a single photo's caption keeps 4.5:1 on its backing in every shipped theme. On feat(Lightbox): a gallery's caption sits in a two-line band #9810's build it sits on the light page's overlay with no backing, at 2.60 to 4.00:1 in six themes, and those cases fail there.
Red first: the
LightboxSingleCaptionspec checks the band against a gallery's, "more" and "less", no band without a caption, and no paging controls. It failed 8/8 in Chromium before the rework onto the band. It passes at this head in both engines.Gallery unchanged: this pull request leaves the gallery's pixels alone. When the rework landed, 30 of 30 gallery screenshots matched the build before it, in Chromium.
Screenshots at 648c343: Chromium screenshots of 45 states matched 07d4ce9 byte for byte. They covered the gallery at phone and desktop sizes and both single-photo stories, with the caption clamped and open.
Record notes
History
en.jsonchanges add only@astryx.tabBar.more.[data-lightbox-media] > :first-child.isExpandedchange and its merges of main: vjeux@b7d1fd4. One import line keepsobserveResizeAfterLayoutalone. This pull request's own lines against feat(Lightbox): a gallery's caption sits in a two-line band #9810 are unchanged.#10829and#8078: vjeux@c987368. This pull request's own lines against feat(Lightbox): a gallery's caption sits in a two-line band #9810 are unchanged.git merge-tree --write-tree --merge-base=e4b4eaf0a3 b300313cbd 7282678b37, this pull request's own lines applied onto main. Its one conflict, inLightbox.tsx's imports, keeps both this pull request's and feat(Lightbox): a gallery's caption sits in a two-line band #9810's removals. The own diff's -U0 patch-id stays 48b004d29d70.Public and internal API delta
No new source modules, hooks, data attributes, props, types or defaults. The two caption message keys keep their ids; their descriptions now name a single photo too.
Lines (b300313..439bd0c): +823/−529 in all: source +239/−417 (178 fewer), tests +541/−103, and records, docs, the story, strings and the changeset +43/−9.
App-level size, with the size report's esbuild options: on the preview page alone, eager JS is 498 B gzip smaller than at #9810's head. With an app root (
ThemeandLayerProvider), it is 543 B smaller.useZoomCoredrops itsonFitChangeoption and itssetAtFitmember, anduseZoomStageno longer calls it. Only Lightbox imports either hook.useZoomCore({stageRef, surfaceRef, isEnabled, itemKey, onZoomedChange}), with noonFitChange.