Warn before saving SCC when lines exceed 32 chars / 4 lines - #14014
Merged
Conversation
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>
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
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
SubtitleFormat.FormatLimits(SubtitleFormatLimitswithMaxCharactersPerLine/MaxLines+GetViolatingParagraphNumbers).ScenaristClosedCaptionsdeclares 32 × 4; other constrained formats can opt in with one override.SaveSubtitlechecks the limits beforeToText()(covers Save and Save As; auto-save never prompts). NewFormatLimitWarningWindowlists 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.General.ShowFormatLimitWarning(default on) backs the checkbox and is exposed in Options → Settings so it can be turned back on.Tests
null.dotnet build src/ui/UI.csprojclean.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