Skip to content

chore(core): remove the same-press leftovers: an unread dismissal field and stale comments - #11332

Merged
cixzhang merged 3 commits into
mainfrom
chore/same-press-leftovers
Nov 12, 2026
Merged

cixzhang merged 3 commits into
mainfrom
chore/same-press-leftovers

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

Maintainers who read the layer runtime meet three leftovers from the same-press fixes. Each one points at a path that no longer exists:

  • useLayer still returns an internal wasJustDismissed field. No component has read it since show() itself started to absorb the press that closed the layer.
  • Two comments say the keep-open helpers are a "temporary rollout". Selector and MultiSelector use them for good.
  • architecture:layer-runtime still says DropdownMenu and Selector-family triggers read the guard.

Users see no change.

Intended invariant

architecture:layer-runtime INV7: the same physical press that closes a Layer cannot immediately reopen it. The check that enforces this still runs inside useLayer's show() path (openNow), and this change does not touch it.

Change

  • The unread wasJustDismissed field. It is removed from the internal useLayer return, with its InternalLayerFields type and the public hook's strip step. useLayer now returns the same memoized object that the implementation builds, so the returned object stays stable. The wasJustDismissed callback stays, because openNow calls it. Its comment now says that openNow reads it.
  • UIKIT_CLICK stays. The deprecated constant, its barrel line and its keep-test are unchanged from main. Ending that deprecation needs a separate owner decision.
  • The two "temporary rollout" comments (InternalInputClearButton, useKeepLayerOpenProps). They now say what the code does. The code under them does not change.
  • architecture:layer-runtime, "Current Popover lifecycle and light dismissal". The paragraph now says that useLayer's show() does not reopen the layer during the same gesture, so every trigger path gets the guard (INV7). It no longer says that triggers read wasJustDismissed(). This corrects a stale description only. INV7 already holds the rule, and no rule is added or changed.
  • Tests. The light-dismiss harness no longer calls the field. It is now the same as the "trigger that never calls it" harness, so the two merge and the duplicate test goes. The type assertions that the public returns lack the field go too, because the field no longer exists.
  • Changeset. One [chore] Internal: Changeset for @astryxdesign/core: shipped source changes, but no consumer sees a change.

New public API: none. No behavior change.

Evidence

  • Before the removal: I removed the trigger-side if (layer.wasJustDismissed()) return; from the light-dismiss harness first. All 5 tests in that suite stayed green, which proves that the show() absorb carries the behavior.
  • After the removal: useLayer, Popover, Selector, MultiSelector, DropdownMenu and Field tests: 1,575 tests. The only failures were 30-second timeouts in the two listbox a11y suites under machine load. Each passes when run alone (10/10 and 13/13).
  • Type check: Core is green, so no hidden reader of the field exists. Lab reports the same 117 errors on this branch as on main, none in a file this change touches.
  • Product and runtime behavior unchanged: the absorb path (openNow) is untouched. CI's browser interaction specs for DropdownMenu, Selector and Popover run on this change.

Writing rubric results

Over the architecture:layer-runtime paragraph:

  • R1 narration: none. The paragraph states what show() does in the present tense.
  • R2 research in the record: none.
  • R3 evidence naming a change: none.
  • R4 rejected alternatives over one line or outside a decision: none.
  • R5 pull request or issue references remaining: none.
  • R6 ruled open questions still listing options: none.
  • R7 project status (build status or work order): none.

Scope

Components: Layer, Popover, Selector, MultiSelector, Field

  • 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

  • vitest run for the suites above.
  • Core and Lab typecheck.
  • ESLint and Prettier on the touched files.
  • no-comment-provenance.baseline.mjs --check: up to date.
  • pnpm check:knowledge: aligned.
  • pnpm check:changesets: valid.
  • pnpm specs:for --diff origin/main.
  • pnpm review:pre: 0 findings, merges cleanly.

@vercel

vercel Bot commented Nov 12, 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 4:09am UTC

Request Review

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

astracat-bot Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

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

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

Copy link
Copy Markdown
Contributor Author

/approve-spec 15cc532

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

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 3e5c888

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
LayerProvider 4.4 kB (0) · 20 B CSS (0) — ✓ · ✓ · ✗
charts/ChartLegend 53.7 kB (+3 B) · 224 B CSS (0) — — · — · —
Heading 14.1 kB (+2 B) · 5.5 kB CSS (0) — — · — · —
115 more components
Component Size LoC Visual · A11y · RTL
Timestamp 35.1 kB (+2 B) · 10.2 kB CSS (0) — — · — · —
lab/LineClamp 15.7 kB (+2 B) · 168 B CSS (0) — — · — · —
ChatToolCalls 34.1 kB (+1 B) · 8.4 kB CSS (0) — — · — · —
CommandPalette 75.2 kB (+1 B) · 12.7 kB CSS (0) — — · — · —
CommandPaletteInput 33.6 kB (0) · 7.6 kB CSS (0) — — · — · —
ProgressBar 12.0 kB (0) · 6.4 kB CSS (0) — — · — · —
Text 13.6 kB (0) · 5.5 kB CSS (0) — — · — · —
Timer 15.7 kB (0) · 6.0 kB CSS (0) — — · — · —
ChatMessageList 29.9 kB (−1 B) · 7.1 kB CSS (0) — — · — · —
Spinner 26.5 kB (−1 B) · 6.2 kB CSS (0) — — · — · —
ComplexSelector 75.8 kB (−4 B) · 11.8 kB CSS (0) — — · — · —
BaseTypeahead 76.6 kB (−6 B) · 10.9 kB CSS (0) — — · — · —
Field 58.2 kB (−7 B) · 7.3 kB CSS (0) — ✓ · ✓ · —
FieldLabel 54.3 kB (−7 B) · 5.7 kB CSS (0) — ✓ · ✓ · —
InputGroup 59.8 kB (−7 B) · 7.9 kB CSS (0) — — · — · —
RadioList 59.6 kB (−7 B) · 7.3 kB CSS (0) — — · — · —
TabMenu 77.0 kB (−7 B) · 11.1 kB CSS (0) — — · — · —
TimeInput 167.5 kB (−9 B) · 16.0 kB CSS (0) — — · — · —
Pagination 115.5 kB (−10 B) · 17.8 kB CSS (0) — — · — · —
lab/ListInput 91.5 kB (−10 B) · 922 B CSS (0) — — · — · —
lab/Schedule 109.8 kB (−10 B) · 3.9 kB CSS (0) — — · — · —
ChatLayout 86.3 kB (−11 B) · 10.5 kB CSS (0) — — · — · —
CheckboxListItem 74.4 kB (−11 B) · 11.5 kB CSS (0) — — · — · —
ListItem 73.6 kB (−11 B) · 11.5 kB CSS (0) — — · — · —
Toast 101.3 kB (−11 B) · 10.3 kB CSS (0) — — · — · —
lab/CommentPin 59.3 kB (−11 B) · 1.2 kB CSS (0) — — · — · —
AppShell 95.2 kB (−12 B) · 13.5 kB CSS (0) — — · — · —
CheckboxInput 67.5 kB (−12 B) · 9.3 kB CSS (0) — — · — · —
DateInput 192.6 kB (−12 B) · 17.0 kB CSS (0) — — · — · —
FileInput 72.4 kB (−12 B) · 10.9 kB CSS (0) — — · — · —
Link 55.1 kB (−12 B) · 7.1 kB CSS (0) — — · — · —
SideNav 118.2 kB (−12 B) · 11.4 kB CSS (0) — — · — · —
SideNavCollapseButton 64.3 kB (−12 B) · 10.1 kB CSS (0) — — · — · —
Typeahead 85.8 kB (−12 B) · 12.5 kB CSS (0) — — · — · —
lab/TransferListSelector 114.5 kB (−12 B) · 1.4 kB CSS (0) — — · — · —
richtext/RichTextView 279.9 kB (−12 B) · 2.3 kB CSS (0) — — · — · —
AlertDialog 109.2 kB (−13 B) · 14.6 kB CSS (0) — — · — · —
ChatSendButton 63.8 kB (−13 B) · 10.0 kB CSS (0) — — · — · —
CheckboxList 71.9 kB (−13 B) · 7.8 kB CSS (0) — — · — · —
DialogHeader 66.2 kB (−13 B) · 11.5 kB CSS (0) — — · — · —
InfoTip 49.3 kB (−13 B) · 5.4 kB CSS (0) — — · — · —
Lightbox 126.0 kB (−13 B) · 10.6 kB CSS (0) — — · — · —
MultiSelector 99.7 kB (−13 B) · 16.9 kB CSS (0) — — · — · —
Popover · Storybook 95.4 kB (−13 B) · 14.2 kB CSS (0) 1,556 (0) ✓ · ✓ · ✓
Selector 105.3 kB (−13 B) · 17.4 kB CSS (0) — — · — · —
Switch 106.8 kB (−13 B) · 10.0 kB CSS (0) — — · — · —
Thumbnail 67.8 kB (−13 B) · 11.6 kB CSS (0) — — · — · —
Tooltip 31.1 kB (−13 B) · 4.4 kB CSS (0) — — · — · —
TopNavMegaMenu 74.4 kB (−13 B) · 11.8 kB CSS (0) — — · — · —
lab/DialogHeroHeader 86.5 kB (−13 B) · 372 B CSS (0) — — · — · —
lab/EmojiPicker 90.3 kB (−13 B) · 751 B CSS (0) — — · — · —
lab/TourStep 101.7 kB (−13 B) · 590 B CSS (0) — — · — · —
Avatar 44.9 kB (−14 B) · 5.6 kB CSS (0) — — · — · —
AvatarGroup 47.7 kB (−14 B) · 5.8 kB CSS (0) — — · — · —
AvatarGroupOverflow 50.9 kB (−14 B) · 5.7 kB CSS (0) — — · — · —
Banner 65.4 kB (−14 B) · 10.5 kB CSS (0) — — · — · —
Calendar 74.3 kB (−14 B) · 10.6 kB CSS (0) — — · — · —
ChatDictationButton 64.0 kB (−14 B) · 10.1 kB CSS (0) — — · — · —
ChatLayoutScrollButton 64.0 kB (−14 B) · 10.2 kB CSS (0) — — · — · —
CodeBlock 78.6 kB (−14 B) · 11.3 kB CSS (0) — — · — · —
IconButton 63.4 kB (−14 B) · 10.0 kB CSS (0) — — · — · —
MobileNavToggle 63.7 kB (−14 B) · 10.0 kB CSS (0) — — · — · —
NumberInput 74.9 kB (−14 B) · 11.4 kB CSS (0) — — · — · —
StatusDot 32.8 kB (−14 B) · 5.4 kB CSS (0) — — · — · —
Stepper 65.1 kB (−14 B) · 10.1 kB CSS (0) — — · — · —
ToggleButton 90.1 kB (−14 B) · 10.1 kB CSS (0) — — · — · —
RadioListItem 70.6 kB (−15 B) · 10.3 kB CSS (0) — — · — · —
SideNavHeading 80.6 kB (−15 B) · 11.3 kB CSS (0) — — · — · —
SideNavItem 75.1 kB (−15 B) · 11.1 kB CSS (0) — — · — · —
TextArea 65.6 kB (−15 B) · 9.4 kB CSS (0) — — · — · —
TextInput 71.1 kB (−15 B) · 11.2 kB CSS (0) — — · — · —
lab/TransferList 105.7 kB (−15 B) · 1.2 kB CSS (0) — — · — · —
richtext/RichTextEditor 301.7 kB (−15 B) · 2.6 kB CSS (0) — — · — · —
Button 63.4 kB (−16 B) · 10.0 kB CSS (0) — — · — · —
Slider 112.4 kB (−16 B) · 8.8 kB CSS (0) — — · — · —
TopNavHeading 80.2 kB (−16 B) · 11.2 kB CSS (0) — — · — · —
TopNavMenu 79.6 kB (−16 B) · 11.2 kB CSS (0) — — · — · —
lab/ChatEmojiPicker 110.6 kB (−16 B) · 773 B CSS (0) — — · — · —
lab/SelectableCardGroup 67.5 kB (−16 B) · 162 B CSS (0) — — · — · —
DrawerHeader 66.4 kB (−17 B) · 12.9 kB CSS (0) — — · — · —
TopNav 75.7 kB (−17 B) · 10.9 kB CSS (0) — — · — · —
lab/DiffViewer 90.9 kB (−17 B) · 2.1 kB CSS (0) — — · — · —
MobileNav 74.0 kB (−18 B) · 10.6 kB CSS (0) — — · — · —
lab/TabBarMoreList 95.9 kB (−18 B) · 1.8 kB CSS (0) — — · — · —
lab/ChatReactionBar 111.8 kB (−19 B) · 1.1 kB CSS (0) — — · — · —
DateRangeInput 97.4 kB (−20 B) · 12.5 kB CSS (0) — — · — · —
ChatComposer 82.8 kB (−25 B) · 12.1 kB CSS (0) — — · — · —
HoverCard 29.3 kB (−30 B) · 4.4 kB CSS (0) — — · — · —
TableCell 114.4 kB (−30 B) · 18.0 kB CSS (0) — — · — · —
lab/CommentThread 352.0 kB (−30 B) · 2.4 kB CSS (0) — — · — · —
ChatComposerInput 80.5 kB (−31 B) · 11.3 kB CSS (0) — — · — · —
ChatComposerTokenElement 80.5 kB (−31 B) · 11.3 kB CSS (0) — — · — · —
ContextMenu 113.2 kB (−31 B) · 17.5 kB CSS (0) — — · — · —
PowerSearch 299.1 kB (−32 B) · 24.7 kB CSS (0) — — · — · —
TableHeaderCell 114.0 kB (−32 B) · 17.7 kB CSS (0) — — · — · —
lab/Comments 358.8 kB (−32 B) · 2.5 kB CSS (0) — — · — · —
Table 130.3 kB (−33 B) · 18.5 kB CSS (0) — — · — · —
DateTimeInput 215.3 kB (−35 B) · 18.7 kB CSS (0) — — · — · —
Markdown 193.4 kB (−35 B) · 20.8 kB CSS (0) — — · — · —
BreadcrumbItem 89.8 kB (−36 B) · 12.1 kB CSS (0) — — · — · —
Carousel 73.1 kB (−36 B) · 10.9 kB CSS (0) — — · — · —
DropdownMenu 102.3 kB (−36 B) · 17.6 kB CSS (0) — — · — · —
TableSelectionToolbar 73.6 kB (−36 B) · 13.2 kB CSS (0) — — · — · —
MoreMenu 102.5 kB (−37 B) · 17.6 kB CSS (0) — — · — · —
lab/CommentComposer 156.4 kB (−37 B) · 1.9 kB CSS (0) — — · — · —
TabList 46.4 kB (−38 B) · 6.5 kB CSS (0) — — · — · —
Tokenizer 102.0 kB (−38 B) · 19.1 kB CSS (0) — — · — · —
richtext/RichTextEditorToolbar 284.4 kB (−38 B) · 454 B CSS (0) — — · — · —
DropdownMenuSubMenu 73.1 kB (−41 B) · 9.7 kB CSS (0) — — · — · —
SegmentedControl 100.2 kB (−41 B) · 6.9 kB CSS (0) — — · — · —
Toolbar 46.3 kB (−42 B) · 8.1 kB CSS (0) — — · — · —
charts/ChartTooltip 186.6 kB (−44 B) · 451 B CSS (0) — — · — · —
charts/Chart 209.5 kB (−51 B) · 516 B CSS (0) — — · — · —
layer — — — · ✓ · —
Layer — — ✓ · ✓ · —

