Skip to content

PersianErrors: support Subtitle Edit Batch convert - #331

Merged
niksedk merged 1 commit into
mainfrom
claude/persian-errors-batch
Oct 14, 2026
Merged

niksedk merged 1 commit into
mainfrom
claude/persian-errors-batch

Conversation

@niksedk

@niksedk niksedk commented Oct 14, 2026

Copy link
Copy Markdown
Member

Adds Batch convert support (SubtitleEdit/subtitleedit#16036 contract) to Persian Subtitle Fixes.

Batch (requestType: "batch")

  • No UI. Runs the enabled groups from the saved settings (disabledGroups) over all lines and keeps every fix.
  • Returns ok with the subtitle when lines changed, ok without a subtitle when nothing needs fixing. Settings are null in the response.

Configure (requestType: "configure")

  • Opens the window without a subtitle: the fix-group sidebar (with descriptions/examples, All/None) stays; the Check scope, Display section, header fix chips, Undo / Apply and re-check and the fix list are hidden. A short "Batch convert settings" panel explains what happens. OK is enabled and returns ok with settings + settingsVersion and no subtitle; Cancel returns cancelled.

Decisions

  • One pass, every fix: the window preselects every fix, so batch applies exactly what OK would by default. It does not repeat like Apply and re-check.
  • Scope ignored in batch: selectedLinesOnly does not apply (batch has no selection), so all lines are fixed.
  • Configure keeps the remembered scope: configure has no selection, so it saves the previously stored selectedLinesOnly (and showHidden) unchanged instead of resetting them to false.
  • The async analysis does not run for batch/configure requests; batch calls PersianFixer.FindFixes synchronously.

Compatibility

Subtitle Edit 5.3 ignores "batch" and only sends "run"; the run path is unchanged.

Tests

  • New BatchModeTests (5): fixes all lines, nothing-to-fix is ok without subtitle, disabled groups skipped, scope ignored, configure returns settings only and keeps remembered options. dotnet test se5/PersianErrors.Tests: 37 passed.
  • Headless end-to-end: a batch request.json run against the built dll exits 0 and returns the fixed lines.
  • Configure window not checked visually.

🤖 Generated with Claude Code

- plugin.json "batch": true
- batch request: run the saved enabled groups over every line and keep
  every fix (OK with the default selection, one pass), no UI
- configure request: settings-only window (group sidebar), settings
  returned without subtitle; remembered scope/display options are kept

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@niksedk
niksedk merged commit 7cf10b2 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