Skip to content

feat: give every block its motion from ViteHub UI's motion layer - #474

Merged
vite-hub[bot] merged 7 commits into
mainfrom
feat/motion-layer
Nov 19, 2026
Merged

vite-hub[bot] merged 7 commits into
mainfrom
feat/motion-layer

Conversation

@onmax

@onmax onmax commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

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/core with 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: false turns it off). Each document gets one motion-runtime node. 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 finds travel, ring, swapIcon, rollNumber, and morphText on window.__comarkMotion at 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

Interaction Blocks Now
Press code bar, Mermaid bar, quiz buttons, docs playground and tools buttons The layer's press. The CSS :active scales are gone. Copy buttons are icon-only, so their icon squashes.
Select one of many tabs and code groups, magic-move's tabs, the docs' segmented switches The layer's select. The tab surface is a real data-motion-indicator element in every renderer, in place of a ::before moved by WAAPI.
Show or hide content details, accordion, collapsible, chat traces, bundle's treemap, the issues box The chevron is a real data-motion-chevron element that turns on a spring. The content opens at once, so shared/disclosure.ts is gone.
Something appears next to its trigger :time tooltip, the citation card of comark-sources The layer's appear effect: it rises from behind its trigger and plays its exit on a copy. Without the script, the time tooltip still opens by CSS.
A copy finished code, table, charts, Mermaid, annotate The icon swaps with swapIcon, and the button rings once.
A picture opens larger comark-zoom travel moves the frame from its place in the page to the dialog and back on springs. A close during the opening keeps the speed.
Drag a divider ::compare{mode="slider"} The handle is a focusable role="separator" (window splitter), and the layer bends its line past either edge. The flick coast (a frame loop) is gone.
A share and a count change ::poll results Each bar grows to its share with travel, and each percent rolls with rollNumber.
Work runs the editor's upload placeholder The layer's progress bar (createProgress).
Reading surfaces media's volume panel and settings menu They open at once.

test/motion.test.ts is 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 sets data-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:

  • Copies of the layer now share one install. Comark UI's copy and the host app's would otherwise both observe the same tab and move it twice.
  • travel(element, { from, to }), for comark-zoom and the poll bars.
  • The divider effect hides only the element that draws its line, so the swipe's grip stays while the line bends.

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 the integration/comark-ui-docs build to the motion stack, which also has vite-hub/vitehub#4660 to #4664. It also brings ViteHub's driver renames, so the docs config now says database: { driver: "cloudflare" } and realtime: { driver: "cloudflare" }, and test/github-store.test.ts passes driver to the GitHub store.

Checked

  • pnpm check (format, lint, root typecheck, docs typecheck), pnpm test (3,249 passed), and pnpm run doctor pass on the branch rebased on v0.14.0.
  • pnpm test:e2e in Chromium and Firefox: 372 passed. The one failure was the citation card's slide in e2e/motion-appear.e2e.ts under full load; it passes 4 of 4 on its own with --repeat-each 4.
  • New Chromium tests of the real effects, in e2e/motion*.e2e.ts (32 tests): the runtime starts once per document and motion: false leaves 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 inline translate and scale and 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.
  • The recordings in the evidence folder render each block through comark-ui/html on main and on this branch, with one Playwright script.

Not checked, and known differences

  • Not recorded: chat traces (Vue, React, and Svelte only), the issues box, media's menus, the upload bar, magic-move's tabs, and the docs site's own controls. Their tests cover them, except the upload bar, which no test renders in a browser, and the docs site controls, which no docs e2e covers.
  • I haven't built or opened the docs site on the new pin (pnpm docs:build), so the shell of @vite-hub/docs at 4811d4b is checked only by its typecheck.
  • comark-motion has no trusted publisher on npm yet. It needs one, with npm stage publish allowed, before the next release.
  • The divider of ::compare is now a role="separator" (window splitter) rather than a role="slider". Screen readers announce it as a splitter, still with its value.
  • Synced code groups restore a saved tab from code after load. With the layer running, that can slide the tab surface on load; the old script didn't animate restores.
  • The citation card has no trigger the appear effect can find, so it rises from 8px past its own edge near the citation rather than from behind it. Its title swaps at once while it slides to the next citation.
  • Audio's seek bar now steps on timeupdate, a few times a second; video's follows requestVideoFrameCallback. The old frame loop was a self-scheduling requestAnimationFrame that the rule forbids.
  • The swipe's line is white, so its bend past an edge is faint on a light page.
  • The inline script adds 17.3 kB gzip to every document, as above.

Prepared with Claude Opus 5.5 in T3 Code.

@vite-hub

vite-hub Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Last seen running 2026-11-19T22:09:48.084Z 0s
View session Cancelled 2026-11-19T21:59:47.758Z 8m 37s
View session Last seen running 2026-11-19T21:26:34.186Z 2s
View session Cancelled 2026-11-19T20:49:44.859Z 22m 20s
View session Completed 2026-11-19T17:11:28.751Z 7m 14s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

View session

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.

@vite-hub
vite-hub Bot marked this pull request as ready for review November 19, 2026 17:21

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-motion package, 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.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

Comment thread packages/zoom/src/script.ts Resolved
Comment thread packages/code/src/client.ts Resolved
Comment thread packages/code/src/client.ts Resolved
Comment thread packages/time/src/client.ts Resolved
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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 main while retaining the ViteHub motion-stack pin. Docs generation, typechecking, link checks, and the properties browser tests passed.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

