fix: finish progressive Target detection

This commit is contained in:
proxyctl coordinator
2026-07-17 21:25:43 +08:00
parent ad651402fd
commit 8348fa3ac8
17 changed files with 672 additions and 221 deletions
+6 -2
View File
@@ -20,10 +20,14 @@ type targetCatalog struct {
items []app.TargetSnapshot
}
func newTargetCatalog(snapshot app.Snapshot, includeUnavailable bool) targetCatalog {
func newTargetCatalog(snapshot app.Snapshot, includeUnavailable bool, selectedID string) targetCatalog {
items := make([]app.TargetSnapshot, 0, len(snapshot.Targets))
for _, item := range snapshot.Targets {
if item.Available || includeUnavailable || item.DetectionPhase != app.TargetReady {
// Available Targets are the routine default. If progressive detection
// proves the selected identity unavailable, keep that one row visible
// until the user selects another Target rather than silently moving the
// selection to a different product.
if item.Available || includeUnavailable || item.ID == selectedID || item.DetectionPhase != app.TargetReady {
items = append(items, item)
}
}