fix(web): show device diagnostics before hub readiness (#15435)

This commit is contained in:
maria authored and GitHub committed 2026-10-04 08:20:34 -03:00
1 parent 5a96895a85
commit 5318d054a5
2 files changed
+14 -3

No files matched your search

@@ -63,6 +63,9 @@ export function DeviceSetup(props: {
const [step, setStep] = useState(0);
const enabled = props.state.hostStatus !== "disabled";
const busy = props.state.hostStatus === "installing" || props.state.hostStatus === "starting";
const localPlatformsUnavailable = props.state.hosts.some(
(host) => host.kind === "local" && !host.platforms.some((platform) => platform.available),
);
const update = async (
kind: NonNullable<typeof pending>,
@@ -117,8 +120,8 @@ export function DeviceSetup(props: {
</section>
) : null}
{step === 1 ? (
<section className="space-y-3 text-sm">
{step === 1 || (step === 0 && enabled && localPlatformsUnavailable) ? (
<section className={cn("space-y-3 text-sm", step === 0 && "mt-4")}>
<h3 className="font-medium">Check simulator support</h3>
<DevicePlatformSetup
state={props.state}
@@ -646,10 +646,18 @@ function DeviceIntegrationControls({
"hub" | "check" | "agent" | "update-hub" | "update-agent" | null
>(null);
const busy = state.hostStatus === "installing" || state.hostStatus === "starting";
const localPlatformsUnavailable = state.hosts.some(
(host) => host.kind === "local" && !host.platforms.some((platform) => platform.available),
);
const [platformsRevealed, setPlatformsRevealed] = useState(false);
// Keep diagnostics visible through subsequent agent setup and refresh phases.
if (platformsRevealed && !enabled) setPlatformsRevealed(false);
if (enabled && !platformsRevealed && state.hostStatus === "ready" && pending !== "hub") {
if (
enabled &&
!platformsRevealed &&
(state.hostStatus === "ready" || localPlatformsUnavailable) &&
pending !== "hub"
) {
setPlatformsRevealed(true);
}