Repository navigation
Host core: playback runs without React - #148
Merged
Merged
Conversation
agorischek
force-pushed
the
playback-store
branch
from
November 21, 2026 17:36
5eca4ae to
ad8236f
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Retaining the caller’s mutable view instead of a snapshot can bypass change detection and leave active playback running when reduced motion is enabled.
1 open issue
What changed in this PR
Extracts playback orchestration from React into an internal controller, preparing host core for the headless projection store while retaining the React adapter.
Changes:
- Adds an actor-backed controller with an injectable frame scheduler and host callbacks.
- Simplifies
usePlaybackControlto manage controller lifecycle and reconcile rendered values. - Adds framework-free playback tests and updates the headless-store implementation plan.
| File | Description |
|---|---|
packages/host/core/test/playback-controller.test.mjs |
Tests startup, cancellation, playback, seeking, subject changes, and declined play. |
packages/host/core/src/projection/playback-controller.ts |
Introduces framework-free playback orchestration and view reconciliation. |
packages/host/core/src/projection/playback-control.ts |
Delegates playback to the controller while retaining React integration. |
docs/design/proposals/headless-store.md |
Documents the extraction and defers store composition to step 5. |
Review effort: Balanced
createPlaybackController drives playbackLifecycle with createActor: the frame loop runs on an injectable scheduler (requestAnimationFrame by default), the playing and position requests go to a host, and show() sends the *Shown events from what the view shows. Nothing runs until its actor starts. usePlaybackControl keeps only React's part: it creates the controller once, starts it in a layout effect and calls show after every render. Node tests cover playback with a hand-stepped scheduler and no React. Step 3 of the headless store design. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
agorischek
force-pushed
the
playback-store
branch
from
November 21, 2026 19:37
ad8236f to
191eec2
Compare
A host that updates one view object in place and shows it again still has its subject, mode and reduced-motion changes noticed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Step 3 of the headless store design (
docs/design/proposals/headless-store.md), stacked on #147.createPlaybackController(projection/playback-controller.ts) drivesplaybackLifecyclewithcreateActor, outside React:framesactivity runs on an injectableFrameScheduler(requestAnimationFrameby default);requestPlayingandrequestPositioneffects go to aPlaybackHost;show(view)sends the*Shown,modeChangedandsubjectChangedevents, reading the actor's state between sends as before.actor.start().usePlaybackControlkeeps only React's part: it creates the controller once, starts it in a layout effect and callsshowafter every render. Timing andProjectionControllerare unchanged.test/playback-controller.test.mjs) cover starting and stopping, playing to the end, pausing, seeking, a new subject (core- and embedder-controlled) and a declined play, with a hand-stepped scheduler and no React.