Skip to content

Continuation style: fix custom style not reaching engine, store per profile#11510

Merged
niksedk merged 1 commit into
mainfrom
per-profile-custom-continuation-style
Jun 9, 2026
Merged

Continuation style: fix custom style not reaching engine, store per profile#11510
niksedk merged 1 commit into
mainfrom
per-profile-custom-continuation-style

Conversation

@niksedk

@niksedk niksedk commented Jun 9, 2026

Copy link
Copy Markdown
Member

Summary

Fixes the custom continuation style not reaching the fix/merge engine, and makes the custom continuation style per rule profile instead of a single global setting.

The core bug

The libse fix/merge engine reads the custom continuation style from Configuration.Settings.General (14 fields + ContinuationPause). The SE5 settings bridge only copied the ContinuationStyle enum there and never the custom fields — so selecting the Custom style silently fell back to libse defaults in Fix Common Errors and Merge. Presets were unaffected (only the enum matters for them).

Per-profile storage + refactor (#2/#3)

  • New CustomContinuationStyle value object (src/libse/Common/CustomContinuationStyle.cs) collapses the 14 flat fields into one object, used by RulesProfile, ProfileDisplay, and SeGeneral.
  • The flat-field mapping the engine reads is centralized on the value object (ApplyToGeneralSettings / FromGeneralSettings).
  • The active profile is mirrored onto SeGeneral and bridged to libse via a single Se.ApplyContinuationStyleToLibSe(), called from both bridge sites (MainViewModel.SetLibSeSettings and FixCommonErrorsViewModel.InitStep1).
  • Adding a future field now touches the value object + libse GeneralSettings/engine + the one mapping, instead of ~12 hand-copied sites. Net −119 lines in SettingsViewModel.

Additional fixes

  • "Edit custom style" button not appearing when the settings page was reopened with a Custom-style profile.
  • Continuation settings not reset by Reset Rules.
  • ColorDurationTooLong not reset by Reset Syntax Coloring (self-assignment no-op).

Notes

  • No migration is performed for the old global custom style (this is pre-release; an upgrading tester's global custom values reset to defaults). Deliberate, per discussion.
  • The legacy RulesProfile.Serialize/Deserialize (used by old SE, not SE5) does not carry the per-profile custom style — SE5 persists it via System.Text.Json.
  • Null-safety hardened on the engine path (null-tolerant copy-ctor, bridge coalesce, Se.SetDefaultValues guards mirror + profiles).

Tests

  • libse: CustomContinuationStyle (defaults match legacy, deep copy, null-tolerant copy, ApplyTo/From round-trip), RulesProfile (copy/serialize).
  • UI: Se.ApplyContinuationStyleToLibSe() bridges into libse Configuration; per-profile custom style survives a real SaveSettingsLoadSettings round-trip.
  • Full suites pass: libse 383, UI 333. Solution builds clean.

🤖 Generated with Claude Code

…rofile

The libse fix/merge engine reads the custom continuation style from
Configuration.Settings.General, but the SE5 settings bridge only copied the
ContinuationStyle enum there - never the 14 custom-style fields or the pause.
As a result the "Custom" continuation style silently fell back to libse
defaults in Fix Common Errors and Merge.

Custom continuation style is now stored per rule profile (previously it was a
single global setting). The 14 flat fields are collapsed into one
CustomContinuationStyle value object, used by RulesProfile, ProfileDisplay and
SeGeneral, with the libse-flat mapping centralized on the value object
(ApplyToGeneralSettings/FromGeneralSettings). The active profile is mirrored
onto SeGeneral and bridged to libse via Se.ApplyContinuationStyleToLibSe(),
called from both bridge sites (MainViewModel.SetLibSeSettings and
FixCommonErrorsViewModel.InitStep1).

Also fixes:
- "Edit custom style" button not appearing when reopening the settings page
- continuation settings not reset by Reset Rules
- ColorDurationTooLong not reset by Reset Syntax Coloring (self-assignment)

No migration is performed for the old global custom style (pre-release).

Tests: libse CustomContinuationStyle/RulesProfile (copy/round-trip/null) and
UI bridge + save/load persistence.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@niksedk niksedk merged commit c95548b into main Jun 9, 2026
1 of 3 checks passed
@niksedk niksedk deleted the per-profile-custom-continuation-style branch June 9, 2026 12:15
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