Skip to content

Add FixType property to IFixCommonError - #14442

Closed
ivandrofly wants to merge 1 commit into
SubtitleEdit:mainfrom
ivandrofly:feature/fix-common-errors-fixtype
Closed

ivandrofly wants to merge 1 commit into
SubtitleEdit:mainfrom
ivandrofly:feature/fix-common-errors-fixtype

Conversation

@ivandrofly

Copy link
Copy Markdown
Member

Summary

  • Add a FixType enum (Time, Formatting, Dialog, Punctuation, Casing, Spacing, Characters, Ocr) in src/libse/Enums.
  • Add FixType FixType { get; } to IFixCommonError, so the compiler enforces it on every implementation.
  • Every fix rule (39 in libse plus FixCommonOcrErrors in the UI) declares the kind of fix it performs, so the UI and CLI can group, filter or sort rules by category.

No behaviour change on its own; the first consumer is the "Type" filter in the Fix common errors window, stacked on this PR.

Test plan

  • dotnet build SubtitleEdit.sln compiles (every IFixCommonError implementation has the new member)
  • Spot-check a few classes: FixCommas is Punctuation, FixShortGaps is Time, FixUnneededSpaces is Spacing, FixCommonOcrErrors is Ocr
  • dotnet test tests/libse/LibSETests.csproj passes

🤖 Generated with Claude Code

https://claude.ai/code/session_01SXEWrgv5uAnSzDgxFupSHZ

Every fix rule now declares the kind of fix it performs via a new
FixType enum (Time, Formatting, Dialog, Punctuation, Casing, Spacing,
Characters, Ocr), so the UI/CLI can group, filter or sort rules by
category later. The member is abstract on the interface so the
compiler enforces it on all 40 implementations.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TTVPifejhQqpeh1mkQHeRg
@niksedk

niksedk commented Sep 14, 2026

Copy link
Copy Markdown
Member

Hi @ivandrofly, thanks for this! The categorisation itself is sensible, but I'm going to close it together with #14443: I'd like to keep the Fix common errors window as it is for now, so I don't want to add the FixType member to the interface and all 40 rule classes without a consumer for it. If a category filter ends up on the roadmap, the mapping you did here (rule -> type) is easy to pick up again.

Thanks again!

@niksedk niksedk closed this Sep 14, 2026
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