Skip to content

Fill the editor demo to four clips from any available segments - #78

Merged
blixvip merged 1 commit into
blixvip:mainfrom
jay23606:pr-go/69-build-a-four-clip-editor-demo-from-whate
Nov 16, 2026
Merged

blixvip merged 1 commit into
blixvip:mainfrom
jay23606:pr-go/69-build-a-four-clip-editor-demo-from-whate

Conversation

@jay23606

Copy link
Copy Markdown
Contributor

The bug

The editor demo should have four clips whenever the library has at least four segments. On the base commit, demoClipList only returns the hardcoded picks, or the first segment of the first four references when no pick exists, so the demo can show fewer than four clips even when the library has at least four segments.

The change

demoClipList in public/editor-model.mjs now fills in this order:

  1. The hardcoded picks that exist.
  2. The first segment of each reference not yet used.
  3. Further segments of the other references, round by round.
  4. Further segments of the hardcoded references, round by round.

Duplicates are skipped, and the toast count comes from the real clip count.

Testing

  • node --test test/editor-demo.test.js: 4 pass with the fix. On the base commit, all 4 fail with demoClipList missing: expected a function, got undefined.
  • npm test: all tests pass (2 skipped).
  • npm run check: passes.

Fixes #69

Regression test: fails on base twice (/demoClipList missing: expected a function, got undefined/), passes on fix twice (node --test test/editor-demo.test.js)

Fixes #69

@blixvip
blixvip merged commit 0627493 into blixvip:main Nov 16, 2026
1 check passed
@blixvip

blixvip commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Thank you, @jay23606. This fixes a first-visit problem: a fresh clone now opens the editor demo with four clips whenever the library has enough segments, and the toast count matches the timeline.

If you want another one, #77 — Point the docs at public/sections.mjs for section and beat timing is a good first issue and nobody has claimed it yet.

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.

Build a four-clip editor demo from whatever references are available

2 participants