Skip to content

fix(DropdownMenu): sync its show and hide refs at commit - #10905

Merged
cixzhang merged 7 commits into
meta:mainfrom
vjeux:fix/dropdown-menu-show-refs-at-commit
Nov 12, 2026
Merged

cixzhang merged 7 commits into
meta:mainfrom
vjeux:fix/dropdown-menu-show-refs-at-commit

Conversation

@vjeux

@vjeux vjeux commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Render-time ref writes fixed, each read in a callback: holdEntranceRef, holdOpeningPressRef and cancelMenuPressRef in core/DropdownMenu/DropdownMenu.tsx. Red-first: yes, "takes no touch while it enters, after React discards a render that pins it to a popover" fails on main.

User impact

People who open a DropdownMenu with a finger, in an app that renders with transitions. The menu kept its entrance hold, its trigger hold and its gesture cancel in refs written while it rendered. The layer's show and hide, declared above them, call them through these refs. A render React discards, as a suspended transition does, left its values there. After a discarded render that pinned the menu to a popover, a finger's open took no entrance hold. A touch during the entrance could then land on a row.

Problem and solution fit

A write during render runs for every render, including the ones React throws away. These refs are read by the layer's show and hide, which run after a commit, so they should hold the committed values.

The show and the hide are declared before the popover exists, and the popover builds the values they read. So each ref is a plain useRef above them, and useCommittedRefInto, the second form of Core's shared hook, writes it once its value exists. It writes at commit, before every layout effect. So a show or hide by the menu's controlled-open layout effect reads this commit's values.

Expected behavior and authority

  • React's useRef contract: do not write ref.current during rendering, except to initialize it.
  • architecture:react-component-runtime INV3 and INV17: a latest-value ref goes through useCommittedRef or its useCommittedRefInto form, and render writes no ref. INV4: no rendered value comes from a ref mutation.
  • spec:AST-094 FR35: under a finger, the menu takes no touch while it enters.
  • fix(lab): write latest-value refs at commit, not during render #10780, merged, made the same kind of change in Lab.

Smallest restoration

Three refs in DropdownMenu.tsx. No API, visual or default changes.

Evidence

  • Reproduction before the change: the new test fails on main a4595ef, with the whole test file run.
  • Result after the change, at 8264f99: it passes.
  • Representative unchanged path: the existing entrance, press and controlled-open tests still pass.
  • Regression test or other mutation-sensitive proof: the test fails while the entrance hold is written during render.

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

All runs below are at this PR's head, 8264f99.

The test stubs a coarse primary pointer and a running entrance, then renders the menu unpinned. A transition renders it with presentation="popover" while a sibling suspends for good, so React never commits that render. The trigger is then clicked.

Ref Now Test
holdEntranceRef useCommittedRefInto Red-first: the committed, unpinned menu holds its layer while it enters. Guard: the menu opens in the commit that unpins it from a popover, and the show starts that commit's entrance hold. It fails when the write moves to a layout effect after the show.
holdOpeningPressRef useCommittedRefInto No new test. Its callback depends only on the popover's id, so a discarded render leaves the same value.
cancelMenuPressRef useCommittedRefInto No new test. The press model's cancel is stable, so a discarded render leaves the same value.
  • pnpm exec vitest run --project ui: 1,007 files, 24,817 tests pass.
  • Only holdEntranceRef can change in the commit that shows the menu, so only it has a same-commit test. The other two never change after mount.
  • DropdownMenu.test.tsx run whole against main's menu: the red-first test fails, and the other 238 pass.
  • @astryxdesign/core typecheck: 0 errors. ESLint and Prettier on the changed files: clean.
  • fix(DropdownMenu): a finger's hold-slide-lift no longer flashes the focus outline on the menu button #10079, feat(DropdownMenu): a finger or a pen opens the menu as it presses #8078, fix(DropdownMenu): a cancelled touch clears the row a finger lit #8508 and fix(Popover): a touch that pans is not an outside press, even without pointercancel #11038 changed these files elsewhere. They have merged, and the main merge brought them into this head.
  • History: main merged at 7e7fbae on Nov 11, with no conflicts, so CI runs on a current base. The change's own diff is unchanged.
  • History: the merge of main 1740654 on Nov 12 has no conflicts and brings useCommittedRefInto. The next commit writes the three refs through it in place of the menu's insertion effects, and adds the same-commit guard.
  • Browser specs at this head, on a Storybook built at it: DropdownMenu interaction specs, Chromium 26 passed and WebKit (CI-profile container) 23 passed (3 skipped). DropdownMenu a11y specs, Chromium 183 passed; their .browser specs in the WebKit container, 5 passed.
  • History: the merge of main f6497bc on Nov 12 has no conflicts. It brings main's changes to nine files that DropdownMenu.tsx reaches through its imports, the lazy bottom sheet's included. They are hooks/useMenuPress.ts, useTouchTrigger.ts, useTooltip.tsx, TruncationTooltip.tsx, GestureHost.ts, motion/animator.ts, BottomSheetPanel.tsx, useMobileKeyboard.ts and keyboardHeight.ts. It also imports a type from Layer/useLayer.tsx, which changed. The change's own diff is unchanged.
  • History: the merge of main 91cd63f on Nov 12 has no conflicts. It brings main's changes to four files that DropdownMenu.tsx reaches through its imports, the lazy bottom sheet's included. They are Layer/layerAnimations.stylex.ts, which it imports directly, Layer/layerEntranceSide.ts, List/ListItem.tsx and motion/animator.ts. The change's own diff is unchanged.
  • History: the merge of main a4595ef on Nov 12 has no conflicts. It brings main's changes to five files that DropdownMenu.tsx reaches through its imports, the lazy bottom sheet's included. It imports hooks/useMenuPress.ts directly. The others are BottomSheet/BottomSheet.tsx, List/listReorderContext.ts, utils/clickGuard.ts and utils/timeParser.ts. The change's own diff is unchanged.

