Skip to content

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

Closed

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.

Completion evidence — 2026-09-24

Implemented in PR #159 and merged as f7ea72f362fc865453cdc15d5dfb939df10cd4f9.

Verified checks:

  • DCO run 36001402296 — success;
  • full Windows build/test/release-compliance run 36001402188 — success.

The registered VisualProfileDefinition now owns canonical/reset tuning and normalization. VisualProfileManagementService.UpdateTuning resolves the target transform definition, the editor reset uses the same definition without Soft Invert wording or constants, and a test-only second editable transform verifies transform-specific normalization and reset behavior.

Activity

  1. added 11 commits that reference this issue on Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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