diff --git a/apps/control-station/test/k1SupervisorPresentation.test.mjs b/apps/control-station/test/k1SupervisorPresentation.test.mjs index bd6cec9..4c17290 100644 --- a/apps/control-station/test/k1SupervisorPresentation.test.mjs +++ b/apps/control-station/test/k1SupervisorPresentation.test.mjs @@ -6788,6 +6788,38 @@ test("read-only reconnect keeps its card and loader across a transient projectio )), ]); + const runningVerificationState = structuredClone(initialState); + runningVerificationState.connection_attempt = { + schema_version: "missioncore.xgrids-k1-connection-attempt/v1", + attempt_id: "verify-saved-k1-running", + connection_mode: "bridge", + status: "running", + phase: "network_applied", + control_state: "unknown", + stage: "host-route-and-control-endpoint", + public_error_code: null, + side_effect_status: "network-applied", + safe_next_action: "wait-for-current-attempt", + automatic_retry: false, + accepted_at: OBSERVED_AT, + completed_at: null, + timeline: [], + }; + currentState = runningVerificationState; + tree = harness.render(props()); + const runningMarkup = renderToStaticMarkup(tree); + const runningReconnect = buttonMarkupWithText( + runningMarkup, + "Переподключение…", + ); + assert.equal(runningReconnect.length, 1); + assert.match(runningReconnect[0], /disabled/); + assert.match(runningReconnect[0], /aria-busy="true"/); + assert.match(runningReconnect[0], /nodedc-activity-indicator/); + assert.match(runningMarkup, /Сохранённое подключение/); + assert.doesNotMatch(runningMarkup, /Команда настройки завершена/); + assert.doesNotMatch(runningMarkup, /Подтверждение управления/); + const transientState = structuredClone(initialState); transientState.connection_policy.allowed_actions = transientState.connection_policy.allowed_actions.filter( @@ -7461,7 +7493,11 @@ test("applied-network recovery spends the old intent and admits only explicit se assert.match(source, /BLE-команда не повторяется/); assert.match( source, - /status=\{\s*searchActive[\s\S]*?: presentedPhysicalRecoveryRequired[\s\S]*?: networkRecoveryRequired[\s\S]*?>\s*\{searchActive \? \([\s\S]*?Поиск Bluetooth · \{scanSecondsRemaining \?\? 6\} с[\s\S]*?: networkRecoveryRequired && !connectionAttemptSettling \? \(/, + /status=\{\s*searchActive[\s\S]*?: presentedPhysicalRecoveryRequired[\s\S]*?: presentedConnectionRecoveryRequired[\s\S]*?: networkRecoveryRequired/, + ); + assert.match( + source, + /networkRecoveryRequired\s*&& !connectionAttemptSettling\s*&& !connectionRecoveryVerificationPending \? \(/, ); assert.match( diff --git a/plugins/xgrids-k1/frontend/src/components/K1ProvisioningPipeline.tsx b/plugins/xgrids-k1/frontend/src/components/K1ProvisioningPipeline.tsx index 15033bc..0282d91 100644 --- a/plugins/xgrids-k1/frontend/src/components/K1ProvisioningPipeline.tsx +++ b/plugins/xgrids-k1/frontend/src/components/K1ProvisioningPipeline.tsx @@ -3265,16 +3265,16 @@ export function K1ProvisioningPipeline({ : savedBridgeNetworkSetupRequired ? "Нужна настройка сети" : "Нужно выбрать действие" - : networkRecoveryRequired - ? appliedControlSettlementPending - ? "Подтверждение управления" - : "Управление не подтверждено · выбор заблокирован" : presentedConnectionRecoveryRequired ? connectionReconnectPending ? "Переподключение…" : connectionRecoveryTarget ? "Можно переподключиться" : "Подключить заново" + : networkRecoveryRequired + ? appliedControlSettlementPending + ? "Подтверждение управления" + : "Управление не подтверждено · выбор заблокирован" : connectionEstablished ? "Подключение установлено" : explicitProvisioningDraftStale @@ -3319,7 +3319,9 @@ export function K1ProvisioningPipeline({ Поиск Bluetooth · {scanSecondsRemaining ?? 6} с - ) : networkRecoveryRequired && !connectionAttemptSettling ? ( + ) : networkRecoveryRequired + && !connectionAttemptSettling + && !connectionRecoveryVerificationPending ? (