Files
proxy/.scratch/tui-redesign/issues/05-contextual-target-actions.md
T

2.1 KiB

05 — Add contextual Target actions and Drift Resolution

What to build: Replace the ambiguous Target toggle with actions that reflect the selected Target's real state, including explicit Drift Resolution choices.

Blocked by: 04 — Unify operation coordination and status feedback.

Status: done

  • A Disabled Target offers Enable.
  • An Enabled Target offers Disable.
  • An External Target offers Apply Profile and explains that proxyctl will begin managing the configuration while preserving restorable state.
  • A Drifted Target offers Resolve rather than silently choosing a direction.
  • Drift Resolution offers Reapply Active Profile and Restore Original as separate intents.
  • Reapply uses the Active Profile and returns truthful Enabled, Drifted, or failure state.
  • Restore Original reuses existing ownership safeguards and refuses safely when restoration evidence is insufficient.
  • No Adapter ownership, restoration, or cross-Target rollback semantics are weakened.
  • Docker restart confirmation remains required for relevant actions and cancellation is the default focused choice.
  • Routine reversible actions do not gain new confirmation dialogs.
  • Action availability and disabled reasons are structured in the Application snapshot rather than inferred from rendered labels.
  • Application and complete-Model tests cover all Target states, both Drift Resolution branches, missing Active Profile, ownership loss, confirmation, and cancellation without mutation.

Answer

The Application snapshot now exposes contextual Target actions and Drift Resolution choices as structured availability plus disabled reasons. Dispatch revalidates every Target intent against that current structure immediately before confirmation or SetDesired, so stale, checking, failed, unavailable, profile-dependent, and ownership-sensitive intents fail without unsafe mutation. Reapply and Restore retain Adapter SetDesired semantics and existing restoration safeguards, while the complete Model preserves explicit resolution and safe-default confirmation/cancellation behavior.