The menu kept its entrance hold, its trigger hold and its gesture
cancel in refs written while it rendered, so the layer's show and hide,
declared above them, could call them. A render React discards, as a
suspended transition does, left its values there. After a discarded
render that pinned the menu to a popover, a finger's open then took no
entrance hold.

Each ref is now synced in a one-line insertion effect. It runs before
the menu's controlled-open layout effect, which can show or hide the
layer in that commit.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 9, 2026
@vercel

vercel Bot commented Nov 9, 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 12, 2026 7:57pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 12, 2026, 8:03 PM UTC

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 8264f99

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
DropdownMenuCheckboxItem 23.8 kB (0) · 7.0 kB CSS (0) — ✗ · ✓ · ✓
DropdownMenuDivider 5.3 kB (0) · 548 B CSS (0) — ✗ · ✓ · —
DropdownMenuGroup 6.4 kB (0) · 3.4 kB CSS (0) — ✗ · ✓ · —
9 more components
Component Size LoC Visual · A11y · RTL
DropdownMenuItem 23.0 kB (0) · 6.6 kB CSS (0) — ✗ · ✓ · —
DropdownMenuRadioGroup 6.6 kB (0) · 3.3 kB CSS (0) — ✗ · ✓ · —
DropdownMenuRadioItem 23.9 kB (0) · 7.0 kB CSS (0) — ✗ · ✓ · —
DropdownMenuSubMenu 73.7 kB (0) · 10.1 kB CSS (0) — ✗ · ✓ · ✓
DropdownMenu 102.8 kB (−6 B) · 17.9 kB CSS (0) — ✗ · ✓ · ✓
ContextMenuItem 33.5 kB (0) · 6.8 kB CSS (0) — — · — · —
MoreMenu 103.1 kB (−4 B) · 17.9 kB CSS (0) — — · — · —
lab/Comments 361.0 kB (−5 B) · 2.5 kB CSS (0) — — · — · —
lab/CommentThread 354.2 kB (−18 B) · 2.4 kB CSS (0) — — · — · —
Visual changes: 4 snapshots in 1 component

A change is a question for the reviewer, not a failure.

Component · story Before After Diff
DropdownMenu · Lab Checkbox Items (probe, dark) before frame after frame diff frame
DropdownMenu · Lab Checkbox Items (probe, light) before frame after frame diff frame
DropdownMenu · Lab Checkbox Items (neutral, dark) before frame after frame diff frame
DropdownMenu · Lab Checkbox Items (neutral, light) before frame after frame diff frame

Package size: @astryxdesign/core 7.42 MB packed (+259 B); no new dependencies.

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

@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. This is a draft from a fork, so CI starts once it is marked ready for review and a maintainer adds the ci:run label.

The fix restores DropdownMenu's entrance hold under a finger after React discards a render: the new test fails on main and passes here, and the DropdownMenu and Layer suites pass.

