Skip to content

chore(core): the touch motion tables register FR4's context-menu springs as roles - #9432

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/f1-context-menu-spring-roles
Nov 2, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/f1-context-menu-spring-roles

Conversation

@vjeux

@vjeux vjeux commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

User impact

No user-facing change; the changeset is [chore]. main fails packages/core/src/motion/roles.test.ts, "has exactly the roles spec:AST-094 FR4 names", so every pull request's test job and main's own release check are red. AST-094 FR4 names three context-menu springs, springs.contextMenuLift, springs.contextMenuDismiss and springs.contextMenuMorph, but the touch motion tables do not register them as motion roles.

Problem and solution fit

  • Why it fails. The roles test holds the registered motion roles to the rows of FR4's table, which now include the three context-menu springs. The springs table has rows for the lift and the dismissal, at FR4's values, but registers neither as a role. It has no row for the morph. The record's current-state section names the gap: "the three springs.contextMenu* roles (FR4) are not registered motion roles."
  • Why it matters. The test is the one check that keeps the registered roles and the record from drifting apart, and while it fails, a red test job no longer tells a pull request anything.
  • The fix. The springs table gains CONTEXT_MENU_MORPH_SPRING (response 0.3 s, damping ratio 0.8), FR4's measured row, with its measurement's app and method in @source. The three context-menu rows are added to springs and to the roles the table registers, so the registered roles are FR4's again. The clauses that call them unregistered go from both records, since they no longer hold.

Expected behavior and authority

spec:AST-094 FR4: the role table names the motion roles, and the three springs.contextMenu* rows are among them, owned by component:ContextMenu (DEC-5). The registry (motion/roles.ts) registers exactly FR4's rows.

Smallest restoration

  • Springs: springs.ts adds the morph row, puts the three rows in springs, and registers them as roles. uikit/index.ts exports the new constant beside the other two.
  • Test: the roles test's list of registered roles gains the three entries.
  • Records: AST-094 loses the current-state bullet that called them unregistered. component:ContextMenu loses the same clause from FR5's implementation gap, from the FR5 motion-roles verification row ("Evidence gap: the three roles are not registered") and from the FR5 gap entry. The table's separator row re-pads with the shorter cell.
  • No component reads these springs yet.

Evidence

  • Reproduction before the change: on main, "has exactly the roles spec:AST-094 FR4 names" fails: FR4 names 20 roles and the tables register 17, missing the three context-menu springs. It passes on the commit before the record added the rows and fails from that commit on.
  • Result after the change: the roles suite passes (10 of 10), and so do the motion and theme suites (2,351).
  • Representative unchanged path: "registering the motion roles carries only the springs that are roles" (springRows.test.ts) still passes. The registered roles carry no spring outside FR4, and the keyboard, alert and sheet-detent rows stay out of the bundle.
  • Regression test: with this test file and record and main's springs table, both "has exactly the roles spec:AST-094 FR4 names" and "registers exactly the roles spec:AST-094 FR4 names, internally" fail; with this change both pass.

Status at this head: the gates have finished. At this head, Prettier, ESLint on the changed files, type check, check:knowledge, check:changesets, changeset coverage and the motion, theme and ContextMenu suites (2,429) pass. Full test:ui (17,838) and lint passed on the first head, whose code differs from this one only by the new row's doc comment.

Writing rubric results

spec:AST-094:

R1 narration: one "for now" in the closing note on motion values, outside this edit, left as is; the edit removes a bullet and adds no sentence.
R2 research: none in the edited section.
R3 evidence: the three FR4 rows cite their measurements, unchanged; no cell names a pull request.
R4 rejected alternatives: none added.
R5 change references: none in the record (searched for "#" followed by digits, "/pull/" and "/issues/").
R6 open questions: OQ1, OQ2 and OQ5 are unanswered and untouched.

component:ContextMenu:

R1 narration: none found; the edit removes three clauses and adds no sentence.
R2 research: none in the edited sections.
R3 evidence: the FR5 motion-roles row names the role registry tests, a fact, not a pull request.
R4 rejected alternatives: none added.
R5 change references: none in the record (searched for "#" followed by digits, "/pull/" and "/issues/").
R6 open questions: none; the record has none.

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

pnpm exec vitest run --project ui packages/core/src/motion/roles.test.ts packages/core/src/motion/uikit
pnpm check:knowledge

@vercel

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

Request Review

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

astracat-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

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

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

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 4615811

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC
PowerSearch 177.7 kB (+63 B) · 20.4 kB CSS (0) —
TreeList 45.0 kB (+48 B) · 5.0 kB CSS (0) —
AppShell 72.6 kB (+46 B) · 12.0 kB CSS (0) —
2 more components
Component Size LoC
SideNav 70.1 kB (+45 B) · 10.9 kB CSS (0) —
Collapsible 22.4 kB (+42 B) · 4.5 kB CSS (0) —

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

API changes: none in this pull request

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

Not run on this PR: add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.


Generated by PR Enrichment workflow | View full report

@cixzhang

cixzhang commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

/approve-spec d3645a6

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 2, 2026
@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 2, 2026
@cixzhang
cixzhang marked this pull request as ready for review November 2, 2026 02:13

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

Registering the three context-menu springs restores FR4's roles test, and the restoration itself looks right; two small fixes are needed before it can land.

  • CONTEXT_MENU_MORPH_SPRING's @source (packages/core/src/motion/uikit/springs.ts:358-359) should name the app and the method of its measurement, as spec:AST-094 FR2 requires and the neighbouring rows do.
  • docs/specs/components/ContextMenu/ContextMenu.spec.md still says the three roles are not registered (lines 106, 248 and 268-269); please drop those clauses along with the AST-094 bullet.

[Automated review]

Comment on lines +358 to +359
* @source measured: UIContextMenuInteraction's menu entrance and preview
* shadow, iOS 26.2 simulator, Oct 23 2026 (spec:AST-094 FR4)

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.

spec:AST-094 FR2 asks a simulator measurement to name the app, the iOS version, the method and the date. This note names the subject, iOS 26.2 and the date, but not the app or the method; the lift row above names both ("UIKit lab (injected host app) … the same hook (0.8, 0.32, tracking)"). Please add the app and method of the Oct 23 measurement that FR4's row cites.

…ngs as roles

spec:AST-094 FR4 names three springs that ContextMenu owns:
springs.contextMenuLift, springs.contextMenuDismiss and
springs.contextMenuMorph. The springs table carried the first two but
registered none of them as motion roles, and had no row for the third, so
the roles test, which holds the registered roles to FR4's table, failed.

The table gains CONTEXT_MENU_MORPH_SPRING (response 0.3 s, damping ratio
0.8, FR4's measured row, with its measurement's app and method) and
registers all three as internal roles. The clauses that named them
unregistered go from AST-094's current-state section and from ContextMenu's
FR5, verification and gap entries. No component reads them yet.
@vjeux
vjeux force-pushed the uikit/f1-context-menu-spring-roles branch from d3645a6 to 4615811 Compare November 2, 2026 02:34
@vjeux

vjeux commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

Both fixed in 4615811:

  • CONTEXT_MENU_MORPH_SPRING's @source now names the app and the method, as the neighbouring rows do: the UIKit lab (injected host app) on the iOS 26.2 simulator, iPhone 17 Pro. Its per-frame morph and platter layers (the menu content's opacity, blur and scale, the morph container's centre and the preview shadow's opacity) each fit (0.30, 0.80) at rms ≤ 0.001, and the issued UIViewSpringAnimationBehaviorSettings are (0.8, 0.3), Oct 23 2026.
  • component:ContextMenu drops the three clauses that called the roles unregistered: FR5's implementation gap, the FR5 motion-roles verification row's evidence gap, and the FR5 gap entry. The rubric results for both records are in the description.

@cixzhang

cixzhang commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

/approve-spec 4615811

@github-actions github-actions Bot added needs:spec-owner-review Current knowledge records await owner approval and removed needs:spec-owner-review Current knowledge records await owner approval labels Nov 2, 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.

Registering the three context-menu springs restores the FR4 roles test, and both earlier points are fixed: the morph spring's @source now names its app and method, and the ContextMenu record no longer calls the roles unregistered. This looks ready to land. As an optional follow-up, no test pins the three roles to their FR4 values yet, and packages/core/src/motion/MEASUREMENTS.md still lists only the lift and dismiss springs for the context menu.

[Automated review]

This branch was successfully deployed

1 active deployment
Preview — 46158119 Deployed Nov 2, 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