Skip to content

feat(core): make chapters activate on YouTube & Vimeo (#52) - #53

Merged
jbrecht merged 2 commits into
mainfrom
fix-52-chapter-platform-activation
Jun 15, 2026
Merged

jbrecht merged 2 commits into
mainfrom
fix-52-chapter-platform-activation

Conversation

@jbrecht

@jbrecht jbrecht commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Closes #52.

Problem

The chapter artifacts shipped in #35 were emitted without respecting the activation rules of the platforms authors actually upload to, so they could silently fail:

  • YouTube disables the entire description chapter list if a single chapter is under 10s — and our chapters are one-per-step, so a short step killed all of them with no error.
  • Vimeo caps chapter titles at 50 characters; our default was 60, so longer titles could be rejected/truncated.

Changes

  • enforceMinChapterDuration(chapters, minMs) (new, exported) folds any chapter shorter than the floor into a neighbor: a too-short chapter merges into the one before it (which keeps its title and extends), and a too-short first chapter folds forward into the next (whose start is pulled to 0 so playback still opens inside a chapter). Chains collapse cleanly; a single surviving chapter is allowed (we never invent boundaries).
  • Applied to the YouTube .chapters.txt only (YOUTUBE_MIN_CHAPTER_MS = 10_000). The MP4 track and .chapters.vtt (Vimeo/web) keep the full per-step list — those players have no minimum-chapter rule, and this preserves the short Objectives/Recap card chapters there.
  • Default title cap 60 → 50 (Vimeo's limit, the strictest common target), so titles are safe everywhere by default.
  • Docs: reconciled the existing chapter sections — they mentioned the ≥3-chapter rule but omitted the ≥10s rule — and added a "Getting chapters onto YouTube and Vimeo" guide (getting-started.md, writing-tutorials.md).

Tests

7 new unit tests cover the fold cases (interior → previous, first → forward, trailing, chain-collapse, no-op paths) and the 50-char default cap. Full suite: 165 unit tests pass; pnpm build clean.

Notes

🤖 Generated with Claude Code

jbrecht and others added 2 commits June 15, 2026 11:09
The chapter artifacts from #35 were emitted without respecting the
upload platforms' activation rules, so they could silently fail:

- YouTube ignores the ENTIRE description chapter list if any single
  chapter is under 10s. Add `enforceMinChapterDuration` and fold sub-10s
  chapters into a neighbor for the `.chapters.txt` output (a too-short
  chapter merges into the prior one; a too-short first chapter folds
  forward so playback still opens inside a chapter). The MP4 track and
  the `.chapters.vtt` keep the full per-step list — those players have
  no minimum-chapter rule.
- Vimeo caps chapter titles at 50 chars; our default was 60. Lower the
  default title cap to 50 so titles are safe on the strictest target.

Docs: reconcile the existing chapter sections (which mentioned the
3-chapter rule but not the 10s floor) and add a "Getting chapters onto
YouTube and Vimeo" guide. No public API change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- e2e: the integration gate still asserted the pre-fold .txt contract
  (line count, "0:00 Objectives" first, "Recap" last). The getting-started
  cards are < 10s so they now fold in the .txt — move the full-list
  contract onto the .vtt (which keeps every chapter) and assert the ≥10s
  floor + 0:00 start on the .txt. Verified: full e2e gate passes.
- Export enforceMinChapterDuration + YOUTUBE_MIN_CHAPTER_MS from index.ts
  for parity with the other chapter helpers.
- CHANGELOG: the 60→50 title-cap default is an observable behavior change,
  not "no API change" — reword and note the new exports.
- Tests: add trailing-double-short fold, the composed intro+recap card
  scenario, and a floor/contiguity/0-start invariant check.
- Reword the fold comment that overstated the 0-start guarantee.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jbrecht
jbrecht merged commit 2bc01cf into main Jun 15, 2026
1 check passed
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.

Chapters: make emitted markers actually activate on YouTube & Vimeo (+ publishing docs)

1 participant