Repository navigation
feat: give every block its motion from ViteHub UI's motion layer - #474
Conversation
…s driver renames
Latest result Pull request merged. Final answersSession Pull request merged. Pushed 7db6fce to resolve the merge conflict, preserve zoom-header controls and element mapping, and make the citation-card test observe the slide before checking that it settled. Lint and all 11 focused zoom tests passed. Annotation passed 72 of 73 tests; the remaining CLI test hit a locally reproduced subprocess output issue. Sandbox restrictions blocked browser verification, so CI is pending. |
There was a problem hiding this comment.
Important
The documented subtree opt-out does not stop motion in zoom dialogs, citation cards, or code moves. Chromium also reproduced regressions in copy feedback and text selection.
Approach: Sharing the motion layer is a good fit, but effects need to respect the source block’s opt-out even when they render elsewhere in the DOM.
Reviewed changes across the five PR commits:
- Runtime and presets: The new
comark-motionpackage, its HTML script export, framework mount paths, and default preset registration. - Block interactions: The migration of press, selection, disclosure, tooltip, zoom, copy, divider, poll, media, and upload behavior.
- Docs and verification: The ViteHub dependency pin and driver migration, motion source checks, and browser coverage. The package builds, docs production generation and link checks, 97 focused unit tests, and all 32 new Chromium motion tests passed.
gpt-6.2-sol(high) | 𝕏
Keeps this PR's version over base changes: - pnpm-workspace.yaml: The PR intentionally uses one ViteHub preview stack providing the motion helpers while retaining main's dependency policy and docs integration changes.
There was a problem hiding this comment.
Important
The first click on a previously used table or chart’s Copy button does nothing in the zoom dialog. The new commit also leaves the end-to-end and Vite Doctor checks red.
Reviewed changes since 7db6fce:
- Propagated motion opt-outs from source blocks to zoom dialogs, citation cards, and code moves.
- Preserved copy icons in cloneable markup and excluded animated time tooltips from text selection.
- Merged the docs updates from
mainwhile retaining the ViteHub motion-stack pin. Docs generation, typechecking, link checks, and the properties browser tests passed.
gpt-6.2-sol(high) | 𝕏
There was a problem hiding this comment.
✅ No new issues found. No P0 or P1 findings remain in this incremental review.
Reviewed changes in 97a6e36 since b08631f:
- Preserved the first Copy click by keeping decorative SVGs out of hit testing while the button replaces its icon. The new zoomed-table test verifies that the first click writes to the clipboard and that the icon swaps back after feedback.
- Narrowed cloned icons to
Elementin all four copy adapters. Strict Vite Doctor passed forcomark-code,comark-table,comark-charts, andcomark-ui. - Corrected the Magic Move assertion and zoom fixture. All 26 focused Chromium tests passed, including the opt-out and scrolled-close cases.
gpt-6.2-sol(high) | 𝕏
comark-annotate
comark-badge
comark-bundle
comark-cards
comark-carousel
comark-cast
comark-charts
comark-chat
comark-chips
comark-cjk
comark-code
comark-code-notes
comark-colors
comark-comments
comark-critic
comark-deflist
comark-details
comark-diagrams
comark-diff
comark-embed
comark-fields
comark-figure
comark-file-tree
comark-footnotes
comark-git-graph
comark-github
comark-icon
comark-include
comark-keys
comark-links
comark-linter
comark-magic-move
comark-mark
markdown-it-to-comark
marked-to-comark
comark-mathml
comark-media
comark-metrics
migrate-to-comark
comark-motion
comark-outline
comark-properties
comark-qr
comark-quiz
comark-reading-time
remark-to-comark
comark-sources
comark-steps
comark-table
comark-tabs
comark-tests
comark-time
comark-ui
comark-xref
comark-zoom
commit: |
…ts that #14 dropped (#490) #14 (142b3d0) merged a stale branch over e2e/zoom.e2e.ts and deleted five tests and the lastFrame helper that 26233e9 had. They are back against today's fixtures. The closing test and lastFrame live in e2e/motion-zoom.e2e.ts, since the closing travel has come from comark-motion since #474 and the zoom-only renderer closes at once. The screenshot's zoom item is now .ca-stage, and the tab order steps over each screenshot's Copy button, which #26 added.