Comment thread packages/table/src/client.ts Resolved
Comment thread e2e/magic-move.e2e.ts Resolved
Comment thread e2e/motion-zoom.e2e.ts Resolved
Comment thread packages/table/src/client.ts Resolved

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 Element in all four copy adapters. Strict Vite Doctor passed for comark-code, comark-table, comark-charts, and comark-ui.
  • Corrected the Magic Move assertion and zoom fixture. All 26 focused Chromium tests passed, including the opt-out and scrolled-close cases.

Pullfrog  | View workflow run | Using gpt-6.2-sol(high) | 𝕏

@pkg-pr-new

pkg-pr-new Bot commented Nov 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

pnpm add https://pkg.pr.new/comark-annotate@474

comark-badge

pnpm add https://pkg.pr.new/comark-badge@474

comark-bundle

pnpm add https://pkg.pr.new/comark-bundle@474

comark-cards

pnpm add https://pkg.pr.new/comark-cards@474

comark-carousel

pnpm add https://pkg.pr.new/comark-carousel@474

comark-cast

pnpm add https://pkg.pr.new/comark-cast@474

comark-charts

pnpm add https://pkg.pr.new/comark-charts@474

comark-chat

pnpm add https://pkg.pr.new/comark-chat@474

comark-chips

pnpm add https://pkg.pr.new/comark-chips@474

comark-cjk

pnpm add https://pkg.pr.new/comark-cjk@474

comark-code

pnpm add https://pkg.pr.new/comark-code@474

comark-code-notes

pnpm add https://pkg.pr.new/comark-code-notes@474

comark-colors

pnpm add https://pkg.pr.new/comark-colors@474

comark-comments

pnpm add https://pkg.pr.new/comark-comments@474

comark-critic

pnpm add https://pkg.pr.new/comark-critic@474

comark-deflist

pnpm add https://pkg.pr.new/comark-deflist@474

comark-details

pnpm add https://pkg.pr.new/comark-details@474

comark-diagrams

pnpm add https://pkg.pr.new/comark-diagrams@474

comark-diff

pnpm add https://pkg.pr.new/comark-diff@474

comark-embed

pnpm add https://pkg.pr.new/comark-embed@474

comark-fields

pnpm add https://pkg.pr.new/comark-fields@474

comark-figure

pnpm add https://pkg.pr.new/comark-figure@474

comark-file-tree

pnpm add https://pkg.pr.new/comark-file-tree@474

comark-footnotes

pnpm add https://pkg.pr.new/comark-footnotes@474

comark-git-graph

pnpm add https://pkg.pr.new/comark-git-graph@474

comark-github

pnpm add https://pkg.pr.new/comark-github@474

comark-icon

pnpm add https://pkg.pr.new/comark-icon@474

comark-include

pnpm add https://pkg.pr.new/comark-include@474

comark-keys

pnpm add https://pkg.pr.new/comark-keys@474

comark-links

pnpm add https://pkg.pr.new/comark-links@474

comark-linter

pnpm add https://pkg.pr.new/comark-linter@474

comark-magic-move

pnpm add https://pkg.pr.new/comark-magic-move@474

comark-mark

pnpm add https://pkg.pr.new/comark-mark@474

markdown-it-to-comark

pnpm add https://pkg.pr.new/markdown-it-to-comark@474

marked-to-comark

pnpm add https://pkg.pr.new/marked-to-comark@474

comark-mathml

pnpm add https://pkg.pr.new/comark-mathml@474

comark-media

pnpm add https://pkg.pr.new/comark-media@474

comark-metrics

pnpm add https://pkg.pr.new/comark-metrics@474

migrate-to-comark

pnpm add https://pkg.pr.new/migrate-to-comark@474

comark-motion

pnpm add https://pkg.pr.new/comark-motion@474

comark-outline

pnpm add https://pkg.pr.new/comark-outline@474

comark-properties

pnpm add https://pkg.pr.new/comark-properties@474

comark-qr

pnpm add https://pkg.pr.new/comark-qr@474

comark-quiz

pnpm add https://pkg.pr.new/comark-quiz@474

comark-reading-time

pnpm add https://pkg.pr.new/comark-reading-time@474

remark-to-comark

pnpm add https://pkg.pr.new/remark-to-comark@474

comark-sources

pnpm add https://pkg.pr.new/comark-sources@474

comark-steps

pnpm add https://pkg.pr.new/comark-steps@474

comark-table

pnpm add https://pkg.pr.new/comark-table@474

comark-tabs

pnpm add https://pkg.pr.new/comark-tabs@474

comark-tests

pnpm add https://pkg.pr.new/comark-tests@474

comark-time

pnpm add https://pkg.pr.new/comark-time@474

comark-ui

pnpm add https://pkg.pr.new/comark-ui@474

comark-xref

pnpm add https://pkg.pr.new/comark-xref@474

comark-zoom

pnpm add https://pkg.pr.new/comark-zoom@474

commit: 97a6e36

@vite-hub
vite-hub Bot merged commit aecfada into main Nov 19, 2026
7 checks passed
@vite-hub
vite-hub Bot deleted the feat/motion-layer branch November 19, 2026 22:22
@github-actions github-actions Bot mentioned this pull request Nov 19, 2026
vite-hub Bot pushed a commit that referenced this pull request Nov 25, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant