Repository navigation
feat(skills): add the living-ui explode helper - #22441
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 5bf9e2a Description read[DESCRIPTION-READ] 8784c8e94446b963f0dc8eb27bac3376463ef11b37773b668784dfaffffdf913 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS One thing to check: What this change shipsInventory (6 items) — 6 justifiedIntent: give authors a block they can copy for rule X's exploded view, so they don't hand-write the stagger and the reversal. ADDITION. Rule X is already on base at SKILL.md:87, and the old helpers and defaults are unchanged, so this is not a product-shape change.
[FIRST-PRINCIPLES-REVIEWED] 5bf9e2a Description read[DESCRIPTION-READ] 9d5113a7cc9b08f109492ee48d0e7841e93a7fb24e56e69079c6b9375487ef8a That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Before merging, watch shot-01.gif and confirm the top layer leaves first and returns last. The blind reader saw only a still frame. Suggestions
[UX-REVIEWED] 5bf9e2a Description read[DESCRIPTION-READ] ed4a5e6a52ca1b8339bc7bf8a0d6f5ee5d1bb65a2bafd91c39cb3d5252363aa4 That sha256 names everything this verdict read: the PR description, plus the 16 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
d60e147 to
d0a385b
Compare
|
|
|
|
Two backend shards are red on this head,
Both fail on main too, with the same assertions, at 6432cad (run 39378186978): the slot-creator registry still names The fix is in flight: #22433 (issue #22432). This PR does not re-run or work around those reds; it rebases onto main once #22433 merges. |
|
|
|
LivingUI.explode takes a figure apart for rule X: one spring per part, starts staggered 35 ms apart, closing in reverse order, and a reversal part-way re-staggers only the parts whose target changes. Under calm every part lands at once, and step returns false once all have landed so the caller's loop can sleep. The block calls no other helper, carries the anatomy notice, and SKILL.md gains its copy, signature and one paragraph.
d0a385b to
5bf9e2a
Compare
|
|
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Every review lane on the head is clean (only runner notices and PR Scope size warnings); held by the triage cron on a category, path or P0-area rule, not a finding. Approved on the watch holder's request.
Problem / Motivation
Goal: Give Living UI figures a copyable
explodehelper: an exploded view whose parts leave one after another about 35 ms apart, come home in reverse order, and turn back part-way without sending out a part that never left.Rule X lets a figure open up on hover or a key so a reader sees its parts, and the rule is exact: one spring per part, starts staggered about 35 ms apart, closing in reverse order, a reversal part-way re-staggers only the parts whose target changed, and the selected part is lit. Today an author writes all of that by hand. The easy slips are the ones a reader sees: parts that all jump at once, a close that runs in the opening order, a quick hover-and-leave that sends parts that never left flying out and back, motion under reduced motion, or a loop that never sleeps.
This is PR 5 of the Living UI RFC (
docs/request-for-change/rfc-living-ui.md, §11 row 5; RFC PR #21797).Why it matters
A crewmate with no file tools builds a figure by copying the readable blocks in
living-ui/SKILL.md, so rule X holds only if a block it can copy does the work. Without one, every exploded view re-implements the stagger and its reversal rule, and the reversal is the easy one to get wrong: anatomy, where the rule comes from, records a duct driven through a pump that had not left yet, because a reversal rescheduled the whole list.Not a goal
What changed (motivation → approach → change)
An exploded view has to take the parts out in an order a reader can follow and bring them back without one passing through another. RFC §5.2 fixes the shape,
explode(items, { stagger = 35, k = 64, c = 14.2 })withitemsas[{ el, move: [dx, dy] }], returning{ open(apart), toggle(), step(dt, calm) }, and anatomy's motion notes are the source of the constants and the reversal rule.open(true)staggerms after the one before, each on its own spring from 0 (the markup) to 1 (moved bymove)open(false)open()with the state it already hasstep(dt, calm)under calmstepanswers false, so the loop sleeps, and nothing more is writtenThe helper is a new marked block between
focusOneandcssintoolkit/living-ui.js. It calls no other helper, so it carries its own copy ofspring's four-substep step, and a test holds the two copies to the same path frame for frame. Its clock moves only withstep'sdt, so a stagger pauses offscreen with the loop. Each part's element gets a CSStranslatein px, which inside an SVG are user units, written only when the part moves and removed at 0, so the assembled figure is exactly the markup. The defaults sit just under critical damping: a part passes its target by about 0.15% and lands about 1.4 s after it starts.scripts/copy_living_ui_blocks.pyregenerated the block's copy inSKILL.md, whose API section gains the signature and one paragraph: drivestepfrom the loop's tick; open on hover, a tap or a key, with hover read from a mouse only, since every tap fires enter and leave; light the picked part withfocusOneand name it in the readout. The whole file minifies to 3,851 bytes (explodealone is 655), inside the 5,120-byte budget.Backwards compatibility
Compatible: one helper is added, and no existing helper's code or SKILL.md rule changes.
Removes nothing: the diff adds a helper, its SKILL.md copy, API text and tests; both
HELPERSlists gainexplode.Tests
website/src/test/livingUiToolkit.test.ts(vitest) runs theexplodeblock alone in the samenode:vmpage as the other helpers, over real happy-dom SVG<g>elements, and steps it with chosendt:stagger: 100gives 1, 100, 200;stagger: 0starts all three at once.stepanswers false once the moved part lands, under 1.6 s.open(true)while opening, oropen(false)while closed, changes nothing against a twin;toggle()matchesopen(true)andopen(false)frame for frame through four turns.step's answer: true while a part moves or waits (at 1.67 s part 0 has landed and part 1 still waits), false after; more steps, calm or not, write nothing.k: 400, c: 40lands in under 60% of that time and never passes the target;c: 4passes it by more than 30%; with 0.1 ms steps, a loose spring lands only within 0.0005 of its target, never at the top of a swing.move; a view that never opens writes nothing; the transform is the fullmoveapart and gone at home.spring: thespringandexplodeblocks in one page, with the samek,canddt, give the same position and the same answer every frame, for three springs, until both land.loop: theloopandexplodeblocks together: the loop sleeps once every part lands, after more than 80 frames, and after one frame under reduced motion.test/test_living_ui_toolkit.py(pytest):HELPERSnamesexplode, so the file must mark it, and the drift tests pin its SKILL.md block to the marked helper.Each guard is proven. 34 mutations of the
explodeblock, one at a time in a throwaway worktree, each turned at least one test red: no stagger, a 30 ms default, the first changed part waiting a stagger; closing in the opening order, opening reversed, reversing the parts in place; a reversal rescheduling every part, counting the unchanged ones, or keeping a waiting part's start;open()restarting on the state it has; starting apart;toggle()repeating the state; the clock in seconds; a start applied a frame late, or a frame late on the exact ms; calm leaving parts waiting or not landing them; a start never cleared; a waiting or a moving part not keepingsteptrue;stepalways true; a 0.05 landing gap; landing without the speed check;korcignored, or a wrong default for either; one quarter-dtsubstep, or four whole-dtsubsteps; writing on every step;translate(0px, 0px)left at home;dyfollowingdx; no px unit; the full move at any share. Four more, two in each copy of the spring step (spring's landing gap or its substep default,explode's substep count or its update order), each turn thespringtest red.Determinism. pytest file: 20 runs at
-n0, 10 runs at-n 4 --dist loadgroupbesidetest_living_ui_skill.pyandtest_living_ui_example.py, and one shuffled order (seed 29494): 13 passed each time (23 with the siblings). vitest file: 10 runs, each shuffled (seeds 64, 17341, 11432, 16240, 11422, 14267, 8194, 31602, 7477, 9067), 76 passed each time.Local gates. The five living-ui pytest files (51 passed), isort, flake8, black, eslint on the changed test file, semgrep on the diff, the brand, line-cap, comment-history, harness-parity, feature-map, builtin-skill-scope, testpaths, focus-cue, changelog, decisions and docs-lint checks, jscpd and the flake-pattern ratchet (60 passed) all pass. Local GPT and Opus reviews, briefed from CI's own contracts, found nothing.
Manual verification
The
explodeblock ran in headless Chromium (Playwright 1.58) inside the harness's explainer frame (the chat's CSP, sandbox and theme), in a probe figure, a crewmate drawn as four stacked layers, that copies theloop,explode,readoutandfocusOneblocks unchanged. Times are real time.assembled · skills, the top layer lit↓lights the next layer?slow=0.05, opening?slow=0.05, leaving 1 s in?reduced=1pointercanceland leaves the figure as it was; with a mouse, a click on an open figure changes nothingScreenshots / video
The probe figure through
scripts/harness.py, in light and dark. The probe is not part of the diff.Real time: the pointer enters and the layers leave, it leaves and they come home in reverse order, then a quick hover-out about 0.3 s after entering turns every layer back, the last one out first.
recorded from d0a385b · the probe figure, built from that tree's
loop,explode,readoutandfocusOneblocks, in thescripts/harness.pyframe · mode:?theme=light· headless Chromium, real pointer input, no fixturesSlowed to 1/20 (
?slow=0.05): the pointer leaves 50 ms of figure time after entering, before the third layer's start. The third layer never leaves; the second turns back at once and the top one 35 ms later.recorded from d0a385b · same probe and frame · mode:
?theme=light&slow=0.05· headless Chromium, real pointer input, no fixtures?reduced=1, 80 ms after the hover390 px on a touch screen, 2 s after one tap, light and dark:
Slowed to 1/20 (
?slow=0.05), opening: 1.5, 3, 5 and 9 s after the hover, left to right, top to bottom.Slowed, the pointer leaves 1 s in, shots 0.6, 2, 4 and 8 s later: the third layer never leaves, and the other two turn back.
Related Issues
Part of #21796
RFC: #21797
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)