Carry mid-segment paragraph breaks from the editor to the server #69

Merged
mike merged 4 commits from paragraph-breaks-mid-segment-controls into master 2026-10-04 21:02:55 -04:00
Owner

Transcript administrators can start a new paragraph at a segment boundary, but not in the middle of a segment's text. #68 added paragraph breaks and stored each one on a segment, so a break mid-sentence means splitting that segment in two. The store can't split a segment yet.

This change builds everything between the click and that split, so the next change only has to teach the store to split:

  • A break inside a segment's text posts to POST /admin/transcripts/{slug}/segments/{id}/paragraph-break with the segment's text and the break's offset. A break at either end of a segment still takes the boundary path from #68. Both Shift-click and the context menu reach the new endpoint.
  • The handler parses the request and answers 501 Not Implemented until the store can split. It retargets the response to the editor's error region, so an error never replaces the transcript. A malformed segment ID answers 400 the same way.
  • An unsaved edit in another segment saves first, and the break request follows once that save returns.

Until the split lands, a break inside a segment reports "Paragraph breaks within a segment are not implemented yet." Before this change, that click did nothing at all.

Testing gap: no browser test exercises the context menu's paragraph action, here or before this change. Only Shift-click runs in a browser.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

Transcript administrators can start a new paragraph at a segment boundary, but not in the middle of a segment's text. #68 added paragraph breaks and stored each one on a segment, so a break mid-sentence means splitting that segment in two. The store can't split a segment yet. This change builds everything between the click and that split, so the next change only has to teach the store to split: - A break inside a segment's text posts to `POST /admin/transcripts/{slug}/segments/{id}/paragraph-break` with the segment's text and the break's offset. A break at either end of a segment still takes the boundary path from #68. Both Shift-click and the context menu reach the new endpoint. - The handler parses the request and answers `501 Not Implemented` until the store can split. It retargets the response to the editor's error region, so an error never replaces the transcript. A malformed segment ID answers `400` the same way. - An unsaved edit in another segment saves first, and the break request follows once that save returns. Until the split lands, a break inside a segment reports "Paragraph breaks within a segment are not implemented yet." Before this change, that click did nothing at all. Testing gap: no browser test exercises the context menu's paragraph action, here or before this change. Only Shift-click runs in a browser. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Let the editor request a paragraph break inside a segment
All checks were successful
ci/crow/pr/build Pipeline was successful
ddf3655172
Shift-click or the context menu inside a segment's text now posts the segment text and offset to a paragraph-break endpoint. The server answers 501 Not Implemented until it can split segments, and a pending edit in another segment saves first.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
mike force-pushed paragraph-breaks-mid-segment-controls from ddf3655172
All checks were successful
ci/crow/pr/build Pipeline was successful
to c011a679ef
All checks were successful
ci/crow/pr/build Pipeline was successful
2026-09-22 19:38:51 -04:00
Compare
mike force-pushed paragraph-breaks-mid-segment-controls from c011a679ef
All checks were successful
ci/crow/pr/build Pipeline was successful
to 6495f88e0d
All checks were successful
ci/crow/pr/build Pipeline was successful
2026-09-22 20:21:23 -04:00
Compare
mike force-pushed paragraph-breaks-mid-segment-controls from 6495f88e0d
All checks were successful
ci/crow/pr/build Pipeline was successful
to a48b40b24c
All checks were successful
ci/crow/pr/build Pipeline was successful
2026-09-22 20:56:19 -04:00
Compare
mike changed target branch from paragraph-breaks-model to master 2026-09-30 21:05:34 -04:00
mike force-pushed paragraph-breaks-mid-segment-controls from a48b40b24c
All checks were successful
ci/crow/pr/build Pipeline was successful
to d138ed8c1b
All checks were successful
ci/crow/pr/build Pipeline was successful
2026-10-01 08:21:38 -04:00
Compare
mike changed title from Let the editor request a paragraph break inside a segment to Tell editors why a paragraph break inside a segment does nothing 2026-10-04 12:13:35 -04:00
mike changed title from Tell editors why a paragraph break inside a segment does nothing to Report that a paragraph break inside a segment isn't supported yet 2026-10-04 14:23:05 -04:00
mike changed title from Report that a paragraph break inside a segment isn't supported yet to Carry mid-segment paragraph breaks from the editor to the server 2026-10-04 14:41:58 -04:00
mike force-pushed paragraph-breaks-mid-segment-controls from d138ed8c1b
All checks were successful
ci/crow/pr/build Pipeline was successful
to 3a40ed2664
All checks were successful
ci/crow/pr/build Pipeline was successful
2026-10-04 17:09:16 -04:00
Compare
Set the editor's error framing once per request
All checks were successful
ci/crow/pr/build Pipeline was successful
b5c3d785dd
`segmentParagraphBreakPost` has no success path yet, so every response it writes is an error that htmx should drop into `#editor-error`. Setting `HX-Reswap` and `HX-Retarget` once at the top of the handler says that, instead of repeating the pair in each exit.

`segmentPatch` keeps its per-branch copies: its success path renders the editor fragment, and retargeting that to `#editor-error` would swap the editor into the error box.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mike scheduled this pull request to auto merge when all checks succeed 2026-10-04 20:59:03 -04:00
mike merged commit 69a6b453b1 into master 2026-10-04 21:02:55 -04:00
mike deleted branch paragraph-breaks-mid-segment-controls 2026-10-04 21:02:55 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
oe/transcripts!69
No description provided.