Skip to content

fix(Lightbox): Close, Previous, Next and the counter always sit on the backing - #11179

Draft
vjeux wants to merge 3 commits into
meta:mainfrom
vjeux:fix/lightbox-controls-backing
Draft

vjeux wants to merge 3 commits into
meta:mainfrom
vjeux:fix/lightbox-controls-backing

Conversation

@vjeux

@vjeux vjeux commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Lightbox's Close, Previous, Next and counter always sit on its translucent dark backing, in a gallery and for a single photo, with or without hasZoom.

User impact

Without hasZoom, the controls sat straight on the backdrop or the photo: on a phone, a white chevron on a light photo. Now every viewer shows them one way, on Lightbox's backing with on-dark icons and text.

Visual authority

  • Existing component/module DD row reused or amended.
  • Durable component-local intent added to the optional Design decisions table by a team design owner.
  • Correction already settled by current family, design, theme, or objective accessibility authority.
  • New shared or cross-component direction settled in docs/design/.

The design owner asked for one look in every viewer. AR9 now states it, and a new DEC-5 records the decision. The record waits on the spec owner's /approve-spec.

Before and after

Each pair is one story, photo and state, before (main db3e833) and after (478a8da). Playwright drove Google Chrome 157.0.8103.50 (stable, headless) at 1024×768 and on a 375×667 touch phone, default theme, real photos. They match an earlier bundled-Chromium 149 set byte for byte.

State Before After
Desktop, light, gallery before after
Desktop, light, single photo before after
Desktop, dark, gallery before after
Desktop, dark, single photo before after
Phone, light, gallery before after
Phone, light, single photo before after
Phone, dark, gallery before after
Phone, dark, single photo before after

With zoom nothing changes: in that Chrome, 12 states of "Gallery with zoom", "With zoom" and "Zoom with caption" match main byte for byte, desktop and phone, light and dark.

State matrix

  • Contrast case: all seven shipped themes; a gallery and a single photo, each with and without zoom; Next hovered after a tap.
  • Stills: light and dark, desktop and phone, in the default theme.
  • Unchanged: zoom, paging, closing, the click-through layer, and right-to-left mirroring.

Scope

Components: Lightbox

  • Appearance is the primary intent.
  • Behavior, API, interaction model, and unrelated layout changes were removed or split.
  • The evidence shows the changed pixels actively running, not only source or computed styles.
  • Public text and artifacts contain no internal Meta context.

The spec owners asked for two done criteria:

  • One header path: Close, Previous and Next always sit in the backing span, with on-dark icons. The counter always takes its backing. hasZoom no longer appears in the header code. Its remaining uses are the prop, the click-through rule and the zoom target. One contrast case covers every viewer.
  • Fewer lines than main: Lightbox.tsx is −17 (+13/−30), the zoom spec +2 (+119/−117) and Lightbox.spec.md +12 (+21/−9), so −3 in all. The changeset adds 7 lines outside Lightbox's files.

Writing rubric results

  • R1 narration: none. AR9 and DEC-5 state present behavior.
  • R2 to R6: none.
  • DEC-5 quotes the design owner's words exactly, in the owner-direction form of component:Resizable FR8.

Testing

  • Red first: one contrast case runs for "Gallery", "Gallery with zoom", "Default" and "With zoom" in all seven shipped themes, 28 cases per engine. On main's build it fails 13 per engine at 1.0 to 1.14:1. Every case without zoom fails but the single photo in butter, whose theme fills its buttons. With zoom it passes there. At 478a8da all 28 pass in Chromium and WebKit.
  • Gates at 478a8da: core tsc is clean, strict ESLint has no warnings on the changed files, and pnpm check:knowledge passes. The Lightbox, IconButton and Button unit files pass 312/312. In CI's profile (a 4-CPU container, 1 worker), the Lightbox interaction specs pass 124 in Chromium (4 skips) and 119 in WebKit (9 skips). The Lightbox a11y specs pass 38 in Chromium, main's audit spec included, and 27 in WebKit (2 skips).

It touches Lightbox.tsx, so it merges after #9810 and #10284, with a merge of main once they land. It also rewrites AR9 and its row, which #10826 edits, so it merges after #10826 and keeps its caption sentence.

Public and internal API delta

None. No export, prop, type, default, hook, module or data attribute changes, and no new source file. hasZoom keeps its meaning and default. The change stays inside Lightbox.tsx's private styles and its private control() helper.

A white photo the shape of the screen lies under Close, Previous, Next
and the counter. The contrast case runs for a gallery and a single
photo, each with and without zoom, in every shipped theme.
Close, Previous, Next and the counter sit on Lightbox's translucent
backing with or without zoom, and their icons use the on-dark colour.
The header renders one way: the zoom-only wrapper, icon colour and
counter backing branches are gone.
AR9 states the controls' backing with or without zoom, in a gallery and
for a single photo. DEC-5 records the owner direction and the rejected
zoom-only backing.
@vercel

vercel Bot commented Nov 11, 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 11, 2026 7:10am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 11, 2026
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 11, 2026
@astracat-bot

astracat-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 11, 2026, 7:26 AM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 11, 2026
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 478a8da

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 11, 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

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet. The pull request is still a draft from a fork, so once it is marked ready, a maintainer adds the ci:run label so CI runs.

The AR9 rewrite and DEC-5 carry an engineering owner's /approve-spec for this head. The new contrast test fails on the base in 13 of 28 cases (1.0 to 1.14:1) and passes on the head in all 28.

Optional, non-blocking:

  • Trim the comment at Lightbox.tsx:1281 to its reason (see the inline note).
  • Name the old look and the WCAG 2.2 1.4.3 and 1.4.11 target in the changeset.

Automated review (maintainer link)

Comment on lines +1281 to +1283
// A control of the viewer, on Lightbox's own backing, which takes the
// control's place. Its icon keeps the on-dark colour, so a theme's restyling
// of the button can't remove its contrast.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking (INV29): the first sentence restates the <span> below it. Keeping only the reason reads better:

// The icon keeps the on-dark colour. A theme that restyles the button then
// can't remove its contrast.

'@astryxdesign/core': patch
---

[fix] Lightbox's Close, Previous, Next and counter always sit on its translucent dark backing, with or without `hasZoom`, so they keep their contrast over any photo and look the same in every viewer.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: spec:AST-017 FR53 asks an accessibility fix's changeset to name the old and new behavior and the target it serves. Something like "Without hasZoom they used to sit bare on the photo; they now keep WCAG 2.2 1.4.11 (3:1) and 1.4.3 (4.5:1) contrast over any photo" makes the release note complete.

This branch was successfully deployed

1 active deployment
Preview — 478a8dab Deployed Nov 11, 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.

2 participants