-
-
Notifications
You must be signed in to change notification settings - Fork 4
Horizontal (16:9) + square clips, per-format captions, and studio UI refresh #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+948
−215
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0eaad64
Add horizontal (16:9) and square clip formats
nmbrthirteen 16a7bab
Scale captions per format and add studio format selector
nmbrthirteen b204a44
Refine studio palette, unify button system, add "New frame" thumbnail…
nmbrthirteen 1172122
Add "New frame" action to the standalone Thumbnail studio page
nmbrthirteen 21c9058
Standardize form inputs across the studio and unify label styling
nmbrthirteen de2b40e
Extract repeated hint text into reusable .hint / .hint-xs classes
nmbrthirteen 25599dc
Extract secondary meta text into a reusable .meta class
nmbrthirteen c730336
Darken studio surfaces and fix toggle contrast, textarea fonts, tabul…
nmbrthirteen 95f7870
Polish studio UI: unify borders, darker surfaces, SVG icons, portal m…
nmbrthirteen 3c6a080
Add Content studio custom generation + preview, persist episode state…
nmbrthirteen 4a2c5b7
Merge remote-tracking branch 'origin/main' into feat/horizontal-clips…
nmbrthirteen 3d81b90
Address CodeRabbit review: format validation, preset format, frame-in…
nmbrthirteen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| """Output format specifications — the single source of truth for clip dimensions. | ||
|
|
||
| Every aspect-ratio decision (crop target, caption geometry, duration bounds, | ||
| which scoring profile applies) derives from a FormatSpec so the render pipeline | ||
| is parameterized on format instead of hardcoding 1080x1920 per call site. | ||
| """ | ||
|
|
||
| import sys | ||
| from dataclasses import dataclass | ||
|
|
||
|
|
||
| @dataclass(frozen=True) | ||
| class FormatSpec: | ||
| name: str | ||
| width: int | ||
| height: int | ||
| reframe: bool | ||
| caption_profile: str | ||
| dur_min: int | ||
| dur_max: int | ||
| target_min: int | ||
| target_max: int | ||
| score_key: str | ||
|
|
||
| @property | ||
| def dims(self) -> tuple[int, int]: | ||
| return (self.width, self.height) | ||
|
|
||
| @property | ||
| def ratio(self) -> float: | ||
| return self.width / self.height | ||
|
|
||
|
|
||
| FORMATS = { | ||
| "vertical": FormatSpec( | ||
| name="vertical", | ||
| width=1080, height=1920, | ||
| reframe=True, | ||
| caption_profile="vertical", | ||
| dur_min=20, dur_max=45, | ||
| target_min=20, target_max=35, | ||
| score_key="vertical_score", | ||
| ), | ||
| "horizontal": FormatSpec( | ||
| name="horizontal", | ||
| width=1920, height=1080, | ||
| reframe=False, | ||
| caption_profile="lower_third", | ||
| dur_min=60, dur_max=300, | ||
| target_min=90, target_max=240, | ||
| score_key="horizontal_score", | ||
| ), | ||
| "square": FormatSpec( | ||
| name="square", | ||
| width=1080, height=1080, | ||
| reframe=True, | ||
| caption_profile="center", | ||
| dur_min=20, dur_max=45, | ||
| target_min=20, target_max=35, | ||
| score_key="vertical_score", | ||
| ), | ||
| } | ||
|
|
||
| DEFAULT_FORMAT = "vertical" | ||
|
|
||
|
|
||
| def get_format(name: str | None) -> FormatSpec: | ||
| if name is not None and name not in FORMATS: | ||
| # Raw MCP/API callers bypass the CLI's choices= guard; warn so a typo'd | ||
| # format doesn't silently render as vertical. | ||
| print(f"[formats] unknown format {name!r}; using {DEFAULT_FORMAT}", file=sys.stderr) | ||
| return FORMATS.get(name or DEFAULT_FORMAT, FORMATS[DEFAULT_FORMAT]) | ||
|
nmbrthirteen marked this conversation as resolved.
|
||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.