Skip to content

Teach this on backtoschool.help: a class title that fits, walked up from the lecture to its collection - #219

Merged
ralyodio merged 1 commit into
mainfrom
worktree-class-title-fit
Sep 17, 2026
Merged

ralyodio merged 1 commit into
mainfrom
worktree-class-title-fit

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

What broke

Clicking Teach this on backtoschool.help while a folder channel was live failed with:

Could not open a classroom: title is too long

A folder channel names its entry by the whole served path, and a course is deep (Coursera - Deep Learning Specialization/1. Neural Networks.../Week 1.../03_what-is-a-neural-network.mp4), so the title ran past the school's 160-character limit in live-events.ts. The school's own form already has maxlength="160", so the one-click flow was the only sender of an oversize title.

What changed

classTitle() in web/src/live-context.ts trims a title that does not fit by walking up from the file:

  • the lecture (cleaned by liveTitle, so 03_what-is-a-neural-network.mp4 becomes what-is-a-neural-network) and the outermost folder (the collection) are always kept
  • the folders between are filled back in from the lecture upward while they fit, so the nearest context survives first
  • if even collection + lecture run over, the collection is cut at a word and the lecture stays whole
  • a title with no path is cut at a word; a title that already fits is left alone

Example at 160: Coursera - Deep Learning Specialization › Neural Networks and Deep Learning Basics › what-is-a-neural-network-and-how-does-it-learn

teachOnSchool() in web/src/app.ts passes the share title through it before POSTing the class.

Verified

  • bun test web/test: 109 pass (2 new tests for classTitle)
  • web typecheck clean

🤖 Generated with Claude Code

…rom the lecture to its collection

A folder channel names its entry by the whole served path, and a course is
deep (collection / part / week / lecture), so the one-click class from a
live room sent a title past the school's 160 and got "title is too long".

classTitle() in web/src/live-context.ts keeps the lecture (cleaned by
liveTitle) and the outermost folder, fills the folders between back in
from the lecture upward while they fit, and as a last resort cuts the
collection at a word so what is playing is never the part that is lost.
A title with no path in it is cut at a word. Titles that already fit are
left alone. The school's own form has maxlength=160, so this was the only
sender of an oversize title.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@ralyodio
ralyodio marked this pull request as ready for review September 17, 2026 22:42
@ralyodio
ralyodio merged commit 1acb1f7 into main Sep 17, 2026
4 checks passed
@ralyodio
ralyodio deleted the worktree-class-title-fit branch September 17, 2026 22:42
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