Comark UI's blocks each drew their own motion: about 45 hand-written transitions, keyframes, WAAPI calls, and frame loops, each with its own easing and duration. This PR moves every block onto ViteHub UI's motion layer, the one W1 to W5 of the ViteHub motion plan built, so a block gets its motion from the role of its elements or from a motion helper, and a block we add later moves like the others with no motion code of its own.
Evidence, at ¼× next to
main: https://drop.vitehub.dev/d/9c9940xrp2q0/comark-ui-motion-layer (the clips are in the folder https://drop.vitehub.dev/d/e8am3kt0n597/comark-ui-motion-evidence)How a document gets the layer
A new package,
comark-motion, bundles@vite-hub/ui/motion/corewith the effects Comark's blocks use: press, select, disclosure, tooltip, appear, label, button icon, slider, and divider. comark-ui's preset turns it on in every entry (motion: falseturns it off). Each document gets onemotion-runtimenode. The HTML renderer writes it as one inline script,motionScript, and the Vue, React, and Svelte components start the layer on mount. A block's inline script can't import, so it findstravel,ring,swapIcon,rollNumber, andmorphTextonwindow.__comarkMotionat the time of a change. Without it, the change happens at once.The inline script is 50 kB minified, 17.3 kB gzip, once per document. That is the main cost of this PR.
What moved where
:activescales are gone. Copy buttons are icon-only, so their icon squashes.data-motion-indicatorelement in every renderer, in place of a::beforemoved by WAAPI.data-motion-chevronelement that turns on a spring. The content opens at once, soshared/disclosure.tsis gone.:timetooltip, the citation card of comark-sourcesswapIcon, and the button rings once.travelmoves the frame from its place in the page to the dialog and back on springs. A close during the opening keeps the speed.::compare{mode="slider"}role="separator"(window splitter), and the layer bends its line past either edge. The flick coast (a frame loop) is gone.::pollresultstravel, and each percent rolls withrollNumber.createProgress).test/motion.test.tsis ViteHub's design rule, run on every package's source,shared/, and the docs app. It fails on hand-written motion that moves, resizes, or shakes. Its own-motion figures list has one entry,shared/code-motion.ts: the magic code move between steps is a picture of code changing, as Shiki Magic Move draws it, and a spring per word would measure hundreds of words. It setsdata-motion="none"on the code it moves.What the layer lacked
These are in vite-hub/vitehub#4953, on top of
feat/ui-motion-followups:travel(element, { from, to }), for comark-zoom and the poll bars.Until the motion stack merges, every
@vite-hub/*package, the docs site's included, comes from pkg.pr.new at that PR's head,4811d4b. That moves the docs site from theintegration/comark-ui-docsbuild to the motion stack, which also has vite-hub/vitehub#4660 to #4664. It also brings ViteHub'sdriverrenames, so the docs config now saysdatabase: { driver: "cloudflare" }andrealtime: { driver: "cloudflare" }, andtest/github-store.test.tspassesdriverto the GitHub store.Checked
pnpm check(format, lint, root typecheck, docs typecheck),pnpm test(3,249 passed), andpnpm run doctorpass on the branch rebased on v0.14.0.pnpm test:e2ein Chromium and Firefox: 372 passed. The one failure was the citation card's slide ine2e/motion-appear.e2e.tsunder full load; it passes 4 of 4 on its own with--repeat-each 4.e2e/motion*.e2e.ts(32 tests): the runtime starts once per document andmotion: falseleaves it out; the code and Mermaid bars squash by the layer, not CSS, and a copy rings and swaps its icon; the tab surface travels with inlinetranslateandscaleand clears at rest; a chevron turns through the angles between and the content is open on the first frame; zoom's frame starts on the picture, lands on its zoomed box, and goes back before the dialog goes, and a close during the opening has no jump; the time tooltip and the citation card rise from their trigger and leave on a copy; a poll bar grows to its share and its percent rolls. Each checks that reduced motion puts it at the end at once.comark-ui/htmlonmainand on this branch, with one Playwright script.Not checked, and known differences
pnpm docs:build), so the shell of@vite-hub/docsat4811d4bis checked only by its typecheck.npm stage publishallowed, before the next release.::compareis now arole="separator"(window splitter) rather than arole="slider". Screen readers announce it as a splitter, still with its value.timeupdate, a few times a second; video's followsrequestVideoFrameCallback. The old frame loop was a self-schedulingrequestAnimationFramethat the rule forbids.Prepared with Claude Opus 5.5 in T3 Code.