archy/neode-ui/src/views/goals/goalStepActions.ts
archipelago 73d181abea
Some checks failed
Demo images / Build & push demo images (push) Failing after 1m56s
fix(setup): wizard navigation round-trips — back to Setup tab, goal-aware channels back button, configure launches the app
- "Back to Goals" now returns to Home's Setup tab (?tab=setup) instead of
  landing on the dashboard tab.
- The channels screen remembers when a setup wizard sent you there
  (?from=goal) — its back button reads "Back to Setup" and returns to the
  wizard; it also now uses the shared BackButton pill instead of a bare
  link.
- "Open & Configure" steps launch the actual app via the app launcher —
  iframe apps overlay on top of the wizard, tab-only apps (BTCPay,
  Nextcloud) open a tab, mobile uses the in-app browser — instead of
  routing to the app-details page.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 22:16:58 -04:00

25 lines
1015 B
TypeScript

import type { GoalStep } from '@/types/goals'
// Steps that land on an internal screen rather than launching an app UI.
const STEP_ROUTE_OVERRIDES: Record<string, string> = {
'setup-nostr': '/dashboard/web5',
'export-identity': '/dashboard/web5/credentials',
'create-passphrase': '/dashboard/settings',
'create-backup': '/dashboard/settings',
'save-backup': '/dashboard/settings',
// Channel steps land directly on the Lightning channels screen (which
// carries the "open a channel with Zeus" suggestion).
'open-channel': '/dashboard/apps/lnd/channels',
'open-channels': '/dashboard/apps/lnd/channels',
'open-zeus-channel': '/dashboard/apps/lnd/channels',
}
/**
* Internal route a step navigates to, or null when the step should launch its
* app instead (via the app launcher — iframe apps overlay on top, tab-only
* apps open a tab / the mobile in-app browser).
*/
export function goalStepRouteOverride(step: GoalStep): string | null {
return STEP_ROUTE_OVERRIDES[step.id] ?? null
}