Repository navigation
fix(Lightbox): a caption ending in a wide image no longer grows when the window widens - #11740
Conversation
… lines when the window widens An open caption reserves room for "less" with a float whose length comes from the caption's own height. A block image wider than the room beside that float cannot sit next to it, so it drops below the float. The caption's height then counts the float and the image, the float grows by the image's lines, and the caption grows again in the next delivery. Widening the window ran this loop until the text block was 17 lines tall. A fresh open ran it too: a 6-line caption got a float of about 19 lines. When a block-level box starts at the float's bottom edge, the caption now reads its lines once without the float a the flow while it stays open. "less" takes the line below the image. A caption with no such block takes the same path as before. Adds a regression spec: after widening, the open caption has the same line count as a fresh open at that width for 10 frames, and "less" sits below the image. Adds the CaptionEndingInWid Fixes meta#11598
|
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 | 360.9 kB (+646 B) · 2.4 kB CSS (0) | — | — · — · — |
| lab/Comments | 368.2 kB (+627 B) · 2.5 kB CSS (0) | — | — · — · — |
| Lightbox · Storybook | 145.7 kB (+587 B) · 11.9 kB CSS (+13 B) | 5,046 (+371) | ✓ · ✓ · ✓ |
Package size: @astryxdesign/core 7.57 MB packed (+3.8 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.
Changes requested: the fix works (an open caption that ends in a wide block image keeps its lines when the window widens, "less" sits below the image, and the two new tests fail without the fix and pass with it), but one change is needed before approval:
measureCaptionLineshides the toggle's place, reads the caption's height, restores the place and then readsscrollHeightin the same resize delivery (Lightbox.tsxlines 1024–1027 and 1069–1072), which forces two extra page layouts each time such a caption opens and breaksreact-component-runtimeINV18's "never interleaved with writes", so please count the text's lines from reads alone (for example aRangeover the caption text plus the block's height) and extend the existing "no caption read follows a write in the same resize delivery" test to the new story.
A wording fix for the comment at lines 1007–1009 is suggested inline, and CI has not run on this head yet, so a maintainer adds the ci:run label for it to run.
Claims and files checked
- Changeset, the open caption keeps its lines when the window widens: verified (new tests fail without the fix and pass with it; 8 lines in each of ten frames after 360 → 362 px, against 17 to 21 before).
- Changeset, "less" takes the line below the image: verified (its top meets the image's bottom; new test).
- Description, a fresh open was also oversized: verified (a 12-line float for six text lines at 360 px; the exact count depends on fonts).
- Description, the line count after the fix matches a fresh open: verified; here 8 lines at 362 px and 7 at 420 px rather than 7 at every width, which depends on fonts.
- Description, captions without a block at the float's edge keep the previous path: verified (identical frames for a plain caption and the clamped caption; existing caption suites pass).
- Description, right-to-left holds: verified for the open state.
- Description, no new public API, data attribute, default or interaction model: verified (built API surface unchanged by this change).
- Description, the place stays off until the caption closes: verified in code.
- Description, unit and viewport tests pass: verified in Chromium (175/175 and 37/37); WebKit not run.
- Description, lint and formatting clean: verified (eslint, prettier, changeset check).
packages/core/src/Lightbox/Lightbox.tsx: the blocking finding above, plus the comment suggestion.packages/core/src/Lightbox/LightboxViewport.a11y.browser.spec.ts: clear.apps/storybook/stories/Lightbox.stories.tsx: clear..changeset/lightbox-an-open-caption-that-ends-in-a-block-im-2vsm.md: clear.
The wide-block-image measure hid the toggle's place, read the flow, and restored it, which forced extra layouts in the resize delivery. It now reads the text before the block with a Range and the height below the block's top, so no read follows a write. The no-late-read test covers the wide-image story and now sees writes to an element's style display. Also rewords the place-off comment to match the known limitation. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
There was a problem hiding this comment.
Changes requested. The fix works for the wide-image caption (it keeps its lines when the window widens, "less" sits below the image, and the two new tests fail without the fix and pass with it), and the earlier forced-layout issue is fixed, but two changes are needed:
- Miss:
measureCaptionLinestreats any block whose top meets the toggle place's bottom as pushed below it, so a caption that ends in a block shorter than half a line (an empty block, a thin rule, a 1×1 image) now moves "less" off its last line, grows by a line and raises "ResizeObserver loop completed with undelivered notifications" on open and close; please count the block as below the place only when its top lies below the end of the text before it (Lightbox.tsxlines 1014–1025). - Miss:
isCaptionPlaceOffstays true into the render that closes the caption, so every "less" on the new story raises one ResizeObserver loop error; usingisCaptionOpen && isCaptionPlaceOffforhasCaptionTogglePlaceand the padding style (lines 1804–1805 and 2020–2024) removes it, and the new tests can add the existing loop-error check.
With both corrections, the short-block captions match the base and the new tests still pass. CI has not run on this head yet; a maintainer adds the ci:run label for it to run.
Claims and files checked
- Title and changeset, an open caption ending in a wide block image keeps its lines when the window widens: verified (8 lines in every frame after 360 → 362 px, against 14 climbing to 21 before).
- Changeset, "less" takes the line below the image: verified (its top meets the image's bottom; new test).
- Description, a fresh open on the base was oversized: verified (14 lines for six lines of text at 360 px; the count cycles and depends on fonts).
- Description, after the fix the count matches a fresh open at each width: verified (8 lines at 360–362 px and 7 at 420 px here, rather than 7 at every width).
- Description, right-to-left holds: verified.
- Description, plain-text, small block image and inline-image captions keep their float state and line counts: false for a block shorter than half a line (first finding); verified for plain text, an inline image and a 40×40 block image.
- Description, the two new tests fail without the fix and pass with it: verified in Chromium; WebKit not run here.
- Description, the unit tests and the Lightbox viewport spec pass: verified in Chromium (175 of 175, 37 of 37).
- Description, resizing the caption shapes raises no ResizeObserver errors: verified for the resize steps tried; the errors in the findings come from opening and closing.
- Description, tsc, eslint, prettier and the repository checks are clean: verified for tsc and prettier, and for eslint with no errors and one warning in the new test proxy; the repository checks pass up to the executable-bits step, which needs a git checkout that was not available.
- Description, no new public API, data attribute, default or interaction model: verified (built surfaces unchanged).
- Description, the place stays off until the caption closes: verified in code.
- Description, draft #11539 edits the same measure: verified.
packages/core/src/Lightbox/Lightbox.tsx: the two findings above, plus two comment wording suggestions.packages/core/src/Lightbox/LightboxViewport.a11y.browser.spec.ts: clear.packages/core/src/Lightbox/__tests__/LightboxPaging.interaction.browser.spec.ts: clear.apps/storybook/stories/Lightbox.stories.tsx: clear..changeset/lightbox-an-open-caption-that-ends-in-a-block-im-2vsm.md: clear.
…losing render A trailing block shorter than half a line no longer turns the toggle's place off, and the place-off state applies only while the caption is open. Adds a short-block story and loop/position specs.
There was a problem hiding this comment.
Changes requested. The fix works for the story's caption: an open caption that ends in a wide block image now keeps the line count a fresh open gives when the window widens, "less" sits on its own line under the image, the wide-image tests fail without the fix and pass with it, and both earlier findings (short trailing blocks and the closing render) are fixed. One change is needed:
- Miss: when the trailing block is taller than about a line and a half (a full-width image, say), every "more" still raises "ResizeObserver loop completed with undelivered notifications" and shows one frame of a taller caption with a blank gap, because
countOpenCaptioncounts the block's lines into the toggle's place and the first resize delivery then turns the place off and changes the caption's height (Lightbox.tsxlines 1057–1062); deciding the place's state in the click path, and running the new loop-error test on a block taller than two lines, would fix it.
Please also bring the description up to date with the second story and the five new viewport cases. CI has not run on this head yet; a maintainer adds the ci:run label for it to run.
Claims and files checked
- Changeset, an open caption ending in a block image wider than the room beside "less" keeps its text lines when the window widens instead of growing every frame: verified (7 lines in every frame after 360 → 362 px and 6 at 420 px, matching a fresh open; before the fix it climbs from 14 to 21).
- Changeset, "less" takes the line below the image: verified (new test; frames at 360 px in both directions).
- Description, the block drops below the float and its lines lengthen the float, so a fresh open was already oversized: verified (before the fix the caption climbs a line per frame from the first open).
- Description, a caption with no block at the float's bottom edge takes the previous path: verified in code (
Lightbox.tsxlines 1012–1025) and by probes. - Description, no new public API, data attribute, default or interaction model: verified (built surfaces unchanged).
- Description, the float stays off while that caption is open: verified in code (line 1011).
- Description, after the fix the count matches a fresh open at each width, in left-to-right and right-to-left: verified (7 lines at 360–362 px and 6 at 420 px here, rather than 7 at every width).
- Description, plain-text, small block image and inline-image captions keep their float state and line counts: verified (plain text through the existing spec; 40×40, 1×1, inline and inline-block images and a short block match the earlier behavior).
- Description, the two new wide-image cases fail without the fix and pass with it: verified in Chromium; WebKit not run here.
- Description, the Lightbox unit tests pass (175 of 175): verified.
- Description, the viewport spec passes: verified in Chromium, 40 of 40 at this head (the description's 74 predates the last commit).
- Description, eight caption shapes resize with no ResizeObserver errors: false for the tall wide image, which raises one on each "more" (the finding above); verified for 16 px and 30 px images and the unchanged shapes.
- Description, tsc, eslint, prettier and the repository checks are clean: prettier clean; eslint has no errors and one warning in the new style proxy; the Core build type-checks
Lightbox.tsx; the changeset check passes; the full repository checks were not run here. - Description, draft #11539 also changes
measureCaptionLines: verified. packages/core/src/Lightbox/Lightbox.tsx: the finding above, plus three comment wording suggestions.packages/core/src/Lightbox/LightboxViewport.a11y.browser.spec.ts: clear.packages/core/src/Lightbox/__tests__/LightboxPaging.interaction.browser.spec.ts: clear (one lint warning).apps/storybook/stories/Lightbox.stories.tsx: clear..changeset/lightbox-an-open-caption-that-ends-in-a-block-im-2vsm.md: clear.
…esize delivery The open caption's count reads the flow without the toggle's place. It now also decides there whether the place, shown with the flow's lines, would push a block down: a block-level replaced element or a box with its own formatting context that is wider than the room beside the place. Then the place stays off from the first frame, so the first resize delivery finds the caption at its final size. A width change after the open that pushes a block below a shown place turns the place off in the next frame, not inside the delivery. A story ends a caption in a tall image, and the browser tests check it for a loop error and for a taller frame after "more". Co-authored-by: ahmed-technyx <[email protected]>
|
/approve-spec de143e0 |
There was a problem hiding this comment.
Changes requested: an open caption that ends in a wide block image now keeps a fresh open's line count, with "less" under the image and no ResizeObserver loop error, but the new open-time check regresses captions that end in a flex row.
- Blocking: a caption that ends in a flex row, a
flow-rootbox or another box with its own formatting context now drops "less" to a line of its own and grows by a line (7 → 8 lines at 360 px), becausekeepsClearOfFloatsandwouldPlacePushBlock(Lightbox.tsx:621-627,:658) treat such a box as pushed below the place, while an auto-width one narrows beside it, as it does onmain.
Testing the width only of replaced elements at open (the resize check still catches anything the place really pushes down) and adding a flex-row case next to the short-block test would fix it; the inline comments have the details. As the description's known limitation says, widening the window after opening still keeps "less" on its own line.
Claims and files checked
Claims:
- An open caption that ends in a wide block image no longer grows when the window widens: verified (a 400 × 16 image at 360 px climbs from 165 to 405 px over ten frames on
mainand holds at 189 px here). - A fresh open on
mainis oversized too: verified (it climbs from the first frame). - "less" takes the line below the image: verified (its top meets the image's bottom, in both directions).
- Short trailing blocks keep "less" on the last line: verified (a 2 px block and a 400 × 8 image render as on
main). - A caption with no block at the float's bottom edge takes the previous path: false for a flex-row or flow-root ending (the blocking finding).
- No new public API, data attribute, default or interaction model: verified (built API surface and source).
- Three new stories, opened by the new tests: verified.
- Once off, the place stays off while the caption is open: verified (the known limitation).
- Every width matches a fresh open, left to right and right to left, and closing raises no loop error: verified (the line counts depend on fonts: 8, 8 and 7 here at 360, 362 and 420 px).
- Plain-text and small-block captions are unchanged: verified; inline images not checked.
- A tall trailing image opens at its final height with no loop error: verified for 40, 120 and 225 px images.
- A later width that pushes a block down turns the place off in the next frame: verified (a 330 px image from 420 to 360 px, no error).
- The Lightbox unit suite passes, 175 of 175: verified.
- ESLint and Prettier are clean on the changed files: verified (one lint warning in a test file).
- The browser specs pass in Chromium and WebKit, the repository checks pass, and the other browser failures predate the change: not re-run; CI has not run on the draft.
- Changeset: such a caption keeps its lines when the window widens, and "less" takes the line below the image: verified.
Files:
packages/core/src/Lightbox/Lightbox.tsx: the blocking finding; two comment suggestions.packages/core/src/Lightbox/LightboxViewport.a11y.browser.spec.ts: clear (no case for a flex-row ending).packages/core/src/Lightbox/__tests__/LightboxPaging.interaction.browser.spec.ts: clear.apps/storybook/stories/Lightbox.stories.tsx: clear..changeset/lightbox-an-open-caption-that-ends-in-a-block-im-2vsm.md: clear.
| // Whether a block in the open caption sits below the toggle's place, as a | ||
| // wide image does. The place then makes the caption taller, and the taller | ||
| // caption makes the place longer, so the place is not shown and the toggle | ||
| // takes the line below the caption. |
There was a problem hiding this comment.
Non-blocking (comment style): the second sentence has 31 words and a passive "is not shown". Suggested:
// Whether the toggle's place would push a block in the open caption below
// it, as a wide image. The place then makes the caption taller, and the
// caption makes the place longer. So the place stays off, and the toggle
// takes a line of its own under the caption.… off A block with no set width narrows to sit beside a float, so a caption that ends in a flex row or a block that clips its overflow keeps "less" beside it, as before. Only a block-level replaced element, such as an image, keeps its width and drops below the place. Stories end captions in a flex row and a clipped block, and tests check that "less" stays beside them. Lightbox's record names why its caption measurement is its own, and a test's style proxy states its return type. Co-authored-by: ahmed-technyx <[email protected]>
Two captions end in a block with a layout of its own: a flex row, and a block that clips its overflow. Such a block narrows beside the toggle's place, so "less" takes a line of its own only where it does not fit beside the last line, as with plain text. The sweep widens an open caption from 360 px to each width that leaves its text one line fewer. It fails where "less" leaves its place or moves a word.
|
/approve-spec 04ad951 |
There was a problem hiding this comment.
Changes requested: the caption fix checks out, but the record edit needs its writing-rubric results. An open caption that ends in a wide block image now holds its height from the first frame, with "less" on its own line under the image and no ResizeObserver loop error, and every earlier blocking finding is fixed.
- Blocking: the pull request adds PR2 to the Lightbox record (
docs/specs/components/Lightbox/Lightbox.spec.md:210-215), and the knowledge-contracts record requires a pull request that changes a record to report the writing rubric's results in its description under## Writing rubric results, which this description does not have.
PR2 reads clean against the rubric, so seven short lines will do; the inline comment has a draft. While editing the description, its Testing section says #11539 lands first, which contradicts the land path at the end.
Claims and files checked
Claims:
- Changeset: such a caption keeps its text lines when the window widens instead of growing every frame: verified (the new widening case fails on the base and passes here; a 400 × 16 image holds 201 px where the base climbs to 465 px).
- Changeset: "less" takes the line below the image: verified (its top meets the image's bottom, in both directions).
- A fresh open on the base is oversized too: verified (it climbs from the first frame).
- Short trailing blocks keep "less" on the last line: verified (a 2 px block renders as on the base).
- Captions with no block at the float's bottom edge take the previous path: verified (plain, flex-row, clipped-block, inline-image and flex-with-image endings are pixel-identical to the base).
- Only a block-level replaced element turns the place off at open, and flex rows and clipped blocks narrow beside "less": verified (code, six viewport cases, two width sweeps).
- A tall trailing image opens at its final height with no loop error: verified (289 px in every frame; the base cycles between 256 and 524 px).
- A later width that pushes a block below a shown place turns the place off in the next frame: verified by reading the code.
- Once off, the place stays off while the caption is open: verified (the known limitation).
- No new public API, data attribute, default or interaction model: verified (built API surface and source).
- New stories that the tests open: verified (five stories and two fixtures).
- Failures without the fix: 5 of the 13 new viewport cases fail on the base.
- Lightbox unit suite, 175 of 175: verified.
- Browser specs pass: verified in Chromium (48 viewport and 35 paging cases); WebKit not run; "74 of 74" counts an earlier head.
- TypeScript, ESLint, Prettier and the knowledge check are clean: verified.
- Other Lightbox browser failures predate the change: not checked; CI has not run on the draft.
- The new PR2 record clause: present and approved by an engineering owner at this head; its rubric results are missing (the blocking finding).
- #11539 lands first: contradicted by the description's own land path; #11539 is still an open draft.
Files:
docs/specs/components/Lightbox/Lightbox.spec.md: the blocking finding (rubric results missing from the description).packages/core/src/Lightbox/Lightbox.tsx: clear; one comment suggestion still open.packages/core/src/Lightbox/LightboxViewport.a11y.browser.spec.ts: clear.packages/core/src/Lightbox/__tests__/LightboxPaging.interaction.browser.spec.ts: clear.apps/storybook/stories/Lightbox.stories.tsx: clear..changeset/lightbox-an-open-caption-that-ends-in-a-block-im-2vsm.md: clear.
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet because the pull request is a draft, and marking it ready for review starts the run (it already carries ci:run). An open caption that ends in a wide block image now holds its height from the first frame, with "less" on its own line under the image, and the writing-rubric results for the Lightbox record's new performance clause are now in the description and match the clause.
- Optional: the Testing section's "74 of 74" and the Evidence section's "not confirmed yet" describe an earlier head; the round 2 counts and the red-then-green run are the current ones.
Claims and files checked
Claims:
- Title and changeset: a caption ending in a wide block image keeps its text lines when the window widens instead of growing every frame: verified (the widening case fails on the base and passes here).
- Changeset: "less" takes the line below the image: verified (its top meets the image's bottom, in both directions).
- A fresh open on the base is oversized too: verified (the base climbs from the first frame).
- The diagnosis (the float's length counts the block's lines, so each measure lengthens it again): verified by reading the code.
- Short trailing blocks keep "less" on the last line: verified (the 2 px block case passes on both trees).
- Captions with no qualifying block take the previous path: verified (plain, flex-row, clipped-block and inline-image endings render pixel-identically to the base).
- Only a block-level replaced element turns the place off at open, and flex rows and clipped blocks narrow beside "less": verified (code, six viewport cases, two width sweeps).
- A tall trailing image opens at its final height with no loop error: verified (the per-frame height case and the loop-error case).
- A later width that pushes a block below a shown place turns the place off in the next frame: verified by reading the code.
- Once off, the place stays off while the caption is open: verified (the known limitation).
- Expected behavior follows the issue and the Lightbox record's inline-toggle clause: verified.
- No new public API, data attribute, default or interaction model: verified (built API surface and source).
- New stories that the tests open: verified (five stories and two fixtures).
- The record's new performance clause says why the measurement is Lightbox's own: present, and approved by an engineering owner at this head.
- Writing rubric results R1 to R7: verified against the clause's text.
- Lightbox unit suite, 175 of 175: verified.
- Viewport 48 of 48 and paging 35 of 35: verified in Chromium; WebKit not run; "74 of 74" counts an earlier head.
- Failures without the fix: 5 of the 13 new viewport cases fail on the base.
- TypeScript, ESLint, Prettier and the knowledge check are clean: verified.
- The repository check and the eight-shape manual sweep: not checked.
- Other Lightbox browser failures predate the change: not checked; CI has not run on the draft.
- This pull request lands before #11539: consistent throughout the description; #11539 is still an open draft.
Files:
packages/core/src/Lightbox/Lightbox.tsx: clear; two comment-style suggestions.packages/core/src/Lightbox/LightboxViewport.a11y.browser.spec.ts: clear.packages/core/src/Lightbox/__tests__/LightboxPaging.interaction.browser.spec.ts: clear.apps/storybook/stories/Lightbox.stories.tsx: clear.docs/specs/components/Lightbox/Lightbox.spec.md: clear (approved clause; rubric results in the description)..changeset/lightbox-an-open-caption-that-ends-in-a-block-im-2vsm.md: clear.
<!-- codebunny-mode: same-head; reason: none -->
Fixes #11598
User impact
Anyone using a
Lightboxgallery whose caption ends in a block-level box that is wider than the room beside "less", such as a full-width image. They open the caption with "more" on a narrow screen. Widening the window, for example by rotating a phone, makes the caption's text block grow by a line every frame. In the issue's repro it reached 17 lines, and "less" ended up off the line the layout reserves for it. A fresh open of the same caption is also wrong: a 6-line caption was given a float of about 19 lines.Problem and solution fit
-webkit-line-clamp) comes from the caption's measured height. A block image wider than the room beside the float cannot sit next to it, so it drops below the float. The next measure then counts the float's lines plus the image's, and that count becomes the float's new length. Each delivery adds the image's lines, so the caption grows without end. The existing shrink path cannot stop it, because it reads the same inflated flow height.The fix removes the feedback. When a block-level box starts at the float's bottom edge, the caption reads its lines once without the float, so the count no longer includes the float. It then keeps the float out of the flow while the caption is open, and "less" takes the line below the image. That is the outcome the issue asks for.
A block that starts at the float's bottom edge only because the text ends on the float's last line (an empty block, a thin rule, a 1×1 image) is not pushed down by the float. The caption leaves those alone: the float stays on, and "less" stays on the last line. The float turns off only when the block's top is more than half a line below the end of the text.
Expected behavior and authority
docs/specs/components/Lightbox/Lightbox.spec.mdFR1: the caption's "more"/"less" toggle is an inline action that flows with the caption text, and the full caption opens in full over the bottom of the Media.Smallest restoration
Lightbox.tsx: one new check in measureCaptionLines, a captionPlaceOff state, and one style, captionTextToggleOwnLine. The place is shown only while the caption is open (isCaptionOpen && isCaptionPlaceOff), so the closing render does not lay out without it. A caption with no block at the float's bottom edge takes exactly the previous path.data-*attribute, visual representation, default or interaction model.Evidence
CaptionEndingInWideImage, Chromium at 360×874 with touch. Open the viewer, tap "more", then widen to 362px. The text block grows every frame (14 lines in the new spec, climbing in the manual trace). A fresh open at 360–420px gives a float of 18–20 lines for 6 lines of content.The count of failures without the fix is not confirmed yet. Re-run those specs against a build without the fix, then state it here.
Scope
Components: Lightbox
Testing
pnpm exec vitest run packages/core/src/Lightbox --project ui: 175 of 175 pass.pnpm storybook:build, thenpnpm exec playwright test --config playwright.config.ts packages/core/src/Lightbox/LightboxViewport.a11y.browser.spec.ts: 74 of 74 pass in Chromium and WebKit.ResizeObservererrors. The shapes were plain text, small block image, inline image, wide block image, tall wide image, image mid-caption, two wide images, and a short caption plus a wide image.tsc, eslint and prettier are clean on the changed files, andpnpm check:repopasses.LightboxFinePointerfocus-ring width (Chromium and WebKit), the WebKit "less" focus check inLightboxKeyboard, and about two dozen zoom, dismiss and frame-timing checks in the interaction suite. CI on Linux should confirm that.measureCaptionLines. This pull request lands first, as a fix for a shipped regression; fix(Lightbox): an open caption shrinks without a forced layout #11539 then mergesmainand resolves the overlap.Writing rubric results
R1 narration: none; PR2 states in the present tense why the caption's measurement is Lightbox's own.
R2 research: none in the record; the browser measurements stay in this description.
R3 evidence: PR2 names a record and a module, not a pull request, issue or commit.
R4 rejected alternatives: none added.
R5 change references: none.
R6 open questions: none added; the record's open questions are unchanged.
R7 project status: none; the follow-up to extend
useTruncationis tracked outside the record.Maintainer round 1 (fix loop, lane 4)
Credited maintainer edits on top of @mahmed74's commits. The fix, its diagnosis and the wide-image and short-block cases are @mahmed74's; this round adds the tall-block case.
CaptionEndingInTallImagestory; it joins the loop-error cases, and a new case reads the caption's height in each frame after "more" and checks that no frame is taller than the final one.pnpm exec vitest run packages/core/src/Lightbox: 175 of 175 pass.tscand eslint are clean.LightboxViewport.a11y.browser.spec.ts42 of 42 andLightboxPaging.interaction.browser.spec.ts33 of 33 pass.mainwith this head's story file):mainthe caption box is 19 lines tall and stays 19 after the widen.mainshows a 465 px box with blank space.mainnever settles (337 → 433 → 524 → 256 → …, 162 loop errors in about 2.5 s).mainMaintainer round 2
mainkeeps it beside the last line.main. A box that is pushed down later, at a new width, is still caught by the contributor's check in the resize delivery and handled in the next frame.main), committed under @vjeux's name; and two stories (CaptionEndingInFlexRow,CaptionEndingInClippedBlock) with cases at 362, 400 and 420 px that check "less" stays beside the last block.useTruncationreports only whether a clamped block overflows, and no shared engine counts an unclamped block's laid-out lines or places an inline float beside its last line (architecture:react-component-runtimeINV19).pnpm exec vitest run packages/core/src/Lightbox: 175 of 175 pass;tsc, eslint with no warnings, Prettier andpnpm check:knowledgeare clean.LightboxViewport.a11y.browser.spec.ts48 of 48 in Chromium and in WebKit (the flex-row and clipped-block cases at 362, 400 and 420 px included);LightboxPaging.interaction.browser.spec.ts35 of 35 in Chromium, and in WebKit 31 pass with 4 skipped (those 4 are Chromium-only by their own declaration). @vjeux's two sweep cases pass in both engines here; on round 1 they fail in both engines from 362 px, and onmainthey pass.main. The wide-image and tall-image results match round 1.Co-authored-by: ahmed-technyx
Owner: fix-loop lane 4 (maintainer carry). Land path: lands before #11539 (a shipped regression); after the real-browser runs and stills, Specs, CodeBunny, CI, and the drain merges.