Skip to content

Warn before saving SCC when lines exceed 32 chars / 4 lines - #14014

Merged
niksedk merged 1 commit into
mainfrom
claude/scc-format-limit-warning
Aug 23, 2026
Merged

Warn before saving SCC when lines exceed 32 chars / 4 lines#14014
niksedk merged 1 commit into
mainfrom
claude/scc-format-limit-warning

Conversation

@niksedk

@niksedk niksedk commented Aug 22, 2026

Copy link
Copy Markdown
Member

Problem

Reported: convert SRT → SCC, merge short lines into longer doubles, save, reopen — the lines are split again. The SCC writer (FixMax4LinesAndMax32CharsPerLine) silently re-wraps/truncates anything over CEA-608's 32 columns × 4 rows, so the file never matches the grid and there is no warning.

Fix

  • libse: new SubtitleFormat.FormatLimits (SubtitleFormatLimits with MaxCharactersPerLine/MaxLines + GetViolatingParagraphNumbers). ScenaristClosedCaptions declares 32 × 4; other constrained formats can opt in with one override.
  • UI: SaveSubtitle checks the limits before ToText() (covers Save and Save As; auto-save never prompts). New FormatLimitWarningWindow lists the limits and affected line numbers, explains the text will be re-wrapped/truncated, offers Save anyway / Cancel (Cancel is the default focus) and a "Do not show this warning again" checkbox.
  • Setting General.ShowFormatLimitWarning (default on) backs the checkbox and is exposed in Options → Settings so it can be turned back on.
  • Language strings added; English.json regenerated.

Tests

  • 3 new libse tests: SCC limits, violation detection (tag-stripped length, >4 lines), default null.
  • dotnet build src/ui/UI.csproj clean.

Not changed: the writer still re-wraps on "Save anyway"; applying the 32-col wrap back into the grid is a possible follow-up.

🤖 Generated with Claude Code

SCC (CEA-608) writes silently re-wrap or truncate any line over 32
columns or subtitle over 4 rows, so merged lines came back split after a
reopen with no hint why. Add a SubtitleFormat.FormatLimits hook (SCC
declares 32x4), check it before Save/Save As, and show a dialog listing
the affected lines with "Save anyway"/"Cancel" and a "Do not show this
warning again" checkbox (backed by General.ShowFormatLimitWarning, also
exposed in Options > Settings). Auto-save never prompts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@niksedk
niksedk merged commit 0cb66cf into main Aug 23, 2026
1 check passed
@niksedk
niksedk deleted the claude/scc-format-limit-warning branch August 23, 2026 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant