Repository navigation
Wrap a still's caption to more lines on a narrow frame instead of refusing the cut (#77) - #99
Merged
Merged
Conversation
…using the cut (#77) A still's subject is shared by every cut, but legibility is per-delivery: a 9:16 cut has half the width per line of a 16:9 one and twice the height. A caption tituli cannot set in its default line budget now gets a budget scaled by the frame's aspect (capped), shrink-then-wrap as tituli already does. Captions that fit are untouched; ones that still do not fit raise as before. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Fixes #77.
Behaviour chosen: option 2 (wrap to more lines on a narrow frame)
A still's
subjectis shared by every cut, but legibility is per-delivery: type is sized as a fraction of frame height and must fit the frame's width, so a 9:16 cut has about half the width per line of a 16:9 one and twice the height to spend. The least surprising fix is the one tituli already implements (shrink, then wrap, never truncate), given the line budget the frame can afford._wrap_labels_for_frameruns just beforetituli.video.overlayin the text pass. For each still caption that tituli cannot set in its default line budget, it lays it out with a budget ofceil(3 * (16/9) / aspect)lines, capped at 6 (named constants).TextDoesNotFit, still naming the still and the delivery (transforms: name the still and delivery in a caption-overflow error #82). Cards and attributions are untouched.Why not the others: (1)
subject_shortis a body-schema addition plus an authoring judgement per still, and is a federation event under this repo's rules. (3) opting out drops the attribution a labelled still exists to show. Both remain available later; this change does not foreclose them.Measured: the issue's still (a 100-char subject) needs 5 lines at 0.022 on 1080x1920; it now sets in 5 and renders in full (checked on a real 1080x1920 overlay render).
Tests
Three new tests (tall frame wraps what a wide frame refuses; a caption that fits is left identical; too long for even the taller budget still raises) plus doctests. Removing the wrap makes the first and third fail. Full run with
--doctest-modules: 709 passed; the 8 failures are all intests/test_mcp_caller_key.pyandtests/test_wire_descriptions.pycannot be collected, solely becausepy2mcpis not installed in the dev venv (CI installs themcpextra).Deploy
Merging releases to PyPI. Production picks it up by: braidio_mcp and reelee_mcp connector redeploys (unversioned git pins) and
pip install --no-deps braidio==<ver>in the backend venv, then restarting the backend.Adversarial review (fresh Opus subagent)
Verdict: OK to merge, no correctness defects. It checked: exact 16:9 sizes keep the default budget (no float creep), a caption that fits returns the identical overlay, no cache-key change needed (key already covers size, delivery and subject), the error path still names the still, attribution overflow still raises, nothing is truncated,
sizeas list or tuple. One confirmed gap: nothing guarded the call site in_composite. Fixed in the second commit withtest_a_vertical_finish_hands_tituli_the_wrapped_caption(deleting the call makes it fail).