Skip to content

test(CheckboxList): a row adds no touch-query listener of its own - #10046

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/c06-listener-invariant
Nov 5, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/c06-listener-invariant

Conversation

@vjeux

@vjeux vjeux commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Maintainer impact

Every pull request's unit job fails on main: CheckboxList's "holds one touch-query listener however many rows there are, and none once they unmount" expects 2 to be 1. Two changes that each passed alone met there. The CheckboxList row press (#8212) counted exactly one live (pointer: coarse) listener. The List rows' touch target (#8085) then gave every row a hit-area watch, with one shared listener of its own.

Intended invariant

A repeated row adds no touch observer of its own, and no listener outlives the rows. The case exists to hold that for the shared watch in hooks/useMediaQuery.ts and the hit-area watch in utils/touchHitArea.ts.

Change

The case asserts the invariant, not a count. It renders one row, then forty. The stub must see the shared watches, forty rows must hold what one row holds, and none may remain once the rows unmount and one microtask passes. That microtask is the hit-area watch's own: its last release waits one, so a ref that attaches again in the same commit keeps its watch. The fine and coarse pointer runs and the press-marker check stay. No product code changes.

Evidence

  • Failure before the change: on main e657e2e the old case fails 3 of 3, "expected 2 to be 1".
  • Success after the change: the case passes for a fine and a coarse pointer, and the whole CheckboxList file passes, 88 of 88.
  • Failure injection: a (pointer: coarse) listener added per row fails the forty-against-one check ("expected 42 to be 3"). The same listener, never removed, fails the release check ("expected 1 to be 0").
  • Product/runtime behavior verified unchanged: test-only, one file.
  • CI impact: none; no workflow, action or CI script changes.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm test:ui at this head, on main e657e2e: 838 files, 21,086 tests, all passing.
  • Core tsc, ESLint and Prettier on the changed file, check:repo, check:changesets, changeset coverage against v0.7.8, check:knowledge and pnpm review:pre (0 findings): clean.

The CheckboxList case that counts touch-query listeners asserted
exactly one live listener, and none right after the rows unmount. Since
the List rows' touch target landed (meta#8085), every row also takes a
hit-area watch, and that utility keeps one shared listener of its own.
Its last release waits one microtask, so a ref that attaches again in
the same commit keeps its watch. On main the case therefore failed:
two listeners, and one left until the next microtask.

The case now asserts what it is for. The stub sees the shared watches,
forty rows hold what one row holds, and none remain once the rows
unmount and one microtask passes. A listener added per row fails it (42
against 3), and so does one that is never removed (1 left).
@vercel

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

Request Review

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

astracat-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 5, 2026, 5:52 AM UTC

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 58e4fa5

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
CheckboxList 45.6 kB (0) · 7.5 kB CSS (0) — — · ✓ · ✓
CheckboxListItem 59.6 kB (0) · 10.7 kB CSS (0) — — · ✓ · ✓

Package size: no published package changed; no new dependencies.

API changes: none in this pull request

Committed API report behind this build: cli 9 rows, core 4 rows; run pnpm api:report.

Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.


Generated by PR Enrichment workflow | View full report

@vjeux
vjeux marked this pull request as ready for review November 5, 2026 05:40
@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 5, 2026
@cixzhang
cixzhang marked this pull request as draft November 5, 2026 05:41
@cixzhang
cixzhang marked this pull request as ready for review November 5, 2026 05:41

@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 finished on this head yet.

The rewritten case checks what it exists for: forty rows hold the same (pointer: coarse) listeners as one row, and none remain once the rows unmount and one microtask passes. It fails on main for the reason the description gives, passes on this head, and catches a listener added per row. No product code, public API or spec record changes.

[Automated review]

@cixzhang
cixzhang merged commit 5cb261b into meta:main Nov 5, 2026
161 of 166 checks passed
@vjeux
vjeux deleted the uikit/c06-listener-invariant branch November 5, 2026 06:04

This branch was successfully deployed

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

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants