Repository navigation
ci(native): typecheck the native package and every platform type it emits - #8024
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewNo new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Visual Regression46 of 494 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 26 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
This looks ready to merge. The three steps join the existing typecheck job without a new lane or required check, this head's CI ran all three green, and a generator fault confined to macos.d.ts passes every existing check but fails the new typecheck:types step, so the gate closes a real gap. One optional follow-up: .github/workflows/deploy.yml describes its typecheck job as mirroring this one, so adding the same three steps there would keep the main push gate in step.
[Automated review]
… it (#7308) ## User impact On a phone, a `ContextMenu` a long press opens closes at once: as the finger lifts, Chromium sends the held element a compatibility `mousedown`, read as a press outside. ## Problem and solution fit - Why it occurs: the menu closes on any document `mousedown` outside it, and a touch's compatibility events target the held trigger. - Why it harms: no touch path. - Why it matters: iOS opens one only by a long press. ## Expected behavior and authority `spec:AST-094` (current) FR33: with a finger or pen, "the long press that opens a ContextMenu MUST NOT close it at the lift". `component:ContextMenu` FR5 routes the long-press lift there, and `architecture:interaction-modality` (current) INV4 asks for an operable path per modality. This PR implements that clause only; FR33's outside press (FR32), lift and handoff stay with their own work, and it changes no record row. #7303 proposes FR10 (focus on open); #7840, FR12. Overlap search over open PRs and records (`component:ContextMenu`, `layer-runtime.md`; "outside press", "long press", "compatibility"): #7303 and #7840 touch the same listener. ## Smallest restoration `main`'s outside `mousedown` listener stays, shadow-root handling included. It skips the compatibility mouse events of the finger press that opened the menu: the long press, or a touch `contextmenu` where Chromium sends one, recorded by the shared gesture counter (`Layer/gestureCounter`), which advances on every `pointerdown` and `keydown`. Any later press is a new gesture, so every other outside press keeps its outcome: a mouse or pen closes at the press, a tap on its compatibility `mousedown`, while a scroll, a cancelled or stopped `pointerdown`, an unpanned drag or a second finger leaves it open. A mouse or keyboard open records no gesture. No listener, API or default is added; `architecture:layer-runtime` names the skip. ## Evidence - Before, in real Chromium (CDP touch): the menu opens at about 510 ms; on lift come `pointerup`, `touchend`, then trusted `mousedown`, `mouseup` and `click` on the trigger, and it closes. - After: the menu stays open through that `click`, in a shadow root too; a tap or mouse click outside still closes it. - iOS Safari reportedly sends the `mousedown` mid-hold; the same gesture is skipped, but WebKit was not run here. - Regression proof: the long-press, touch `contextmenu` and moved-menu unit cases and both Chromium long-press cases fail on `main`; the mouse, pen and no-`mousedown` cases fail on the previous head and pass on `main`. ## Writing rubric results R1 narration: the layer-runtime line is present tense. R2 research: none. R3 evidence: none in the record; the tests below verify the line. R4 rejected alternatives: none. R5 change references: none. R6 open questions: none. ## Scope - [x] One defect is restored. - [x] Separable contradictory or unsettled tagalongs were removed or split. - [x] No new public API, visual representation, default, or interaction model is hidden under the bug-fix label. - [x] Public text and artifacts contain no internal Meta context. ## Testing - Maintainer merge 690291d brought in `main`: `ContextMenu.spec.md` takes `main`'s table, whose FR5 already routes the long-press lift to `spec:AST-094` FR33, so this PR no longer proposes FR11; the changeset names only the Chromium lift the tests show. The code, tests and `layer-runtime.md` line are unchanged. - Review round (163af16, rebased onto `main` 8b74911): narrowed to the long-press lift per the owner's requested change. `main`'s outside `mousedown` listener returns with one skip, the opening finger press's compatibility events (shared gesture counter); the pointer listeners, the nested-root levels and the five other outcome changes are gone. FR11, `layer-runtime.md` and the changeset say only that. ContextMenu, DropdownMenu, hooks, Layer and CLI suites: 1422 tests; long-press, shadow-root and ContextMenu audit Chromium specs: 23; native types, typecheck, `eslint` (strict), `check:knowledge` and the Storybook build pass. - Rebased onto `main` 39b5981 (486cec8), patch unchanged: the `typecheck` job's native platform types step runs a script `main` added in #8024, which 1fe5329's older base lacked. ContextMenu, DropdownMenu, hooks and CLI suites: 1216 tests; the long-press and shadow-root Chromium specs: 5; the native typecheck, build and platform-types steps, typecheck, `eslint` (strict), `check:knowledge` and the Storybook build pass. - Review round (1fe5329): the document `pointerup`/`pointercancel` listeners come on with an outside finger or pen press and off once none is live, instead of staying for the whole open menu (`architecture:react-component-runtime` INV5); `layer-runtime.md` says so. A new case shows none attached while the menu is open at rest and none after the lift; it fails on the previous head. ContextMenu, DropdownMenu, hooks and CLI suites: 1151 tests; the long-press and shadow-root Chromium specs: 5; typecheck, `eslint` (strict), `check:knowledge` and the Storybook build pass. ``` Rebased onto main 9f3ab05 (a5784a5, one commit): #7914 judged presses inside a shadow root with a `mousedown` listener on the menu's root, run before the document's. Capture reaches the document first, so each root from the document down to the menu's own now listens in the capture phase and defers a press on the host of the next root down; a press on such a host itself is judged by that host, whatever the host's own listeners do. #7914's open, closed and nested cases fire pointer events and also lift a finger on the menu; a new case stops presses in each root and on a host. They fail with the document judging every press (#7914's cases), with roots listening as the press bubbles, and with only the menu's own root listening (the new case). The `a11y/Menu press in a shadow root` stories gain a ContextMenu; the shadow-root spec checks in Chromium that a clicked item is picked (red with the document judging every press), that a press or a tap on the host closes the menu, and that its opening long press does not. `layer-runtime.md` names the extra listeners. vitest ContextMenu, DropdownMenu, Selector, hooks, Breadcrumbs Tests 1193 passed playwright MenuPressShadowRoot, ContextMenuLongPress, ContextMenuAudit --project=chromium 23 passed typecheck, lint:strict, check:knowledge, storybook:build ✓ Review round 3: rebased onto main 95e1674 as one commit; the rule is FR11, since #7303 proposes FR10 in the same record: vitest ContextMenu, DropdownMenu, useLongPress, docProp* Tests 376 passed playwright ContextMenu/__tests__ --project=chromium 23 passed typecheck, lint:strict, check:knowledge, storybook:build ✓ Review round 2: the listeners run in the capture phase, so a control that stops the press (ResizeHandle, Table's column-resize handle) still closes the menu; new case "closes on a press whose control stops it" fails with bubble-phase listeners: vitest ContextMenu, DropdownMenu, useLongPress, docProp* Tests 374 passed (DropdownMenuLazySheet's import hook timed out at 10 s under load; 2 passed alone) playwright ContextMenu/__tests__ --project=chromium 23 passed typecheck, lint:strict, check:knowledge, storybook:build ✓ Review round: the three changed presses are named (changeset, body, commit message), a new case pins the cancelled press, the unpanned drag and a second finger's tap (it fails on `main`), and docs/architecture/layer-runtime.md names the new listeners: vitest ContextMenu, DropdownMenu, useLongPress, docProp* Tests 375 passed playwright ContextMenu/__tests__ --project=chromium 23 passed typecheck, lint:strict, check:knowledge, storybook:build ✓ Rebased onto main 22c592a as one commit. Main's record now has FR9 (overlay dismissal), so this rule was proposed FR10 (now FR11, beside #7303's FR10): vitest ContextMenu, DropdownMenu, hooks, docProp* Tests 854 passed playwright ContextMenu/__tests__ --project=chromium 23 passed typecheck, lint:strict, check:knowledge, storybook:build ✓ red on main: `ContextMenuLongPress.a11y.chromium.spec.ts` against a `main` build: 1 failed (the long press and lift), 1 passed (the guard) pnpm exec vitest run packages/core/src/ContextMenu/ContextMenu.test.tsx -t "ContextMenu outside dismissal" main's ContextMenu.tsx: 3 failed, 3 passed (tap/scroll, mouse and mid-tap re-render guards) · with the change: 6 passed (the pen case fails on main, where a pen closes it at once; the re-render case failed on an earlier head) pnpm exec vitest run packages/core/src/ContextMenu packages/core/src/DropdownMenu packages/core/src/hooks/useLongPress.test.tsx \ packages/core/src/hooks/useMenuPress.test.tsx packages/core/src/docPropLiterals.test.ts \ packages/core/src/docPropReferences.test.ts --maxWorkers=8 Test Files 9 passed (9) Tests 324 passed (324) pnpm storybook:build (this branch; main for the red arm) ASTRYX_STORYBOOK_DIR=<main build> pnpm exec playwright test \ packages/core/src/ContextMenu/__tests__/ContextMenuLongPress.a11y.chromium.spec.ts --project=chromium 1 failed, 1 passed (long press: the menu is gone after the lift's click; mouse guard passes) pnpm exec playwright test packages/core/src/ContextMenu/__tests__/ContextMenuLongPress.a11y.chromium.spec.ts --project=chromium 2 passed · --repeat-each=2: 4 passed pnpm -F @astryxdesign/core typecheck, pnpm lint:strict, check:knowledge ✓ ```
Maintainer impact
No CI job runs
tscover@astryxdesign/native. The package is outside the rootpnpm build, and Vitest strips types without checking them, so a type error in its source or tests merges green. Its build also emits one declaration file per type-resolution condition (ios,android,macos,windows,shared), and nothing compiles those: the Vitest contract test loads only theios,android, andsharedentries, and the root config'sskipLibCheckwould skip them anyway. A generator change can therefore ship platform types a consumer cannot compile, and themacosandwindowstypes are never loaded at all.Intended invariant
AST-082: one contract generates the TypeScript types for every platform condition. Every emitted platform type compiles under
strict, and the package's own source and tests typecheck, on every pull request and merge-queue run that reaches thetypecheckjob.Change
typecheckjob (no new job, same specialized-lane skips):pnpm -F @astryxdesign/native typecheck, thenbuild, then a newtypecheck:typesscript.packages/native/tsconfig.types.jsoncompilesdist/types/*.d.tswithskipLibCheck: false.ci-native-typecheck.test.mjspins the three steps, their order afterpnpm build, and the declaration-only config.The three steps add about 10 seconds to the job (7 s, 2 s, and under 1 s locally).
Evidence
tscoverpackages/native(search.github/workflowsfor@astryxdesign/native). After injectingexport type Broken = Missing;into the emitteddist/types/macos.d.ts,typecheck:typesfails withTS2304: Cannot find name 'Missing'. Every existing check stays green with that error.typecheckrun.tsconfig.types.jsonis not infiles).Scope
Testing
pnpm -F @astryxdesign/native typecheck,build, andtypecheck:typespass locally.pnpm vitest run --project node .github/scripts/ci-native-typecheck.test.mjs .github/scripts/ci-tooling-routing.test.mjs .github/scripts/ci-test-routing.test.mjs .github/scripts/release-check-workflow.test.mjs .github/scripts/ci-native-swift.test.mjs packages/native: 10 files, 144 tests pass.test-node. This PR does not change that.