Optional: the suite stays green if the three syncs become passive effects. A case that unpins the menu and opens it in one commit under a coarse pointer would guard the reason for useInsertionEffect.

[Automated review]

@cixzhang

cixzhang commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 3a86e7a

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 9, 2026

@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.

Changes requested: the code change looks right, but the description's test evidence is stale at this head, and CI has not run yet.

  • The Testing section reports every run at the pre-merge commit and calls #10079 open, but #10079 merged on 2026-11-10 and this head's merge of main brings it and three other DropdownMenu commits (#8078, #8508, #11038) into the pull request, so please update that section and report the runs at the current head.

Approval also waits for CI: CI has not run on this head yet because the pull request is a draft, and it runs once the pull request is marked ready for review (the ci:run label is already set). Syncing the three refs in insertion effects restores the entrance hold under a finger after a discarded render, as the DropdownMenu spec's FR22 requires. Optional: the new test passes with any commit-time sync, so a case that unpins a pinned menu and opens it in the same rerender, under a coarse pointer, would guard why the syncs must run before the controlled-open layout effect.

Claims and files checked
  • Changeset, "syncs the refs its show and hide call at commit": verified (DropdownMenu.tsx:1263-1267, :1426-1430, :1500-1504).
  • Changeset, "its entrance under a finger holds input as the committed menu says" after a discarded render: verified by code (DropdownMenu.tsx:1088, :1249-1262) and asserted by DropdownMenu.test.tsx:3163-3206; that test has not run at this head.
  • Three render-time ref writes, each read in a callback: verified (DropdownMenu.tsx:1034, :1087, :1088).
  • Red-first, the new test fails on main before the change: not rerun at this head; by reading, the base runs the discarded render's hold, which holds nothing.
  • User impact, no entrance hold after a discarded pinned render: verified by code (DropdownMenu.tsx:1249-1262, :1930).
  • The controlled-open layout effect is declared above and insertion effects run before it: verified (DropdownMenu.tsx:1192-1211).
  • Each new effect names what it syncs, acquires nothing and can replay: verified (DropdownMenu.tsx:1263-1264, :1426-1427, :1500-1501).
  • holdOpeningPress depends only on the popover's id: verified (DropdownMenu.tsx:1415-1425).
  • The press model's cancel is stable: verified (hooks/useMenuPress.ts:1002-1006).
  • #10780 made the same kind of change in Lab: verified (merged).
  • No API, visual or default change: verified.
  • "All runs below are at this PR's head": false (the head is now a later merge of main).
  • "The open #10079 ... merges clean with this change": false (#10079 merged on 2026-11-10 and is in this head's base).
  • 41 files and 982 tests pass, typecheck 0 errors, ESLint and Prettier clean: not verified at this head (not run; CI skipped).
  • main merged with no conflicts and the change's own diff is unchanged: verified (only hunk offsets and one context line differ).
  • .changeset/dropdown-menu-show-refs-at-commit.md: clear.
  • packages/core/src/DropdownMenu/DropdownMenu.tsx: clear.
  • packages/core/src/DropdownMenu/DropdownMenu.test.tsx: non-blocking note (the insertion timing is not pinned).

Automated review (maintainer link)

@vjeux

vjeux commented Nov 11, 2026

Copy link
Copy Markdown
Contributor Author

Testing now reports runs at f32c3eb, and the merged PRs are named as merged. The optional ordering test needs a code push, which this body-only round has none of, so it comes with this PR's next code change.

@astracat-bot

astracat-bot Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

In reply to @vjeux

I'll run a full review to re-check this with your note.

@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 a draft, so CI skips it; mark it ready for review so CI runs (the ci:run label is already set). Syncing the three refs in insertion effects restores the entrance hold under a finger after a discarded render, as the DropdownMenu spec's FR22 requires, and the Testing section now reports this head and names the merged pull requests. Optional, as you noted for the next code change: a case that unpins a pinned menu and opens it in the same rerender, under a coarse pointer, would pin why the syncs must run before the controlled-open layout effect.

Claims and files checked
  • Changeset, the menu syncs the refs its show and hide call at commit: verified (DropdownMenu.tsx:1263-1267, :1426-1430, :1500-1504).
  • Changeset, after a discarded render the entrance under a finger holds input as the committed menu says: verified by code (DropdownMenu.tsx:1088, :1249-1262) and asserted by DropdownMenu.test.tsx:3163-3206.
  • Three render-time ref writes fixed, each read in a callback: verified (the base wrote them during render; the reads are at DropdownMenu.tsx:1034, :1087, :1088).
  • The layer's show and hide, declared above the refs' callbacks, call them through the refs: verified (DropdownMenu.tsx:1024-1060, :1085-1101).
  • User impact, a finger's open took no entrance hold after a discarded render that pinned the menu: verified by code (DropdownMenu.tsx:1249-1262, :1930).
  • Each ref is synced in a one-line insertion effect named in its note: verified.
  • The controlled-open layout effect can show or hide the menu in the same commit, and insertion effects run before it: verified (DropdownMenu.tsx:1192-1211).
  • The cited authority (React's rule against writing refs during render, the runtime record's effect and ref rules, the touch record's entrance hold): verified; each new effect names what it syncs, acquires nothing and can replay.
  • The Lab pull request cited as precedent merged and made the same kind of change: verified.
  • No API, visual or default change: verified.
  • holdOpeningPress depends only on the popover's id: verified (DropdownMenu.tsx:1415-1425).
  • The press model's cancel is stable: verified (hooks/useMenuPress.ts:1002-1006).
  • The test's setup (coarse pointer, running entrance, unpinned render, a transition that pins the menu and suspends for good, then a click): verified (DropdownMenu.test.tsx:3163-3206).
  • Red-first, the new test fails against main's menu: verified by reading (the base runs the discarded render's pinned hold, which holds nothing); not rerun here.
  • Runs at this head (45 files and 1,025 tests pass; the other 237 cases of the test file pass; typecheck, ESLint and Prettier clean): consistent with the head (45 matching test files; the file holds 238 cases, 237 at the base); not rerun here, and CI has not run.
  • The four pull requests that changed these files elsewhere have merged and are in this head: verified.
  • Main was merged with no conflicts and the change's own diff is unchanged: verified.
  • .changeset/dropdown-menu-show-refs-at-commit.md: clear.
  • packages/core/src/DropdownMenu/DropdownMenu.tsx: clear.
  • packages/core/src/DropdownMenu/DropdownMenu.test.tsx: non-blocking note (the insertion timing is not pinned by a test).

Automated review (maintainer link)

The show and the hide read the entrance hold, the trigger hold and the
gesture cancel through refs declared before the popover exists. Three
insertion effects wrote them. The shared internal hook's second form
makes the same writes at the same time, so the menu calls it.

A test opens the menu in the commit that unpins it from a popover. The
show then starts that commit's entrance hold.
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 3764995

@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 a draft, so CI skips it; mark it ready for review so CI runs (the ci:run label is already set). Writing the three refs through the shared commit-time hook restores the entrance hold under a finger after a discarded render, and the new same-commit test pins why the write must come before the controlled-open layout effect. One optional cleanup is in the inline comment.

Claims and files checked
  • Changeset, the menu writes the refs its show and hide call at commit: verified (DropdownMenu.tsx:1265, :1426, :1498).
  • Changeset, after a discarded render the entrance under a finger holds input as the committed menu says: verified by code (DropdownMenu.tsx:1088, :1249-1262) and asserted by DropdownMenu.test.tsx:3163-3206.
  • Three render-time ref writes fixed, each read in a callback: verified (the base wrote them during render; the reads are at DropdownMenu.tsx:1034, :1087, :1088).
  • The layer's show and hide, declared above the refs' values, call them through the refs: verified (DropdownMenu.tsx:1024-1060, :1085-1101).
  • User impact, a finger's open took no entrance hold after a discarded render that pinned the menu: verified by code (DropdownMenu.tsx:1249-1262, :1924).
  • The shared hook's second form writes at commit, before every layout effect: verified (hooks/useCommittedRef.ts:33-38).
  • A show or hide by the controlled-open layout effect reads this commit's values: verified (DropdownMenu.tsx:1192-1211).
  • The cited authority (React's rule against writing refs during render, the runtime record's latest-value ref and pure-render rules, the touch record's entrance rule): verified.
  • The Lab pull request cited as precedent merged and made the same kind of change: verified.
  • No API, visual or default change: verified.
  • The trigger hold depends only on the popover's id: verified (DropdownMenu.tsx:1413-1423).
  • The press model's cancel is stable: verified (hooks/useMenuPress.ts:1002-1006).
  • The red-first test's setup (coarse pointer, running entrance, unpinned render, a pinning transition that suspends for good, then a click): verified (DropdownMenu.test.tsx:3163-3206).
  • The guard opens the menu in the commit that unpins it and fails if the write moves to a later layout effect: verified by reading (DropdownMenu.test.tsx:3208-3239).
  • Red-first, the new test fails against main's menu: verified by reading; not rerun here.
  • Runs at this head (45 files and 1,025 tests pass; the other 238 cases of the test file pass against main's menu; typecheck, ESLint and Prettier clean): consistent with the head (45 matching test files; the file holds 239 cases, 237 at the base); not rerun here, and CI has not run.
  • The four pull requests that changed these files elsewhere have merged and are in this head: verified.
  • Both merges of main had no conflicts, and the second brought in the shared hook: verified.
  • .changeset/dropdown-menu-show-refs-at-commit.md: clear.
  • packages/core/src/DropdownMenu/DropdownMenu.tsx: non-blocking comment-wording suggestion.
  • packages/core/src/DropdownMenu/DropdownMenu.test.tsx: clear.

Automated review (maintainer link)

Comment on lines +1263 to +1264
// The show's entrance hold, written at commit before any layout effect. The
// controlled-open layout effect above can show the menu then.

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.

Optional (non-blocking): the first sentence restates what useCommittedRefInto does. Keeping only the reason reads shorter, and the same applies to the comments above the other two writes (:1424-1425, :1496-1497, with "hide" for the cancel):

  // The controlled-open layout effect above can show the menu in this commit.
  // The show reads this ref.

@vjeux
vjeux marked this pull request as ready for review November 12, 2026 10:32
@vjeux
vjeux marked this pull request as draft November 12, 2026 14:43
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 84bd84f

@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.

CI started when the pull request was marked ready for review and is still running; the merge guard waits for its required checks. Writing the three refs through the shared commit-time hook restores the entrance hold under a finger after a discarded render; the change's own diff is unchanged and the new merge of main is clean. The optional comment-wording suggestion in the earlier inline comment still applies.

Claims and files checked
  • Changeset, the menu writes the refs its show and hide call at commit: verified (DropdownMenu.tsx:1265, :1426, :1498).
  • Changeset, after a discarded render the entrance under a finger holds input as the committed menu says: verified by code (DropdownMenu.tsx:1088, :1249-1262) and asserted by DropdownMenu.test.tsx:3163-3206; its CI run at this head has not finished.
  • Three render-time ref writes fixed, each read in a callback: verified (the base wrote them during render; the reads are at DropdownMenu.tsx:1034, :1087, :1088).
  • The layer's show and hide, declared above the refs' values, call them through the refs: verified (DropdownMenu.tsx:1024-1060, :1085-1101).
  • User impact, a finger's open took no entrance hold after a discarded render that pinned the menu: verified by code (DropdownMenu.tsx:1251-1254, :1924).
  • The shared hook's second form writes at commit, before every layout effect: verified (hooks/useCommittedRef.ts:33-38).
  • A show or hide by the controlled-open layout effect reads this commit's values: verified (DropdownMenu.tsx:1192-1211).
  • The cited rules (React's ref rule, the runtime record's ref-sync, render-purity and ref-state rules, the touch record's entrance hold): verified against the current records.
  • The Lab change cited as precedent merged: verified (merged on Nov 9).
  • Three refs, no API, visual or default change: verified (diff).
  • The new test fails on main and passes at this head, and the existing entrance, press and controlled-open tests still pass: the test reads correctly against both trees; the runs are the author's, not reproduced here, and CI has not finished.
  • The test fails while the entrance hold is written during render: verified by reading.
  • The trigger-hold callback depends only on the popover's id: verified (DropdownMenu.tsx:1413-1423; the id comes from useId).
  • The press model's cancel is stable: verified (hooks/useMenuPress.ts:999-1003).
  • The same-commit guard fails when the write moves to a layout effect after the show: verified by reading (the show is synchronous in the test environment, Layer/useLayer.tsx:1689-1716).
  • Whole-suite, typecheck, lint and browser-spec results at this head: the author's runs, not reproduced here; CI has not finished.
  • The four other menu pull requests named in Testing merged and are in this head: verified (history).
  • The Nov 11 and Nov 12 merges of main have no conflicts and leave the change's own diff unchanged; the first Nov 12 merge brings the shared hook and the next commit adopts it with the guard test: verified (each merge's tree equals an automatic merge, and the patch is byte-identical).
  • The latest merge brings main's changes to nine files the menu reaches through its imports, and to the layer hook it imports a type from: verified that those files changed; the menu imports the press model and the layer type directly.
  • .changeset/dropdown-menu-show-refs-at-commit.md: clear.
  • packages/core/src/DropdownMenu/DropdownMenu.tsx: clear, apart from the optional comment wording.
  • packages/core/src/DropdownMenu/DropdownMenu.test.tsx: clear.

Automated review (maintainer link)

@vjeux
vjeux marked this pull request as ready for review November 12, 2026 15:39
github-actions Bot added a commit that referenced this pull request Nov 12, 2026
@vjeux
vjeux marked this pull request as draft November 12, 2026 16:59
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 2291d18

@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 a draft, so CI skips it; mark it ready for review so CI runs (the ci:run label is already set). This head only merges main again: the change's own diff is unchanged and the merge is clean, so writing the three refs through the shared commit-time hook still restores the entrance hold under a finger after a discarded render. The optional comment-wording suggestion in the earlier inline comment still applies.

Claims and files checked
  • Changeset, the menu writes the refs its show and hide call at commit: verified (DropdownMenu.tsx:1265, :1426, :1498).
  • Changeset, after a discarded render the entrance under a finger holds input as the committed menu says: verified by code (DropdownMenu.tsx:1088, :1249-1262) and asserted by DropdownMenu.test.tsx:3163-3206; no CI run at this head yet.
  • Three render-time ref writes fixed, each read in a callback: verified (reads at DropdownMenu.tsx:1034, :1087, :1088).
  • The layer's show and hide, declared above the refs' values, call them through the refs: verified (DropdownMenu.tsx:1024-1060, :1085-1101).
  • User impact, after a discarded render that pinned the menu a finger's open took no entrance hold: verified by code (DropdownMenu.tsx:1251-1254, :1924).
  • The shared hook's second form writes at commit, before every layout effect: verified (hooks/useCommittedRef.ts:33-38).
  • A show or hide by the controlled-open layout effect reads this commit's values: verified (DropdownMenu.tsx:1192-1211).
  • The cited rules (React's ref rule, the runtime record's ref-sync, render-purity and ref-state rules, the touch record's entrance hold): verified against the current records.
  • The Lab change cited as precedent merged: verified (history).
  • Three refs, no API, visual or default change: verified (diff).
  • The new test fails on main and passes at this head, and the existing entrance, press and controlled-open tests still pass: the test reads correctly against both trees; the runs are the author's, not reproduced here.
  • The test fails while the entrance hold is written during render: verified by reading.
  • The trigger-hold callback depends only on the popover's id: verified (DropdownMenu.tsx:1413-1423).
  • The press model's cancel is stable: verified (hooks/useMenuPress.ts:999-1003).
  • The same-commit guard fails when the write moves to a layout effect after the show: verified by reading (Layer/useLayer.tsx:1689-1716).
  • Whole-suite, typecheck, lint and browser-spec results at this head: the author's runs, not reproduced here; CI has not run.
  • The four other menu pull requests named in Testing merged and are in this head: verified (history).
  • Every merge of main (one on Nov 11, three on Nov 12) has no conflicts and leaves the change's own diff unchanged; the first Nov 12 merge brings the shared hook and the next commit adopts it with the guard test: verified (each merge equals an automatic merge of its parents; the patch is byte-identical).
  • The second Nov 12 merge brings main's changes to nine files the menu reaches through its imports, plus the layer hook it imports a type from: verified (import closure at this head).
  • The newest merge brings main's changes to four files the menu reaches through its imports, one of them imported directly: verified (import closure at this head).
  • .changeset/dropdown-menu-show-refs-at-commit.md: clear.
  • packages/core/src/DropdownMenu/DropdownMenu.tsx: clear, apart from the optional comment wording.
  • packages/core/src/DropdownMenu/DropdownMenu.test.tsx: clear.

Automated review (maintainer link)

@vjeux
vjeux marked this pull request as ready for review November 12, 2026 17:56
github-actions Bot added a commit that referenced this pull request Nov 12, 2026
@vjeux
vjeux marked this pull request as draft November 12, 2026 18:38
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 8264f99

@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 a draft, so CI skips it; mark it ready for review so CI runs (the ci:run label is already set). This head only merges main again: the change's own diff is unchanged and the merge is clean, so writing the three refs through the shared commit-time hook still restores the entrance hold under a finger after a discarded render. The optional comment-wording suggestion in the earlier inline comment still applies.

Claims and files checked
  • Changeset, the menu writes the refs its show and hide call at commit: verified (DropdownMenu.tsx:1265, :1426, :1498).
  • Changeset, after a discarded render the entrance under a finger holds input as the committed menu says: verified by code (DropdownMenu.tsx:1088, :1249-1262) and asserted by DropdownMenu.test.tsx:3163-3206; no CI run at this head yet.
  • Three render-time ref writes fixed, each read in a callback: verified (reads at DropdownMenu.tsx:1034, :1087, :1088).
  • The layer's show and hide, declared above the refs' values, call them through the refs: verified (DropdownMenu.tsx:1024-1060, :1085-1101).
  • User impact, after a discarded render that pinned the menu a finger's open took no entrance hold: verified by code (DropdownMenu.tsx:1251-1254, :1924).
  • Each ref is a plain ref above the callbacks and the shared hook's second form writes it once its value exists: verified (DropdownMenu.tsx:970, :973, :979).
  • The shared hook's second form writes at commit, before every layout effect: verified (hooks/useCommittedRef.ts:33-38).
  • A show or hide by the controlled-open layout effect reads this commit's values: verified (DropdownMenu.tsx:1192-1211).
  • The cited rules (React's ref rule, the runtime record's ref-sync, render-purity and ref-state rules, the touch record's entrance hold): verified against the current records.
  • The Lab change cited as precedent merged: verified (history).
  • Three refs, no API, visual or default change: verified (diff).
  • The new test fails on main and passes at this head, and the existing entrance, press and controlled-open tests still pass: the test reads correctly against both trees; the runs are the author's, not reproduced here.
  • The test fails while the entrance hold is written during render: verified by reading.
  • The trigger-hold callback depends only on the popover's id: verified (DropdownMenu.tsx:1413-1423).
  • The press model's cancel is stable: verified (hooks/useMenuPress.ts:1038-1042, through :519-544 to the autoscroll created once at :431).
  • The same-commit guard fails when the write moves to a layout effect after the show: verified by reading (DropdownMenu.tsx:1192-1211).
  • Only the entrance hold can change in the commit that shows the menu: verified (the other two callbacks are stable).
  • Whole-suite, typecheck, lint and browser-spec results at this head: the author's runs, not reproduced here; CI has not run.
  • The four other menu pull requests named in Testing merged and are in this head: verified (history).
  • Every merge of main (one on Nov 11, four on Nov 12) has no conflicts and leaves the change's own diff unchanged; the first Nov 12 merge brings the shared hook and the next commit adopts it with the guard test: verified (each merge equals an automatic merge of its parents; the patch is byte-identical).
  • The second Nov 12 merge brings main's changes to nine files the menu reaches through its imports, plus the layer hook it imports a type from: verified in the earlier review of that merge (history unchanged).
  • The third Nov 12 merge brings main's changes to four files the menu reaches through its imports, one of them imported directly: verified in the earlier review of that merge (history unchanged).
  • The newest merge brings main's changes to five files the menu reaches through its imports, the menu-press hook imported directly and the bottom sheet, reorder context, click guard and time parser through others: verified (runtime import closure at this head; two other changed List files are reached only through a type import).
  • .changeset/dropdown-menu-show-refs-at-commit.md: clear.
  • packages/core/src/DropdownMenu/DropdownMenu.tsx: clear, apart from the optional comment wording.
  • packages/core/src/DropdownMenu/DropdownMenu.test.tsx: clear.

Automated review (maintainer link)

@vjeux
vjeux marked this pull request as ready for review November 12, 2026 20:15
github-actions Bot added a commit that referenced this pull request Nov 12, 2026
@vjeux
vjeux marked this pull request as draft November 12, 2026 20:50
@vjeux
vjeux marked this pull request as ready for review November 12, 2026 20:59
github-actions Bot added a commit that referenced this pull request Nov 12, 2026
@cixzhang
cixzhang merged commit 3449161 into meta:main Nov 12, 2026
195 of 197 checks passed
@vjeux
vjeux deleted the fix/dropdown-menu-show-refs-at-commit branch November 12, 2026 22:38

This branch was successfully deployed

1 active deployment
Preview — 8264f99f Deployed Nov 12, 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