Skip to content

TypewriterEffect: support Subtitle Edit Batch convert - #328

Merged
niksedk merged 1 commit into
mainfrom
claude/typewriter-effect-batch
Oct 14, 2026
Merged

niksedk merged 1 commit into
mainfrom
claude/typewriter-effect-batch

Conversation

@niksedk

@niksedk niksedk commented Oct 14, 2026

Copy link
Copy Markdown
Member

Adds Subtitle Edit Batch convert support (contract from SubtitleEdit/subtitleedit#16036) to Typewriter effect.

What it does

  • plugin.json gets "batch": true.
  • batch: answered in Program.Main before Avalonia starts, so there is no UI. Every line is split using the saved endDelay (0.5 s when nothing is saved), the same engine and rules as the window, so lines of 500 ms or less are kept as they are. If no line changes, the response is ok with no subtitle. Settings are not returned (null). Errors come back as error + message.
  • configure: opens the same window without a subtitle. The line-count info text is hidden and a short "Batch convert settings" panel is shown above the end-delay input. OK returns ok with { "endDelay": ... } and no subtitle. Cancel returns cancelled.

Decisions

  • This plugin has its own entry point and contract (no Plugin-Shared/PluginBootstrap), so the request types are handled inside the plugin and Plugin-Shared is not touched.
  • Response building moved out of MainWindow into TypewriterResponses so batch, configure and run can be unit tested. The run output is unchanged.
  • The settings stay unversioned (no settingsVersion), as they were before, so run and configure save the same shape.
  • The window has no per-item choices, so batch only needs the single saved end delay.

Tests

  • New se5/TypewriterEffect.Tests project (modelled on FixEncodingErrors.Tests) with BatchModeTests (5 tests: batch with the default and with a saved end delay, batch with nothing to change, run still honours the selection, configure). typewriter.yml now runs it in a test job that build depends on, and its path filters include the tests folder.
  • Ran end-to-end: a headless batch request.json through the built dll exits 0 and writes a sensible response.

Compatibility

Subtitle Edit 5.3 ignores "batch" and only sends run, which works exactly as before.

🤖 Generated with Claude Code

- plugin.json "batch": true
- batch request: apply the effect to every line with the saved end
  delay, answered before Avalonia starts (no UI)
- configure request: end delay only, settings returned without subtitle
- run unchanged; response building moved to TypewriterResponses
- new TypewriterEffect.Tests project, run by typewriter.yml

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@niksedk
niksedk merged commit 329ef87 into main Oct 14, 2026
10 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.

1 participant