Files
fusion/packages/dashboard/app/components/setupWizardNodes.ts
gsxdsm 2cfeb74407 fix(dashboard): polish first-run setup wizard (AI step, GitHub step, project step)
- AI Setup: connected providers now render first; 'Skip for now' hides
  once a provider is connected; footer buttons share one size.
- GitHub step: state-driven (no install/pitch content when connected),
  one type scale, real <code> literals, per-OS gh instructions behind a
  disclosure, single skip affordance; gh/OAuth status revalidates on
  window focus and OAuth relogin so later steps stop showing stale
  'not connected'.
- Project step: onboarding-driven opens keep 'Step 3 of 5' context;
  runtime-node picker no longer lists 'Local node' and 'local (local)'
  duplicates and hides itself when only the local node exists;
  isolation-mode cards no longer render a stretched native radio or
  uppercased descriptions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 17:20:17 -07:00

25 lines
1.3 KiB
TypeScript

import type { NodeInfo } from "../api";
/*
FNXC:SetupWizard 2026-07-10-11:00:
First-run review (project registration, Advanced settings): the Runtime Node dropdown showed two
near-identical options — the built-in "Local node" default option (empty value = run on this machine)
PLUS a registered local node record rendered as "local (local)". A single-local-node install must show
exactly one local choice, so:
- registered nodes of type "local" are filtered out of the option list (the built-in default option
already represents them; registering with an empty nodeId runs locally), and
- the selector is hidden entirely when there is no non-local node to pick — a choice with one option
is noise during first-run setup.
Kept as a pure module so the dedupe rule is unit-testable without rendering the wizard.
*/
/** Nodes that are meaningful to offer in the Runtime Node dropdown (everything except local-type records). */
export function getSelectableRuntimeNodes(nodes: NodeInfo[]): NodeInfo[] {
return nodes.filter((node) => node.type !== "local");
}
/** The Runtime Node selector is only shown when there is at least one non-local node to choose. */
export function shouldShowRuntimeNodeSelector(nodes: NodeInfo[]): boolean {
return getSelectableRuntimeNodes(nodes).length > 0;
}