Skip to content

Milestone 5: runtime wiring and Sine - #6

Merged
rodzy merged 8 commits into
mainfrom
milestone-5-runtime
Nov 27, 2026
Merged

rodzy merged 8 commits into
mainfrom
milestone-5-runtime

Conversation

@rodzy

@rodzy rodzy commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

What does this change?

Milestone 5: runtime wiring and Sine integration.

  • src/runtime.js: startMediaViz watches Zen's media toolbar (only added cards and title/artist label changes) and each playing tab's media controller metadatachange events, then shows or removes artwork on each card sized for 36 CSS px × devicePixelRatio. Errors while refreshing are logged and the mod keeps working. destroy() removes all artwork, the observer and listeners.
  • src/install.js and src/index.js: install(window) tears down any previous instance, starts the runtime, exposes window.ZenMediaViz.destroy(), registers teardown with Sine's addUnloadListener, and logs if the toolbar is missing.
  • src/log.js: logError with the [zen-media-viz] prefix.
  • theme.json (Sine manifest, supportsUnload: true) and chrome.css (thumbnail sizing).
  • test/smoke.test.js removed; it tested the placeholder MOD_NAME export.
  • zen-media-viz.uc.js regenerated with the source changes.
  • Docs: how Sine loads the mod (CLAUDE.md), an Artwork checklist in docs/manual-testing.md, the changelog entry and the roadmap (M5 Done, M6 Next).

How was it tested?

  • Unit tests for the runtime, install and theme manifest (test/runtime.test.js, test/install.test.js, test/theme.test.js). npm test passes (117 tests), along with npm run lint, npm run format:check and npm run check:bundle.
  • Not yet run in a real Zen. The maintainer still has to run the Artwork section of docs/manual-testing.md in Zen with Sine installed from this branch.

Checklist

  • Tests were written first and cover the change (npm test)
  • npm run lint and npm run format:check pass
  • Bundle rebuilt and committed (npm run build) if anything in src/ changed
  • Relevant items in docs/manual-testing.md checked in a real Zen + Sine install (pending: the maintainer runs the Artwork section in Zen)
  • CHANGELOG.md updated under Unreleased

Watch Zen's media toolbar and each playing tab's metadata, and keep
every card's artwork in step with the track it shows. Installing the
mod tears down any previous instance and registers teardown with
Sine's unload listener. Removes the placeholder smoke test.
theme.json lets Sine install the mod from this repository and sets
supportsUnload so disabling it does not ask for a restart. chrome.css
sizes the artwork thumbnail. A test pins the manifest.
Record the Sine loading rules read from Sine's source in CLAUDE.md,
and add the manual Zen checklist for artwork to manual-testing.
Add the runtime and Sine manifest entries to the changelog and move
the roadmap to milestone 6.
A controller that throws an unexpected error now gets logged and skipped, so one broken tab no longer stops artwork for the other tabs.
A throwing destroy() on a stale instance is logged instead of aborting install, so the new instance still starts.
Extract controllerWatcher and observeTrackChanges from startMediaViz. No behavior change. Regenerate the bundle.
The smoke test was removed, so the single-file example now uses test/artwork.test.js. Drop the sentence that promised installability in Milestone 5.
@rodzy
rodzy merged commit 59f4a3f into main Nov 27, 2026
1 check passed
@rodzy
rodzy deleted the milestone-5-runtime branch November 27, 2026 23:44
@rodzy

rodzy commented Nov 27, 2026

Copy link
Copy Markdown
Owner Author

Manual testing (docs/manual-testing.md, Setup and Artwork sections) passed on Zen 1.24.3b, macOS. Installed through Sine from the milestone-5-runtime branch. Sine version not recorded.

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