Skip to content

[SPoT/Clean Code] Make transform definitions own tuning normalization and editor reset #114

Description

@KeyffMS

Audit finding

VisualProfileCatalog exposes transform-specific tuning normalization through VisualProfileDefinition, but the profile update and editor reset paths still hard-code Soft Invert behavior:

  • VisualProfileManagementService.UpdateTuning calls VisualProfileDefaults.NormalizeSoftInvertTuning(values) directly;
  • VisualProfileEditorForm labels the action Reset soft profile;
  • VisualProfileEditorForm.ResetValues applies VisualProfileDefaults.SoftInvertTuning directly.

This works only because Soft Invert is currently the sole editable transform. Adding another transform with SupportsTuning = true would silently normalize and reset it using Soft Invert rules.

Target state

Make the registered transform/profile definition the single source of truth for:

  • tuning normalization;
  • canonical/default tuning used by reset;
  • supported editor adjustments, if transform-specific adjustment sets are introduced;
  • transform-specific editor wording.

Keep the current catalog-based design. Do not add a second registry or a generic plugin framework.

Acceptance criteria

  • VisualProfileManagementService.UpdateTuning normalizes values through the definition selected by profile.TransformId.
  • The editor reset action obtains canonical tuning from the selected definition rather than directly from VisualProfileDefaults.SoftInvertTuning.
  • Editor labels do not hard-code Soft Invert when editing a generally tunable profile.
  • Existing Soft Invert behavior and persisted values remain unchanged.
  • A test-only second editable transform proves that update and reset use its own normalization/defaults.
  • Architecture documentation identifies the catalog definition as the tuning authority.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions