Skip to content

chore(Lightbox): a preview of custom items, a title bar and a footer (not for merge) - #11997

Draft
vjeux wants to merge 1 commit into
meta:mainfrom
vjeux:lightbox/proposal-preview
Draft

vjeux wants to merge 1 commit into
meta:mainfrom
vjeux:lightbox/proposal-preview

Conversation

@vjeux

@vjeux vjeux commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Preview, not for merge. It shows the Lightbox item model and chrome that a spec amendment to component:Lightbox proposes, so reviewers can try them on a phone. The spec pull request for this amendment is #11999. After the spec owner decides, maintainers either close this or use it as the built pull request's base.

Primary intent

A demo for the proposed component:Lightbox amendment. The decision is the spec's; this code exists only to show it.

User or maintainer impact

The demos are three stories under Core/Lightbox/Proposal (preview) in this pull request's Vercel preview, for a phone or a desktop:

  • Custom items paging and closing by drag.
  • Each item's title, origin and actions, and the filmstrip.
  • The zoom control.

Problem and solution fit

The behaviors in the spec are gestures, so a static description cannot show them. The prototype follows the record:

  • A custom item, {type: 'custom', content, label}, renders in the photo's place. It pages and closes by drag as a fitted photo does, with zoom off.
  • A drag that starts on the content's own controls stays the content's. So does one that starts in content that can still scroll the way the drag goes. The check crosses shadow roots, so a field's inner editor counts.
  • Keys inside the content, on a field or a media element, or with a modifier, stay their target's.
  • An item's title names the dialog. Its subtitle and up to three actions join the top bar, and the counter leads the title there.
  • A footer holds LightboxFilmstrip and LightboxZoomControl, which read useLightboxGallery() and useLightboxZoom().

The custom item keeps the shape that #7400 (imdreamrunner) and #3937 (jiunshinn) proposed for issue #2486 (ernestt). This preview rebuilds it on current main to add the gesture rules.

Authority

None yet: the spec pull request holds the decision, pending the spec owner.

Change and evidence

  • Lightbox.tsx: the item union, the custom page, the drag and key boundaries, the top bar, and the footer with its values.
  • useZoomStage.ts: the dismiss drag takes an optional shouldBegin.
  • New: LightboxContext.ts (the two value hooks), LightboxFilmstrip.tsx and LightboxZoomControl.tsx. In the built version each comes from its own import.
  • LightboxProposal.stories.tsx: the three stories.
  • Strict lint reports 12 problems that a built version fixes. Most are the Zoom control's English strings, which need the i18n catalog. Five are the lint rule for React element type, which also matches the item union's type.

Scope

Components: Lightbox

  • This PR has one primary intent.
  • Independently removable deltas were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • Core typecheck: clean. Lightbox unit tests: 175 passed, unchanged.
  • A local Playwright check, not in this branch, ran in Chromium with a phone-sized viewport and touch input: 4 of 4 pass. It covers:
    • a swipe pages onto a custom item and on past it;
    • a drag that starts on its text field does not page;
    • a drag down in its scrolled list scrolls the list and does not close;
    • from the list's top, and on a custom item's frame, a drag down closes;
    • the title names the dialog, a filmstrip pick moves, and the zoom control zooms to 200% and back.
  • The same check ran in a Playwright 1.61.1 container, at this branch plus the check file. WebKit passed 12 of 12 (4 tests, 3 repeats each, no retries), and Chromium 4 of 4.

A prototype of the Lightbox item model and chrome that the
component:Lightbox record amendment proposes, so reviewers can try it
on a phone. Not for merge.

- Custom items (`{type: 'custom', content, label}`) page and close by
  drag as a fitted photo does; a drag on their controls, or in content
  that can still scroll, stays the content's.
- Each item's title, subtitle and up to three actions in a top bar.
- A footer with LightboxFilmstrip and LightboxZoomControl, read through
  useLightboxGallery and useLightboxZoom.
- Stories under Core/Lightbox/Proposal (preview).

The custom item follows the shape of an earlier proposal for content
items in Lightbox.
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 16, 2026 5:40am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 16, 2026
@astracat-bot

astracat-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 16, 2026, 6:13 AM UTC

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

This branch was successfully deployed

1 active deployment
Preview — bca0c2e5 Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant