Repository navigation
chore(core): remove the same-press leftovers: an unread dismissal field and stale comments - #11332
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 15cc532 |
PR Analysis Report🔎 Preview ·
|
| 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
There was a problem hiding this comment.
Changes requested: one blocking finding, on the UIKIT_CLICK removal; the rest of the cleanup checks out.
- Code that imports
UIKIT_CLICKfrom Core'smotion/uikitbarrel loses it, and although no package entry exports it and nothing in the repository imports it, ending that deprecation needs an explicit owner decision forUIKIT_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 outsideuseLayer.tsxat the base. - Claim: Core drops an unused deprecated stray-click constant that no package entry exports. Verified: Core's
exportsmap has nomotion/uikitentry andinternal/touch.ts:80re-exports onlyUIKIT_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 everyshow()branch calls it;ContextLayerReturnandFixedLayerReturnare 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, themotion/uikitbarrel 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-316againstuseLayer.tsx:1688-1789. - Claim:
useLayerreturns 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
wasJustDismissedcallback stays becauseopenNowcalls it, and the dismissal comment now namesopenNow. 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.
|
/approve-spec 3e5c888 |
There was a problem hiding this comment.
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 onlyuseLayer.tsx, two test files and the record referenced it, andopenNowchecks 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-316againstuseLayer.tsx:1688-1789; INV7 is unchanged. - Claim: users see no change, and the same-press check in
openNowis untouched. Verified:openNow(useLayer.tsx:1546-1551) is outside the diff and everyshow()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
useLayerreturns 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
wasJustDismissedcallback stays becauseopenNowcalls it, and its comment now namesopenNow. 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 frommain. Verified: nothing underpackages/core/src/motion/differs from the base or frommain. - 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.
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:
useLayerstill returns an internalwasJustDismissedfield. No component has read it sinceshow()itself started to absorb the press that closed the layer.architecture:layer-runtimestill says DropdownMenu and Selector-family triggers read the guard.Users see no change.
Intended invariant
architecture:layer-runtimeINV7: the same physical press that closes a Layer cannot immediately reopen it. The check that enforces this still runs insideuseLayer'sshow()path (openNow), and this change does not touch it.Change
wasJustDismissedfield. It is removed from the internaluseLayerreturn, with itsInternalLayerFieldstype and the public hook's strip step.useLayernow returns the same memoized object that the implementation builds, so the returned object stays stable. ThewasJustDismissedcallback stays, becauseopenNowcalls it. Its comment now says thatopenNowreads it.UIKIT_CLICKstays. The deprecated constant, its barrel line and its keep-test are unchanged frommain. Ending that deprecation needs a separate owner decision.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 thatuseLayer'sshow()does not reopen the layer during the same gesture, so every trigger path gets the guard (INV7). It no longer says that triggers readwasJustDismissed(). This corrects a stale description only. INV7 already holds the rule, and no rule is added or changed.[chore] Internal:Changeset for@astryxdesign/core: shipped source changes, but no consumer sees a change.New public API: none. No behavior change.
Evidence
if (layer.wasJustDismissed()) return;from the light-dismiss harness first. All 5 tests in that suite stayed green, which proves that theshow()absorb carries the behavior.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).main, none in a file this change touches.openNow) is untouched. CI's browser interaction specs for DropdownMenu, Selector and Popover run on this change.Writing rubric results
Over the
architecture:layer-runtimeparagraph:show()does in the present tense.Scope
Components: Layer, Popover, Selector, MultiSelector, Field
Testing
vitest runfor the suites above.typecheck.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.