Skip to content

[Clean Code/KISS] Split runtime target resolution from user feedback ports #117

Description

@KeyffMS

Audit finding

IRuntimeEnvironment currently combines two unrelated roles:

  • target/window environment queries (ResolveTargetWindow, IsSupportedTarget, ResolveIdentity);
  • presentation feedback (ShowNotification, SynchronizeAutomaticMode).

The public RuntimeCoordinator constructor consequently accepts five raw delegates and adapts them into one mixed interface. This obscures dependency intent and couples runtime evaluation tests to notification/control synchronization concerns.

Target state

Introduce two small named ports, for example:

  • IRuntimeTargetResolver for window support and application identity;
  • IRuntimeFeedback for notifications and automatic-mode presentation synchronization.

Compose concrete adapters in SightAdaptContext. Keep the runtime services framework-free.

Acceptance criteria

  • Target resolution and user feedback are represented by separate interfaces.
  • RuntimeCoordinator, AutomaticActivationService and RuntimeOverlayActivator depend only on the portions they use.
  • The five-delegate constructor is removed or replaced with named collaborators.
  • SightAdaptContext remains the composition root.
  • Runtime tests can substitute target resolution without also configuring UI feedback, and vice versa.
  • Existing notification messages and automatic-mode synchronization behavior remain unchanged.
  • No DI container or service locator is introduced.

Activity

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