You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Karaoke (animated) captions now expose Text color + Stroke color pickers in
both the Create pre-selection panel and the per-clip Edit modal. The stroke
defaults to black and the highlight accent stays the preset's; both the base
text and stroke are recolourable per preset. generate_ass_karaoke gains a
validated outline_color override.
Subtitles can also be horizontally aligned left (ragged / "a bandiera") or
centered — never right, since the social UI (like/comment/share) lives down
the right edge. Left keeps a small margin from the edge and widens the right
margin so the text column clears the social buttons. The pure, host-tested
subtitles.ass_alignment_and_margins() maps the vertical anchor's ASS \an code
to its left variant (+margins); the classic SRT path does the same on the
legacy SSA codes via burn_subtitles(h_align=). normalize_h_align() rejects
'right'.
Wired through seedSubtitleParams / optsToPreselections / compose._apply_subtitles.
Host-tested (tests/domain/test_subtitle_align.py); ffmpeg burn paths verified
by the Docker integration suite (30 passed). Frontend lint+build+tests green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kggb11c98UYEA648Q2Y629
Copy file name to clipboardExpand all lines: CLAUDE.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -250,7 +250,9 @@ When using ASS karaoke, the `ass` FFmpeg filter is used with `fontsdir` pointing
250
250
251
251
The live subtitle controls live in **two** places, kept symmetric: the Create-tab pre-selection panel `create.jsx:SubConfig` (writes flat `opts.sub*` keys → `realApi.js:optsToPreselections` → `preselections.subtitles.*`) and the per-clip `captions.jsx:EditClipModal` (seeds from `preselections.subtitles` + the clip's saved `subtitleParams`). Both emit the **same `subtitle_params` shape** via `lib/seedClipParams.js:seedSubtitleParams`, consumed by `compose.py:_apply_subtitles` → `subtitles.py`.
252
252
253
-
**Controls (both panels):** mode (karaoke/classic), position (top/center/bottom segmented), and a **Vertical nudge** slider (`offset_y`, −50…+50). Karaoke adds a **Style preset** grid + a **Font size** slider (`font_size`, 0 = Auto → preset size). Classic adds font, colour swatch, **Outline width** (`border_width`, 0–6) and a **Background box** toggle (`bg_opacity` 0/0.6 + black `bg_color`).
253
+
**Controls (both panels):** mode (karaoke/classic), position (top/center/bottom segmented), an **Alignment** segmented (`align` — **left** = ragged "a bandiera" / **center**; **no right** because the social UI like/comment/share buttons sit on the right edge), and a **Vertical nudge** slider (`offset_y`, −50…+50). Karaoke adds a **Style preset** grid, a **Font size** slider (`font_size`, 0 = Auto → preset size), and **Text color** + **Stroke color** pickers (`font_color` / `outline_color` — stroke defaults black, both recolourable per preset; highlight accent stays the preset's). Classic adds font, colour swatch, **Outline width** (`border_width`, 0–6) and a **Background box** toggle (`bg_opacity` 0/0.6 + black `bg_color`).
254
+
255
+
-**Horizontal alignment (`align`)** is left/center only, honoured in both modes. Karaoke: `subtitles.py:ass_alignment_and_margins(vpos, align)` (pure, host-tested) maps the vertical anchor's centred ASS \an code (top 8 / center 5 / bottom 2) to its left variant (7/4/1) and widens the right margin (`_SUB_MARGIN_LEFT_RIGHT=220` vs left `_SUB_MARGIN_EDGE=110`) so ragged-left text keeps a small edge margin but clears the right-edge social buttons. Classic SRT (`burn_subtitles(..., h_align=)`) does the same on the legacy SSA codes (centre 6/10/2 → left 5/9/1) + `MarginL`/`MarginR`. `normalize_h_align` collapses anything that isn't an explicit left request (incl. `right`) to `center`. Karaoke text/stroke colour overrides ride `font_color`/`outline_color` through `compose._apply_subtitles` → `generate_ass_karaoke`. Host-tested in `tests/domain/test_subtitle_align.py`.
254
256
255
257
**Param-flow invariants (don't regress):**
256
258
-**`offset_y` sign is unified** — positive moves the caption DOWN in *both* the karaoke ASS and classic SRT paths via the pure `subtitles.py:_offset_margin(position_norm, base, offset_y)` helper (top-anchor adds, bottom/center subtract; clamped ≥0). Host-tested in `tests/domain/test_subtitle_style.py`.
0 commit comments