Package size: @astryxdesign/core 7.36 MB packed (−246 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.

Changes requested: one blocking finding, on the UIKIT_CLICK removal; the rest of the cleanup checks out.

  • Code that imports UIKIT_CLICK from Core's motion/uikit barrel loses it, and although no package entry exports it and nothing in the repository imports it, ending that deprecation needs an explicit owner decision for UIKIT_CLICK, so cite it in the description (a decision card, or the owner's quoted words with a time) or move the removal into its own pull request. Found by: deprecation rule

Dropping wasJustDismissed keeps the same-press guard in openNow, which every show() path reaches; public useLayer keeps its fields and memoization; and the rewritten architecture:layer-runtime paragraph matches the code.

Claims and files checked
  • Claim: the internal layer hook drops a dismissal-check field that no component reads. Verified: useLayer.tsx:2475-2497; no reader outside useLayer.tsx at the base.
  • Claim: Core drops an unused deprecated stray-click constant that no package entry exports. Verified: Core's exports map has no motion/uikit entry and internal/touch.ts:80 re-exports only UIKIT_GESTURES.
  • Claim: the layer still refuses to reopen during the press that closed it, and apps see no change. Verified: openNow (useLayer.tsx:1546-1551) is unchanged and every show() branch calls it; ContextLayerReturn and FixedLayerReturn are unchanged.
  • Claim: nothing in packages, apps, CLI templates or docs imports the constant, and no API listing names it. Verified: it appears only in gestures.ts, the motion/uikit barrel and its test at the base.
  • Claim: Selector and MultiSelector use the keep-open helpers for good. Verified: Selector.tsx:1443, :2405; MultiSelector.tsx:1537, :2729.
  • Claim: the record said DropdownMenu and Selector-family triggers read the guard, and now says the guard comes from show(). Verified: layer-runtime.md:313-316 against useLayer.tsx:1688-1789.
  • Claim: useLayer returns the implementation's memoized object, so it stays stable. Verified: useLayer.tsx:2504-2508; the dropped dependency was a callback with no dependencies.
  • Claim: the wasJustDismissed callback stays because openNow calls it, and the dismissal comment now names openNow. Verified: useLayer.tsx:1376-1391, :1549.
  • Claim: the two light-dismiss harnesses merge, the duplicate test and the field type assertions go. Verified: useLayer.test.tsx:2895-3002, Popover.test.tsx.
  • Claim: one internal chore changeset for Core, no new public API, no behavior change. Verified from the source.
  • Claim: the listed test, typecheck, lint and check-script results, and that CI's browser interaction specs run on this change. Not confirmed: CI's test jobs were skipped on this draft head.
  • File .changeset/layer-unread-dismissal-field.md: clear.
  • File docs/architecture/layer-runtime.md: clear.
  • File packages/core/src/Field/InputClearButton.tsx: clear.
  • File packages/core/src/Layer/useLayer.tsx: clear.
  • File packages/core/src/Layer/useLayer.test.tsx: clear.
  • File packages/core/src/Popover/Popover.test.tsx: clear.
  • File packages/core/src/motion/uikit/gestures.ts: blocking finding above.
  • File packages/core/src/motion/uikit/index.ts: part of the same finding.
  • File packages/core/src/motion/uikit/uikit.test.ts: clear.

