Skip to content

Avoid redundant configuration refresh after closing the profile manager #38

Description

@KeyffMS

Priority

P3

Context

Found during a static DRY/KISS/SPoA/SPoT/Clean Code regression audit of main at commit 874b1d74381af65d3d95b955a5bea6c7680876a9 (0.5.0.30).

This is distinct from issue #23, which addressed duplicate refreshes inside VisualProfileManagerForm during its own local commits.

Problem

ConfigurationForm subscribes to SettingsCoordinator.Changed and calls RefreshProfiles for external settings changes. Changes made in the modal VisualProfileManagerForm are therefore synchronously reflected in the configuration form.

ConfigurationForm.ManageVisualProfiles nevertheless calls RefreshProfiles unconditionally after VisualProfileManagerForm.ShowManager returns.

As a result:

  • if profiles were changed, the configuration form refreshes through Changed and then refreshes again when the dialog closes;
  • if no profiles were changed, closing the dialog still performs a full grid bind.

Impact

  • unnecessary rebuilding of the application grid and selector options;
  • avoidable selection-change events and UI work;
  • possible visible selection movement or flicker;
  • two mechanisms decide when the same view must refresh.

Proposed direction

Remove the unconditional post-dialog RefreshProfiles call from ManageVisualProfiles. Keep SettingsCoordinator.Changed as the single source of the refresh decision.

If a non-settings UI state truly requires refresh after dialog closure, update only that state explicitly rather than rebinding all profiles.

Acceptance criteria

  • closing the profile manager without changes does not rebuild the configuration grid;
  • each successful manager mutation refreshes the configuration form exactly once;
  • the selected application remains stable where possible;
  • external settings changes still refresh the configuration form;
  • a regression test covers both changed and unchanged dialog sessions.

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