Skip to content

Commit 9d7cffe

Browse files
authored
docs(core): the role test's header and the motion README's files name the internal roles (#8502)
One commit on `main`: vjeux@9667b538b5. ## Why Someone reading the motion code to learn which values are motion roles gets a wrong answer from two files: the roles test's header says every spring, duration and curve of a registered table is a role, and the motion README's file table leaves out the two files that hold the roles. ## What led to it This comes from the work to make Astryx's touch components behave as native iOS ones do (sheets, menus, gestures and their motion). #8257 made only the values `spec:AST-094` FR4 names into roles (`registerMotionTable(id, table, {roles})`), kept in `roles.ts` with their CSS form in `roleValue.ts`. Its review's item 3 asked for these two descriptions to follow. ## Options and tradeoffs - Correct the wording where it is, or copy the role list into the README and point the test at it. A copy would be one more list to keep in step with `roles.ts`. ## Why this choice The code already holds the list. The header and the README only need to say what it is and where it lives. ## How to check it 1. Open `packages/core/src/motion/roles.test.ts`: its header says the registered roles are exactly the ones FR4 names, each by its table path, and that a component's own measured spring is no role. 2. Open `packages/core/src/motion/README.md`: the files table lists `roles.ts` and `roleValue.ts`. 3. Run `pnpm exec vitest run packages/core/src/motion/roles.test.ts`: it passes as before; only comments and the README changed. ## Evidence - Local gates at 9667b53: build, type check, `pnpm test:ui` (17,016), the node suites, lint, the knowledge check, and the changeset checks; Prettier reports every changed file clean. - A `[chore]` changeset keeps the release coverage check green. ## Scope - [x] This PR changes documentation only, or names every necessary generated artifact (a test file's header comment, the README, and a `[chore]` changeset for the coverage check). - [x] Runtime, API, visual, and policy changes were removed or split. - [x] Public text and artifacts contain no internal Meta context.
1 parent 19ae6fc commit 9d7cffe

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/core': patch
3+
---
4+
5+
[chore] Internal: the motion roles test's header and the motion README's files table name the internal motion roles, exactly the ones `spec:AST-094` FR4 lists. Documentation only; no behavior change.
6+
7+
@vjeux

‎packages/core/src/motion/README.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ so each keeps its measured value; no shipped component reads the roles yet.
1919
| `uikit/timing.ts` | Non-spring clocks and curves: press highlight, Core Animation's named curves, keyboard, Reduced Motion cross-fade. |
2020
| `uikit/navigation.ts` | UINavigationController: push velocity, parallax, dimming, transition clock, interactive pop finish rule. |
2121
| `uikit/gestures.ts` | Gesture recognizer thresholds, the velocity filter and haptic stand-ins, as `{value, unit}` entries (sources in JSDoc). |
22-
| `roles.ts` | Motion roles: each spring, duration and curve of a registered table, named by its path, and its CSS variable. |
22+
| `roles.ts` | The internal motion roles: the springs, durations and curves `spec:AST-094` FR4 names, registered by the shared tables, and a role's CSS form read back. |
23+
| `roleValue.ts` | A role's CSS form, written: a spring's duration and bounce, a duration in ms, a curve's `cubic-bezier()`. |
2324
| `resolveMotion.ts` | A role's value: its table value, as the per-role tables stay internal (`spec:AST-094` DEC-15). |
2425
| `MEASUREMENTS.md` | The UIKit reference captures each unconfirmed value still needs. |
2526
| `spring.ts` | Closed-form damped spring, every Apple parameterization, settling duration, a spring chasing a moving target. |

‎packages/core/src/motion/roles.test.ts‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
/**
44
* @file roles.test.ts
5-
* @input roles.ts and the shared UIKit tables (registered on import)
6-
* @output Proof that each spring, duration and curve of a registered table is
7-
* a role named by its path, that non-motion values are not, and that a
8-
* role's CSS value reads back as the same motion
5+
* @input roles.ts and the shared UIKit tables (registered by this test)
6+
* @output Proof that the registered roles are exactly the ones spec:AST-094
7+
* FR4 names, each by its table path; that every other table value, a
8+
* component's measured spring included, is no role; and that a role's CSS
9+
* value reads back as the same motion
910
* @position Testing for /packages/core/src/motion/roles.ts
1011
*/
1112

0 commit comments

Comments
 (0)