Automated review (maintainer link)

@cixzhang cixzhang changed the title chore(core): remove the same-press leftovers: an unread dismissal field, a dead constant, stale comments chore(core): remove the same-press leftovers: an unread dismissal field and stale comments Nov 12, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 3e5c888

@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: CI passed on this head, including the layer, Popover, Selector and DropdownMenu suites and the browser interaction specs.

Dropping wasJustDismissed keeps the same-press guard in openNow, which every show() path reaches; public useLayer keeps its fields and memoization; and the rewritten architecture:layer-runtime paragraph matches the code. The UIKIT_CLICK deprecation stays exactly as on main, so the earlier finding remains fixed.

Claims and files checked
  • Claim: the internal layer hook returned a dismissal-check field that no component reads, because show() absorbs the closing press itself. Verified: before this change only useLayer.tsx, two test files and the record referenced it, and openNow checks it (useLayer.tsx:1549).
  • Claim: Selector and MultiSelector use the keep-open helpers for good, so the two rollout comments were stale. Verified: Selector.tsx:1443, :2405; MultiSelector.tsx:1537, :2729.
  • Claim: the layer-runtime record said DropdownMenu and Selector-family triggers read the guard; it now says show() gives every trigger path the guard, and no rule changes. Verified: layer-runtime.md:313-316 against useLayer.tsx:1688-1789; INV7 is unchanged.
  • Claim: users see no change, and the same-press check in openNow is untouched. Verified: openNow (useLayer.tsx:1546-1551) is outside the diff and every show() branch calls it; CI's visual report shows Field, Layer and Popover unchanged.
  • Claim: the field, its type and the public hook's strip step go, and useLayer returns the implementation's memoized object, which stays stable. Verified: useLayer.tsx:2475-2508; the dropped dependency is a callback with no dependencies (:1388-1391).
  • Claim: the wasJustDismissed callback stays because openNow calls it, and its comment now names openNow. Verified: useLayer.tsx:1376-1391, :1549; the comment sits on the ref the callback reads.
  • Claim: UIKIT_CLICK, its barrel line and its test are unchanged from main. Verified: nothing under packages/core/src/motion/ differs from the base or from main.
  • Claim: the two rollout comments now say what the code does, with no code change under them. Verified: InputClearButton.tsx:176-179, useLayer.tsx:1202-1205.
  • Claim: the two light-dismiss harnesses merge, the duplicate test goes, and the field type assertions go. Verified: useLayer.test.tsx:2798-2809, :2895-3002; Popover.test.tsx:83-101.
  • Claim: one internal chore Changeset for Core, no new public API and no behavior change. Verified: the Changeset matches the code, and CI's API report lists no change for any published package.
  • Claim: the light-dismiss suite stayed green with the trigger-side check removed. Consistent: the merged suite, whose trigger checks nothing, passes in CI.
  • Claim: the listed suites pass, Core typechecks and lint is clean. Verified in CI at this head: every unit and interaction shard, typecheck and lint passed; the Lab error count and the local check scripts were not reproduced.
  • Claim: CI's browser interaction specs for DropdownMenu, Selector and Popover run on this change. Verified: all interaction shards passed, including the Popover, DropdownMenu and layer light-dismiss specs.
  • File .changeset/layer-unread-dismissal-field.md: clear.
  • File docs/architecture/layer-runtime.md: clear.
  • File packages/core/src/Field/InputClearButton.tsx: clear.
  • File packages/core/src/Layer/useLayer.tsx: clear.
  • File packages/core/src/Layer/useLayer.test.tsx: clear.
  • File packages/core/src/Popover/Popover.test.tsx: clear.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 12, 2026 05:32
@cixzhang
cixzhang merged commit 38521ac into main Nov 12, 2026
134 checks passed
@github-actions
github-actions Bot deleted the chore/same-press-leftovers branch November 13, 2026 06:03

This branch was successfully deployed

1 active deployment
Preview — 3e5c888b 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

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.

1 participant