Skip to content

Fix Beautify Time Codes preview after inserting new subtitle lines#12280

Merged
niksedk merged 1 commit into
SubtitleEdit:mainfrom
pdjdev:fix/beautify-time-codes-inserted-line-preview
Jul 8, 2026
Merged

Fix Beautify Time Codes preview after inserting new subtitle lines#12280
niksedk merged 1 commit into
SubtitleEdit:mainfrom
pdjdev:fix/beautify-time-codes-inserted-line-preview

Conversation

@pdjdev

@pdjdev pdjdev commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Problem

After opening a subtitle and inserting a new subtitle line, Beautify Time Codes could open with an empty beautified preview and 0 detected changes.

Cause & Fix

Beautify Time Codes built its working Subtitle from each row's backing Paragraph via Paragraph!.

That works for rows loaded from a subtitle file, but newly inserted rows may only have the current SubtitleLineViewModel values populated. In that case, relying on Paragraph! can prevent the beautifier preview from being built correctly.

The fix builds the working Subtitle with ToParagraph() instead. This is the appropriate conversion path because it creates a Paragraph from the row's current start time, end time, text, and related subtitle fields.

The shared helper is used by both preview generation and final apply so both paths use the same input source.

Screenshots

Before After
Beautify Time Codes shows no preview changes after inserting a new subtitle line Beautify Time Codes previews changes normally after inserting a new subtitle line
2026-07-09-before.mp4
2026-07-09-after.mp4

Testing

Tested on Windows 11 x64 (local Release build).

Verified both full-subtitle beautify and selected-lines beautify.

@niksedk niksedk merged commit 43af4e8 into SubtitleEdit:main Jul 8, 2026
2 checks passed
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.

2 participants