Repository navigation
Make the video dialog and render honour a text selection - #204
Merged
Merged
Conversation
Selecting part of a note before opening the video export was meant to
render only that part, but two things kept it from working:
- The dialog's estimate request never sent the selection, so the footer
("N segments · N characters to narrate · about Xm") always described
the whole note.
- The editor sent the selection as Markdown, but the segmenter parses
BlockNote JSON and silently treats anything else as an empty note. A
selected render therefore had nothing in it beyond the title card and
bumpers, or failed with "no text or media".
The editor now sends the selected blocks as BlockNote JSON (the same form
as the stored note), the estimate passes them through, and the footer
says "Selection only" when one is in effect. Diagram rasterising walks
the selected blocks directly. The API refuses a selection that is not a
JSON block array rather than rendering it as empty, and an empty one
means the whole note.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QiJqUAvLhqbSCdkPRDbh7J
davior
marked this pull request as ready for review
October 7, 2026 01:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Selecting part of a note before opening Export → Video (MP4) was meant to render only the selection (added in #200). It didn't work, for two reasons:
/video/estimaterequest never sent the selection, so "N segments · N characters to narrate · about Xm" always described the full note.getEditorSelectionMarkdown), but the segmenter doesjson.loadson BlockNote JSON and treats anything else as an empty note. A selected render had only the title card and bumpers, or failed with "This note has no text or media".Changes
EditorView.tsx: sendseditor.getSelection().blocksas BlockNote JSON, the same form as the stored note. Diagram rasterising walks the selected blocks directly.videoGen.ts/VideoGenModal.tsx:estimate()takesselectedContent, the estimate re-runs when it changes, and the footer starts with "Selection only ·" when a selection is in effect.schemas.py:VideoRenderRequest.selected_contentmust be a JSON array of blocks or the request gets a 422, so it can no longer silently render nothing. An empty selection (""or[]) means the whole note.The selection works at block level, so a partly selected paragraph renders in full. That matches how segments are built.
Testing
backend/tests/test_video_selection.py:tsc --noEmitclean, vitest 204 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01QiJqUAvLhqbSCdkPRDbh7J
Generated by Claude Code