Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Remove blanket Community-visible upgrade marketing surfaces

rcourtman85191a9051c4
diff --git a/docs/release-control/v6/internal/HIGH_RISK_RELEASE_VERIFICATION_MATRIX.md b/docs/release-control/v6/internal/HIGH_RISK_RELEASE_VERIFICATION_MATRIX.md
index 66abe257d7..4d75b3c4b8 100644
--- a/docs/release-control/v6/internal/HIGH_RISK_RELEASE_VERIFICATION_MATRIX.md
+++ b/docs/release-control/v6/internal/HIGH_RISK_RELEASE_VERIFICATION_MATRIX.md
@@ -362,13 +362,11 @@ Companion drill:
`internal/api/onboarding_handlers.go`
`pulse-pro/relay-server/...`
`frontend-modern/src/components/Settings/RelaySettingsPanel.tsx`
- `frontend-modern/src/components/Dashboard/RelayOnboardingCard.tsx`
`pulse-mobile/src/relay/...`
- Automated proof:
`go test ./internal/relay -run 'TestClient_E2E_MultiMobileClientRelay|TestClient_AbruptDisconnectCancelsInFlightHandlers|TestClient_AbruptDisconnectMultipleChannelCleanup|TestClient_DrainDuringInFlightData|TestClient_DrainWithMultipleInFlightChannels|TestClientRegister_SessionResumeRejectionClearsCachedSession|TestRunLoop_SessionResumeRejectionFallsBackToFreshRegister' -count=1`
`go test ./internal/api -run 'TestRelayEndpointsRequireLicenseFeature|TestRelayOnboardingEndpointsRequireLicenseFeature|TestRelayLicenseGatingResponseFormat|TestOnboardingQRPayloadStructure|TestOnboardingValidateSuccessAndFailure|TestOnboardingDeepLinkFormat' -count=1`
- `cd frontend-modern && npx vitest run src/components/Dashboard/__tests__/RelayOnboardingCard.test.tsx src/components/Settings/__tests__/RelaySettingsPanel.runtime.test.tsx src/components/Settings/__tests__/settingsReadOnlyPanels.test.tsx`
- `cd tests/integration && PULSE_E2E_SKIP_DOCKER=1 PULSE_BASE_URL=http://127.0.0.1:7655 PLAYWRIGHT_BASE_URL=http://127.0.0.1:4174 npm test -- tests/59-dashboard-relay-onboarding-trial-rate-limit.spec.ts --project=chromium`
+ `cd frontend-modern && npx vitest run src/components/Settings/__tests__/RelaySettingsPanel.runtime.test.tsx src/components/Settings/__tests__/settingsReadOnlyPanels.test.tsx`
`cd /Volumes/Development/pulse/repos/pulse-mobile && npm test -- --runTestsByPath src/relay/__tests__/client.test.ts src/relay/__tests__/client-hardening.test.ts src/relay/__tests__/protocol-contract.test.ts`
- Manual scenario:
1. Register a fresh relay client.
diff --git a/docs/release-control/v6/internal/records/rc-to-ga-promotion-readiness-blocked-2026-04-04.md b/docs/release-control/v6/internal/records/rc-to-ga-promotion-readiness-blocked-2026-04-04.md
index b92895643b..c3bb8f151c 100644
--- a/docs/release-control/v6/internal/records/rc-to-ga-promotion-readiness-blocked-2026-04-04.md
+++ b/docs/release-control/v6/internal/records/rc-to-ga-promotion-readiness-blocked-2026-04-04.md
@@ -6,28 +6,31 @@
## Blocking Facts
-1. The latest shipped Pulse v6 prerelease tag is `v6.0.0-rc.1`.
-2. That shipped prerelease tag resolves to commit `7812e00f943e48db1781b463cf6d21164e38480e`.
-3. The governed release profile in `docs/release-control/control_plane.json`
+1. The latest shipped Pulse v6 prerelease tag is `v6.0.0-rc.2`.
+2. That shipped prerelease tag resolves to commit `7b0bdebdff8127228708e84eb836cfd3d7214c08`.
+3. The selected remote ref `origin/pulse/v6-release` is still behind the current
+ local governed branch state, so `Release Dry Run` would exercise stale remote
+ control-plane metadata instead of the intended candidate.
+4. The governed release profile in `docs/release-control/control_plane.json`
currently declares both `prerelease_branch` and `stable_branch` as
`pulse/v6-release`.
-4. The active control-plane target is still `v6-rc-stabilization`, not
+5. The active control-plane target is still `v6-rc-stabilization`, not
`v6-ga-promotion`.
-5. The active local `pulse/v6-release` branch currently reports `VERSION=6.0.0-rc.2`, so the
+6. The active local `pulse/v6-release` branch currently reports `VERSION=6.0.0-rc.2`, so the
working line is still prerelease and there is not yet a governed local stable
`6.0.0` candidate.
-6. There is still no governed `Prerelease-to-GA Rehearsal Record` proving a successful
+7. There is still no governed `Prerelease-to-GA Rehearsal Record` proving a successful
non-publish `Release Dry Run` for the eventual stable `6.0.0` candidate.
-7. `docs/releases/RELEASE_NOTES_v6.md` and
+8. `docs/releases/RELEASE_NOTES_v6.md` and
`docs/release-control/v6/internal/V5_MAINTENANCE_SUPPORT_POLICY.md` still leave the
GA announcement dates as placeholders because no real prerelease lineage or GA-ready
rehearsal has locked them yet:
- `v6` GA date placeholder: `[v6-ga-date]`
- `v5` end-of-support placeholder: `[v5-eos-date]`
-8. There is still no governed `Release Dry Run` artifact or rehearsal record
+9. There is still no governed `Release Dry Run` artifact or rehearsal record
exercising stable inputs for:
- `version=6.0.0`
- - `promoted_from_tag=v6.0.0-rc.1`
+ - `promoted_from_tag=v6.0.0-rc.2`
- the artifact-owned candidate stable tag for that rehearsal
- the artifact-owned promotion channel for that rehearsal
- the artifact-owned promoted prerelease tag for that rehearsal
@@ -55,7 +58,7 @@ users would still be the first real cohort for the final promotion path.
change and release-control records, to `origin/pulse/v6-release`.
3. Run `Release Dry Run` from `pulse/v6-release` with:
- `version=6.0.0`
- - `promoted_from_tag=v6.0.0-rc.1`
+ - `promoted_from_tag=v6.0.0-rc.2`
- an artifact-owned candidate stable tag matching that rehearsal
- an artifact-owned promotion channel matching that rehearsal
- an artifact-owned promoted prerelease tag matching that rehearsal
diff --git a/docs/release-control/v6/internal/status.json b/docs/release-control/v6/internal/status.json
index bb124b1d92..1af7ca020c 100644
--- a/docs/release-control/v6/internal/status.json
+++ b/docs/release-control/v6/internal/status.json
@@ -334,7 +334,6 @@
"test",
"--",
"--run",
- "src/components/Dashboard/__tests__/RelayOnboardingCard.test.tsx",
"src/components/Settings/__tests__/RBACPaywallPanels.test.tsx",
"src/components/Settings/__tests__/settingsNavigation.integration.test.tsx",
"src/pages/__tests__/AIIntelligence.test.tsx"
@@ -342,11 +341,6 @@
}
],
"evidence": [
- {
- "repo": "pulse",
- "path": "frontend-modern/src/components/Dashboard/__tests__/RelayOnboardingCard.test.tsx",
- "kind": "file"
- },
{
"repo": "pulse",
"path": "frontend-modern/src/components/Settings/__tests__/RBACPaywallPanels.test.tsx",
@@ -1607,11 +1601,6 @@
"path": "docs/release-control/v6/internal/records/relay-registration-reconnect-drain-2026-03-13.md",
"kind": "file"
},
- {
- "repo": "pulse",
- "path": "frontend-modern/src/components/Dashboard/__tests__/RelayOnboardingCard.test.tsx",
- "kind": "file"
- },
{
"repo": "pulse",
"path": "frontend-modern/src/components/Settings/__tests__/RelaySettingsPanel.runtime.test.tsx",
diff --git a/docs/release-control/v6/internal/subsystems/cloud-paid.md b/docs/release-control/v6/internal/subsystems/cloud-paid.md
index 5f5c424c48..54104d71d8 100644
--- a/docs/release-control/v6/internal/subsystems/cloud-paid.md
+++ b/docs/release-control/v6/internal/subsystems/cloud-paid.md
@@ -53,43 +53,41 @@ agreement, and cloud-specific enforcement rules.
31. `frontend-modern/src/App.tsx`
32. `frontend-modern/src/AppLayout.tsx`
33. `frontend-modern/src/useAppRuntimeState.ts`
-34. `frontend-modern/src/components/Dashboard/RelayOnboardingCard.tsx`
-35. `frontend-modern/src/components/Dashboard/useRelayOnboardingCardState.ts`
-36. `frontend-modern/src/components/Commercial/MonitoredSystemDefinitionDisclosure.tsx`
-37. `frontend-modern/src/components/Settings/BillingAdminPanel.tsx`
-38. `frontend-modern/src/components/Settings/BillingAdminOrganizationsTable.tsx`
-39. `frontend-modern/src/components/Settings/OrganizationBillingPanel.tsx`
-40. `frontend-modern/src/components/Settings/OrganizationBillingLoadingState.tsx`
-41. `frontend-modern/src/components/Settings/MonitoredSystemLedgerPanel.tsx`
-42. `frontend-modern/src/components/Settings/MonitoredSystemAdmissionPreview.tsx`
-43. `frontend-modern/src/components/Settings/ProLicensePanel.tsx`
-44. `frontend-modern/src/components/Settings/ProLicensePlanSection.tsx`
-45. `frontend-modern/src/components/Settings/CommercialBillingSections.tsx`
-46. `frontend-modern/src/components/Settings/SelfHostedCommercialRecoverySection.tsx`
-47. `frontend-modern/src/components/Settings/RelaySettingsPanel.tsx`
-48. `frontend-modern/src/components/Settings/RelayPairingSection.tsx`
-49. `frontend-modern/src/components/Settings/useBillingAdminPanelState.ts`
-50. `frontend-modern/src/components/Settings/useOrganizationBillingPanelState.ts`
-51. `frontend-modern/src/components/Settings/useProLicensePanelState.ts`
-52. `frontend-modern/src/components/Settings/useRelaySettingsPanelState.ts`
-53. `frontend-modern/src/pages/CloudPricing.tsx`
-54. `frontend-modern/src/pages/HostedSignup.tsx`
-55. `frontend-modern/src/pages/PricingHandoff.tsx`
-56. `frontend-modern/src/utils/apiClient.ts`
-57. `frontend-modern/src/utils/cloudPlans.ts`
-58. `frontend-modern/src/utils/commercialBillingModel.ts`
-59. `frontend-modern/src/utils/licensePresentation.ts`
-60. `frontend-modern/src/utils/monitoredSystemPresentation.ts`
-61. `frontend-modern/src/utils/pricingHandoff.ts`
-62. `frontend-modern/src/utils/selfHostedPlans.ts`
-63. `frontend-modern/src/utils/upgradePresentation.ts`
-64. `frontend-modern/src/components/Settings/selfHostedBillingPresentation.ts`
-65. `pulse-pro:license-server/public_pricing.go`
-66. `pulse-pro:license-server/v6_checkout.go`
-67. `pulse-pro:landing-page/thanks.html`
-68. `pulse-pro:scripts/grandfathered_recurring_cutover_preview.py`
-69. `pulse-pro:scripts/validate_public_pricing_model.py`
-70. `pulse-pro:V6_LAUNCH_CHECKLIST.md`
+34. `frontend-modern/src/components/Commercial/MonitoredSystemDefinitionDisclosure.tsx`
+35. `frontend-modern/src/components/Settings/BillingAdminPanel.tsx`
+36. `frontend-modern/src/components/Settings/BillingAdminOrganizationsTable.tsx`
+37. `frontend-modern/src/components/Settings/OrganizationBillingPanel.tsx`
+38. `frontend-modern/src/components/Settings/OrganizationBillingLoadingState.tsx`
+39. `frontend-modern/src/components/Settings/MonitoredSystemLedgerPanel.tsx`
+40. `frontend-modern/src/components/Settings/MonitoredSystemAdmissionPreview.tsx`
+41. `frontend-modern/src/components/Settings/ProLicensePanel.tsx`
+42. `frontend-modern/src/components/Settings/ProLicensePlanSection.tsx`
+43. `frontend-modern/src/components/Settings/CommercialBillingSections.tsx`
+44. `frontend-modern/src/components/Settings/SelfHostedCommercialRecoverySection.tsx`
+45. `frontend-modern/src/components/Settings/RelaySettingsPanel.tsx`
+46. `frontend-modern/src/components/Settings/RelayPairingSection.tsx`
+47. `frontend-modern/src/components/Settings/useBillingAdminPanelState.ts`
+48. `frontend-modern/src/components/Settings/useOrganizationBillingPanelState.ts`
+49. `frontend-modern/src/components/Settings/useProLicensePanelState.ts`
+50. `frontend-modern/src/components/Settings/useRelaySettingsPanelState.ts`
+51. `frontend-modern/src/pages/CloudPricing.tsx`
+52. `frontend-modern/src/pages/HostedSignup.tsx`
+53. `frontend-modern/src/pages/PricingHandoff.tsx`
+54. `frontend-modern/src/utils/apiClient.ts`
+55. `frontend-modern/src/utils/cloudPlans.ts`
+56. `frontend-modern/src/utils/commercialBillingModel.ts`
+57. `frontend-modern/src/utils/licensePresentation.ts`
+58. `frontend-modern/src/utils/monitoredSystemPresentation.ts`
+59. `frontend-modern/src/utils/pricingHandoff.ts`
+60. `frontend-modern/src/utils/selfHostedPlans.ts`
+61. `frontend-modern/src/utils/upgradePresentation.ts`
+62. `frontend-modern/src/components/Settings/selfHostedBillingPresentation.ts`
+63. `pulse-pro:license-server/public_pricing.go`
+64. `pulse-pro:license-server/v6_checkout.go`
+65. `pulse-pro:landing-page/thanks.html`
+66. `pulse-pro:scripts/grandfathered_recurring_cutover_preview.py`
+67. `pulse-pro:scripts/validate_public_pricing_model.py`
+68. `pulse-pro:V6_LAUNCH_CHECKLIST.md`
## Shared Boundaries
@@ -155,7 +153,7 @@ Community limit enforcement.
15. Add or change organization billing and usage presentation through `frontend-modern/src/components/Settings/OrganizationBillingPanel.tsx`, `frontend-modern/src/components/Settings/OrganizationBillingLoadingState.tsx`, and `frontend-modern/src/components/Settings/useOrganizationBillingPanelState.ts`
16. Add or change self-hosted Pro plan, trial, recovery, and entitlement actions through `frontend-modern/src/components/Settings/ProLicensePanel.tsx`, `frontend-modern/src/components/Settings/ProLicensePlanSection.tsx`, `frontend-modern/src/components/Settings/SelfHostedCommercialRecoverySection.tsx`, and `frontend-modern/src/components/Settings/useProLicensePanelState.ts`
17. Add or change monitored-system ledger, disclosure, or admission-preview presentation through `frontend-modern/src/components/Settings/MonitoredSystemLedgerPanel.tsx`, `frontend-modern/src/components/Settings/MonitoredSystemAdmissionPreview.tsx`, `frontend-modern/src/components/Commercial/MonitoredSystemDefinitionDisclosure.tsx`, and `frontend-modern/src/utils/monitoredSystemPresentation.ts`
-18. Add or change paid relay settings and onboarding presentation through `frontend-modern/src/components/Settings/RelaySettingsPanel.tsx`, `frontend-modern/src/components/Settings/RelayPairingSection.tsx`, `frontend-modern/src/components/Settings/useRelaySettingsPanelState.ts`, `frontend-modern/src/components/Dashboard/RelayOnboardingCard.tsx`, and `frontend-modern/src/components/Dashboard/useRelayOnboardingCardState.ts`
+18. Add or change paid relay settings and pairing presentation through `frontend-modern/src/components/Settings/RelaySettingsPanel.tsx`, `frontend-modern/src/components/Settings/RelayPairingSection.tsx`, and `frontend-modern/src/components/Settings/useRelaySettingsPanelState.ts`. The Dashboard shell must not carry a Relay onboarding card or equivalent blanket upsell — relay discovery stays inside its owning settings surface.
Public demo and other read-only presentation policy states must suppress
relay setup and upsell onboarding instead of inviting pairing or commercial
action from a governed non-manageable surface.
@@ -1187,6 +1185,20 @@ must be gated on `hasPaidFeatures`. Self-hosted Pro marketing lives at
`pulserelay.pro/pricing`; the Settings plan surface must show factual
license state for Community users and leave discovery of paid tiers to
surfaces outside the plan page.
+That same no-funnel rule extends beyond Settings -> Plan. The self-hosted
+frontend must not render blanket trial/upgrade marketing to Community users
+from the main dashboard shell, the setup wizard completion screen, or any
+app-wide surface that fires without the user having explicitly engaged with
+a paid feature. In particular the Dashboard overview may not carry a
+`RelayOnboardingCard` paywall or equivalent `Start trial` prompt, the
+`SetupCompletionPanel` may not carry a `Monitor from Anywhere` Relay trial
+block, and no time-triggered "active use" nudge such as `ActiveUseTrialNudge`
+may auto-appear for Community users. Feature-gated discovery that fires only
+when a Community user clicks a locked feature (for example alert
+investigation, 30/90-day history ranges, Patrol AI autonomy modes, or
+Settings panels whose feature the user opened themselves) remains in scope
+for that feature's owning subsystem — those are user-initiated discovery
+paths, not blanket funnels, and are not required to be removed.
That same counted-unit boundary also owns the disclosure rule for retail copy:
default billing and pricing surfaces should use concise monitored-system copy,
while the full counted-unit definition appears only behind explicit disclosure
@@ -1249,29 +1261,21 @@ recurring subscription is canceled, any later return must resolve through the
current v6 pricing contract rather than reviving the legacy recurring rate.
The canonical cross-repo manual drill for that boundary is
`docs/release-control/v6/COMMERCIAL_CANCELLATION_REACTIVATION_E2E_TEST_PLAN.md`.
-The paid relay settings and onboarding surfaces are now part of that same
-ownership model. Changes to
-`frontend-modern/src/components/Settings/RelaySettingsPanel.tsx` and
-`frontend-modern/src/components/Dashboard/RelayOnboardingCard.tsx` must carry
+The paid relay settings surface is part of that same ownership model. Changes
+to `frontend-modern/src/components/Settings/RelaySettingsPanel.tsx` must carry
this contract and the dedicated relay frontend proof files instead of
-remaining unowned consumers of relay licensing and onboarding state.
-That relay settings owner is now intentionally split by role as well:
+remaining unowned consumers of relay licensing state.
+That relay settings owner is intentionally split by role:
`frontend-modern/src/components/Settings/RelaySettingsPanel.tsx` is the
settings shell, `frontend-modern/src/components/Settings/useRelaySettingsPanelState.ts`
owns relay config/status polling, trial, and pairing runtime, and
`frontend-modern/src/components/Settings/RelayPairingSection.tsx` owns the QR
pairing surface. Future relay settings work must extend that split instead of
pulling polling and QR-generation lifecycle back into the shell component.
-The dashboard relay onboarding surface now follows the same rule:
-`frontend-modern/src/components/Dashboard/RelayOnboardingCard.tsx` is the
-dashboard shell, while
-`frontend-modern/src/components/Dashboard/useRelayOnboardingCardState.ts`
-owns license readiness, relay status polling, snooze state, and trial start
-runtime. Future onboarding changes must extend that split instead of pulling
-license and relay runtime back into the card shell. Live-route regressions in
-that dashboard composition must be caught by
-`tests/integration/tests/59-dashboard-relay-onboarding-trial-rate-limit.spec.ts`
-instead of relying only on isolated component tests.
+The Dashboard shell must not host a Relay onboarding card or equivalent
+blanket Relay upsell. Relay discovery belongs to the owning Settings surface
+above; the Dashboard stays a monitoring-first view with no app-wide paywall
+onboarding composed into it.
That relay pairing boundary now also includes backend-owned mobile credential
lifecycle: when the settings surface generates a mobile pairing QR, it must ask
the server for a fresh scoped Pulse Mobile relay access token, fetch the
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index aa810f489a..cb7378e611 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -587,7 +587,6 @@ commercial suppression. `frontend-modern/src/components/Settings/settingsNavCata
`frontend-modern/src/useAppRuntimeState.ts`,
`frontend-modern/src/components/shared/useTrialBannerState.ts`, and
`frontend-modern/src/components/shared/useMonitoredSystemLimitWarningBannerState.ts`,
-`frontend-modern/src/components/Dashboard/RelayOnboardingCard.tsx`,
`frontend-modern/src/components/shared/HistoryChartOverlay.tsx`,
`frontend-modern/src/features/patrol/PatrolIntelligenceBanners.tsx`, and
`frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx`
@@ -886,7 +885,7 @@ later" message; user-facing CTA surfaces must therefore inherit
inventing lane-local 429 wording.
That same shared primitive boundary now also owns intent-level commercial
selectors for non-billing surfaces. Leaf/shared state such as
-`useTrialBannerState.ts`, `useActiveUseTrialNudgeState.ts`,
+`useTrialBannerState.ts`,
`useMonitoredSystemLimitWarningBannerState.ts`, settings panel state, and
Patrol approval/header shells must consume selector helpers from
`frontend-modern/src/stores/licenseCommercial.ts` such as
@@ -1007,14 +1006,6 @@ math, hover target selection, focused-series tooltip detail, and density-cell
opacity rules. Future density-map work should extend those owners instead of
pushing canvas lifecycle, tooltip shaping, or chart math back into the shared
shell.
-The shared active-use trial nudge now follows that same owner split.
-`frontend-modern/src/components/shared/ActiveUseTrialNudge.tsx` stays the
-render shell, `frontend-modern/src/components/shared/useActiveUseTrialNudgeState.ts`
-owns first-seen persistence, snooze state, hourly age refresh, and trial-start
-runtime, and `frontend-modern/src/components/shared/activeUseTrialNudgeModel.ts`
-owns the eligibility policy, age threshold, and nudge copy/config. Future
-active-use trial work should extend those owners instead of pushing storage
-policy, timers, or commercial action flow back into the shared shell.
The shared trial banner now follows that same owner split.
`frontend-modern/src/components/shared/TrialBanner.tsx` stays the render
shell, `frontend-modern/src/components/shared/useTrialBannerState.ts` owns
@@ -2186,7 +2177,6 @@ commercial suppression. `frontend-modern/src/components/Settings/settingsNavCata
`frontend-modern/src/useAppRuntimeState.ts`,
`frontend-modern/src/components/shared/useTrialBannerState.ts`, and
`frontend-modern/src/components/shared/useMonitoredSystemLimitWarningBannerState.ts`,
-`frontend-modern/src/components/Dashboard/RelayOnboardingCard.tsx`,
`frontend-modern/src/components/shared/HistoryChartOverlay.tsx`,
`frontend-modern/src/features/patrol/PatrolIntelligenceBanners.tsx`, and
`frontend-modern/src/features/patrol/PatrolIntelligenceHeader.tsx`
diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
index 477b698c6b..07e2695a64 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -240,12 +240,11 @@ regression protection.
timing steady-state reads, so one-time retention or auto-vacuum cleanup does
not masquerade as summary-route or chart-batch regression latency.
31. Keep the dashboard overview hot path compact and route-owned. `frontend-modern/src/pages/Dashboard.tsx`, `frontend-modern/src/api/resources.ts`, and `frontend-modern/src/hooks/useDashboardOverview.ts` must hydrate KPI cards, problem-resource rows, and top-infrastructure identities through the compact dashboard-summary API contract owned by the adjacent `api-contracts` and `unified-resources` surfaces, rather than booting the full unfiltered paginated unified-resource list just to derive summary cards.
- Commercial or relay-owned dashboard affordances such as
- `frontend-modern/src/components/Dashboard/RelayOnboardingCard.tsx` may be
- composed into that route, but they must remain additive shells on top of
- the same compact summary payload instead of reintroducing route-local
- `all-resources` fetches, summary recomputation, or page-level layout churn
- that displaces the protected overview widgets.
+ Any commercial or relay-owned dashboard affordances composed into that
+ route must remain additive shells on top of the same compact summary
+ payload instead of reintroducing route-local `all-resources` fetches,
+ summary recomputation, or page-level layout churn that displaces the
+ protected overview widgets.
32. Keep infrastructure summary consumers on the compact dashboard overview rather than reopening the all-resources hook. `frontend-modern/src/hooks/useDashboardTrends.ts`, `frontend-modern/src/components/Infrastructure/useInfrastructureSummaryState.ts`, and adjacent dashboard summary consumers may derive chart identity and storage presence from the overview payload they were already given, but they must not call `useResources()` or mount a second unfiltered unified-resource fetch path inside the dashboard hot path. That rule also applies to globally mounted helpers such as `frontend-modern/src/components/AI/Chat/index.tsx`: closed assistant surfaces must read the live websocket snapshot or existing unified-resource cache rather than forcing the dashboard to pay for `all-resources` just because the shell component is mounted. When that assistant shell changes presentation, `frontend-modern/src/utils/aiChatPresentation.ts` must remain the canonical owner for launcher, drawer, session-menu, and empty-state copy so hot-path consumers do not grow one-off inline strings or extra state branches alongside the mounted shell. Blocking shared dialogs must also suppress closed assistant affordances through the shared dialog runtime instead of leaving the mounted shell clickable behind another overlay.
33. Keep hidden workload-route selector shells off the hot path. When the
workloads route keeps `frontend-modern/src/components/shared/InfrastructureSelector.tsx`
diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.json
index 9087c4eb39..0dabdc6d08 100644
--- a/docs/release-control/v6/internal/subsystems/registry.json
+++ b/docs/release-control/v6/internal/subsystems/registry.json
@@ -1694,8 +1694,6 @@
"frontend-modern/src/App.tsx",
"frontend-modern/src/AppLayout.tsx",
"frontend-modern/src/components/Commercial/MonitoredSystemDefinitionDisclosure.tsx",
- "frontend-modern/src/components/Dashboard/RelayOnboardingCard.tsx",
- "frontend-modern/src/components/Dashboard/useRelayOnboardingCardState.ts",
"frontend-modern/src/components/Settings/BillingAdminOrganizationsTable.tsx",
"frontend-modern/src/components/Settings/BillingAdminPanel.tsx",
"frontend-modern/src/components/Settings/CommercialBillingSections.tsx",
@@ -2276,8 +2274,6 @@
"label": "relay frontend surface proof",
"match_prefixes": [],
"match_files": [
- "frontend-modern/src/components/Dashboard/RelayOnboardingCard.tsx",
- "frontend-modern/src/components/Dashboard/useRelayOnboardingCardState.ts",
"frontend-modern/src/components/Settings/RelayPairingSection.tsx",
"frontend-modern/src/components/Settings/RelaySettingsPanel.tsx",
"frontend-modern/src/components/Settings/useRelaySettingsPanelState.ts"
@@ -2285,7 +2281,6 @@
"allow_same_subsystem_tests": false,
"test_prefixes": [],
"exact_files": [
- "frontend-modern/src/components/Dashboard/__tests__/RelayOnboardingCard.test.tsx",
"frontend-modern/src/components/Settings/__tests__/RelaySettingsPanel.runtime.test.tsx",
"frontend-modern/src/components/Settings/__tests__/settingsReadOnlyPanels.test.tsx"
]
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 215a8ad632..1bc6f35e4c 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -253,12 +253,10 @@ querying, and the operator-facing storage health presentation layer.
they were already given, but they must not reopen paginated
`useUnifiedResources()` transport or reintroduce per-pool
`/api/metrics-store/history` fan-out under the dashboard hot path.
- Route-owned dashboard additions such as
- `frontend-modern/src/components/Dashboard/RelayOnboardingCard.tsx` may sit
- above those cards, but they must remain adjacent composition only: the
- relay surface must not replace the recovery/storage dashboard panels,
- suppress the governed no-resources handoff, or move storage/recovery
- summary ownership out of the compact dashboard route.
+ Any route-owned dashboard additions composed above those cards must remain
+ adjacent composition only: they must not replace the recovery/storage
+ dashboard panels, suppress the governed no-resources handoff, or move
+ storage/recovery summary ownership out of the compact dashboard route.
35. Keep shared `frontend-modern/src/App.tsx` public-route ownership explicit by
surface. Storage/recovery preview entrypoints such as
`/preview/setup-complete` may remain public app-shell routes, but unrelated
diff --git a/frontend-modern/src/__tests__/App.architecture.test.ts b/frontend-modern/src/__tests__/App.architecture.test.ts
index 5bf81e0a9d..ac5ec88ce6 100644
--- a/frontend-modern/src/__tests__/App.architecture.test.ts
+++ b/frontend-modern/src/__tests__/App.architecture.test.ts
@@ -44,7 +44,6 @@ describe('App architecture', () => {
expect(appSource).not.toContain('function AppLayout(');
expect(appSource).not.toContain('export const WebSocketContext = createContext<');
expect(appSource).not.toContain('export const DarkModeContext = createContext<');
- expect(appSource).not.toContain('ActiveUseTrialNudge');
expect(appSource).not.toContain('const [organizations, setOrganizations] = createSignal(');
expect(appSource).not.toContain('const [themePreference, setThemePreference] =');
expect(appSource).not.toContain('const [activeOrgID, setActiveOrgID] = createSignal(');
diff --git a/frontend-modern/src/components/Dashboard/RelayOnboardingCard.tsx b/frontend-modern/src/components/Dashboard/RelayOnboardingCard.tsx
deleted file mode 100644
index b37abe1a59..0000000000
--- a/frontend-modern/src/components/Dashboard/RelayOnboardingCard.tsx
+++ /dev/null
@@ -1,104 +0,0 @@
-import { Component, Show } from 'solid-js';
-import Smartphone from 'lucide-solid/icons/smartphone';
-import X from 'lucide-solid/icons/x';
-import { Card } from '@/components/shared/Card';
-import { UpgradeLink } from '@/components/shared/UpgradeLink';
-import { getUpgradeActionDestination } from '@/stores/licenseCommercial';
-import {
- presentationPolicyHidesCommercialSurfaces,
- presentationPolicyIsReadOnly,
-} from '@/stores/sessionPresentationPolicy';
-import {
- RELAY_ONBOARDING_DESCRIPTION,
- RELAY_ONBOARDING_DISCONNECTED_LABEL,
- RELAY_ONBOARDING_SETUP_LABEL,
- RELAY_ONBOARDING_TITLE,
- RELAY_ONBOARDING_TRIAL_LABEL,
- RELAY_ONBOARDING_TRIAL_STARTING_LABEL,
- RELAY_ONBOARDING_UPGRADE_LABEL,
-} from '@/utils/relayPresentation';
-import { useRelayOnboardingCardState } from './useRelayOnboardingCardState';
-
-export const RelayOnboardingCard: Component = () => {
- const state = useRelayOnboardingCardState();
-
- return (
- <Show
- when={
- !presentationPolicyIsReadOnly() &&
- state.shouldShow() &&
- (!presentationPolicyHidesCommercialSurfaces() || state.hasRelay())
- }
- >
- <Card padding="lg" class="relative overflow-hidden">
- <div class="absolute -right-10 -top-10 h-32 w-32 rounded-full bg-blue-100 dark:bg-blue-900" />
- <div class="absolute -right-16 -bottom-16 h-40 w-40 rounded-full bg-surface-alt" />
-
- <button
- type="button"
- class="absolute right-3 top-3 inline-flex items-center justify-center rounded-md p-1 hover:text-base-content hover:bg-surface-hover"
- onClick={state.dismiss}
- aria-label="Dismiss relay onboarding"
- >
- <X size={16} strokeWidth={2} />
- </button>
-
- <div class="relative flex items-start gap-3">
- <div class="flex h-10 w-10 items-center justify-center rounded-md bg-blue-600 text-white shadow-sm">
- <Smartphone size={20} strokeWidth={2} />
- </div>
-
- <div class="min-w-0 flex-1">
- <h2 class="text-base font-semibold text-base-content">{RELAY_ONBOARDING_TITLE}</h2>
- <p class="mt-1 text-sm text-muted">
- {RELAY_ONBOARDING_DESCRIPTION}
- </p>
-
- <div class="mt-4 flex flex-wrap items-center gap-2">
- <Show
- when={state.hasRelay()}
- fallback={
- <>
- <UpgradeLink
- class="inline-flex items-center rounded-md bg-blue-600 px-3 py-2 text-sm font-medium text-white shadow-sm hover:bg-blue-700"
- destination={getUpgradeActionDestination('relay')}
- onClick={state.handleUpgradeClick}
- >
- {RELAY_ONBOARDING_UPGRADE_LABEL}
- </UpgradeLink>
- <button
- type="button"
- class="inline-flex items-center rounded-md border border-border bg-surface px-3 py-2 text-sm font-medium text-base-content shadow-sm hover:bg-surface-hover disabled:opacity-50"
- onClick={() => void state.handleStartTrial()}
- disabled={state.trialStarting()}
- >
- {state.trialStarting()
- ? RELAY_ONBOARDING_TRIAL_STARTING_LABEL
- : RELAY_ONBOARDING_TRIAL_LABEL}
- </button>
- </>
- }
- >
- <button
- type="button"
- class="inline-flex items-center rounded-md bg-blue-600 px-3 py-2 text-sm font-medium text-white shadow-sm hover:bg-blue-700"
- onClick={state.handleSetupRelay}
- >
- {RELAY_ONBOARDING_SETUP_LABEL}
- </button>
- </Show>
-
- <Show
- when={
- state.hasRelay() && state.statusLoaded() && state.status()?.connected === false
- }
- >
- <span class="text-xs text-muted">{RELAY_ONBOARDING_DISCONNECTED_LABEL}</span>
- </Show>
- </div>
- </div>
- </div>
- </Card>
- </Show>
- );
-};
diff --git a/frontend-modern/src/components/Dashboard/__tests__/RelayOnboardingCard.test.tsx b/frontend-modern/src/components/Dashboard/__tests__/RelayOnboardingCard.test.tsx
deleted file mode 100644
index f573f6c1d0..0000000000
--- a/frontend-modern/src/components/Dashboard/__tests__/RelayOnboardingCard.test.tsx
+++ /dev/null
@@ -1,610 +0,0 @@
-import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
-import { cleanup, fireEvent, render, screen, waitFor } from '@solidjs/testing-library';
-import { getPublicPricingUrl } from '@/utils/pricingHandoff';
-import relayOnboardingCardStateSource from '../useRelayOnboardingCardState.ts?raw';
-
-// ── Hoisted mocks ──────────────────────────────────────────────────────
-
-const {
- getUpgradeActionDestinationMock,
- mockNavigate,
- loadLicenseStatusMock,
- startProTrialMock,
- showErrorMock,
- showSuccessMock,
- trackPaywallViewedMock,
- trackUpgradeClickedMock,
- isUpsellSnoozedMock,
- snoozeUpsellMock,
- getRelayStatusMock,
- hasFeatureMock,
- licenseLoadedMock,
- getUpgradeActionUrlOrFallbackMock,
- presentationPolicyHidesCommercialSurfacesMock,
- presentationPolicyIsReadOnlyMock,
-} = vi.hoisted(() => ({
- getUpgradeActionDestinationMock: vi.fn(),
- mockNavigate: vi.fn(),
- loadLicenseStatusMock: vi.fn(),
- startProTrialMock: vi.fn(),
- showErrorMock: vi.fn(),
- showSuccessMock: vi.fn(),
- trackPaywallViewedMock: vi.fn(),
- trackUpgradeClickedMock: vi.fn(),
- isUpsellSnoozedMock: vi.fn(),
- snoozeUpsellMock: vi.fn(),
- getRelayStatusMock: vi.fn(),
- hasFeatureMock: vi.fn(),
- licenseLoadedMock: vi.fn(),
- getUpgradeActionUrlOrFallbackMock: vi.fn(),
- presentationPolicyHidesCommercialSurfacesMock: vi.fn(),
- presentationPolicyIsReadOnlyMock: vi.fn(),
-}));
-
-vi.mock('@solidjs/router', () => ({
- useNavigate: () => mockNavigate,
-}));
-
-vi.mock('@/stores/license', () => ({
- hasFeature: (...args: unknown[]) => hasFeatureMock(...args),
- loadRuntimeCapabilities: (...args: unknown[]) => loadLicenseStatusMock(...args),
- runtimeCapabilitiesLoaded: (...args: unknown[]) => licenseLoadedMock(...args),
-}));
-
-vi.mock('@/stores/licenseCommercial', () => ({
- getUpgradeActionDestination: (...args: unknown[]) => getUpgradeActionDestinationMock(...args),
- startProTrial: (...args: unknown[]) => startProTrialMock(...args),
- getUpgradeActionUrlOrFallback: (...args: unknown[]) => getUpgradeActionUrlOrFallbackMock(...args),
-}));
-
-vi.mock('@/stores/sessionPresentationPolicy', () => ({
- presentationPolicyHidesCommercialSurfaces: () =>
- presentationPolicyHidesCommercialSurfacesMock(),
- presentationPolicyIsReadOnly: () => presentationPolicyIsReadOnlyMock(),
-}));
-
-vi.mock('@/api/relay', () => ({
- RelayAPI: {
- getStatus: (...args: unknown[]) => getRelayStatusMock(...args),
- },
-}));
-
-vi.mock('@/utils/toast', () => ({
- showError: (...args: unknown[]) => showErrorMock(...args),
- showSuccess: (...args: unknown[]) => showSuccessMock(...args),
-}));
-
-vi.mock('@/utils/upgradeMetrics', () => ({
- trackPaywallViewed: (...args: unknown[]) => trackPaywallViewedMock(...args),
- trackUpgradeClicked: (...args: unknown[]) => trackUpgradeClickedMock(...args),
-}));
-
-vi.mock('@/utils/snooze', () => ({
- isUpsellSnoozed: (...args: unknown[]) => isUpsellSnoozedMock(...args),
- snoozeUpsell: (...args: unknown[]) => snoozeUpsellMock(...args),
-}));
-
-vi.mock('@/utils/logger', () => ({
- logger: { warn: vi.fn(), error: vi.fn(), info: vi.fn(), debug: vi.fn() },
-}));
-
-vi.mock('@/components/shared/Card', () => ({
- Card: (props: { children?: unknown; class?: string }) => (
- <div data-testid="card">{props.children as any}</div>
- ),
-}));
-
-// Import component AFTER mocks
-import { RelayOnboardingCard } from '../RelayOnboardingCard';
-
-// ── Helpers ─────────────────────────────────────────────────────────────
-
-function resetAllMocks() {
- mockNavigate.mockReset();
- loadLicenseStatusMock.mockReset();
- startProTrialMock.mockReset();
- showErrorMock.mockReset();
- showSuccessMock.mockReset();
- trackPaywallViewedMock.mockReset();
- trackUpgradeClickedMock.mockReset();
- isUpsellSnoozedMock.mockReset();
- snoozeUpsellMock.mockReset();
- getRelayStatusMock.mockReset();
- hasFeatureMock.mockReset();
- licenseLoadedMock.mockReset();
- getUpgradeActionDestinationMock.mockReset();
- getUpgradeActionUrlOrFallbackMock.mockReset();
- presentationPolicyHidesCommercialSurfacesMock.mockReset();
- presentationPolicyHidesCommercialSurfacesMock.mockReturnValue(false);
- presentationPolicyIsReadOnlyMock.mockReset();
- presentationPolicyIsReadOnlyMock.mockReturnValue(false);
-}
-
-/**
- * Sets up mock defaults for the "has relay feature" scenario (setup card).
- * Override individual mocks after calling this if needed.
- */
-function setupWithRelayFeature(statusOverride?: { connected: boolean; active_channels: number }) {
- const defaultStatus = statusOverride ?? { connected: false, active_channels: 0 };
- loadLicenseStatusMock.mockResolvedValue(undefined);
- licenseLoadedMock.mockReturnValue(true);
- hasFeatureMock.mockReturnValue(true);
- isUpsellSnoozedMock.mockReturnValue(false);
- getRelayStatusMock.mockResolvedValue(defaultStatus);
- getUpgradeActionDestinationMock.mockReturnValue({
- href: getPublicPricingUrl('relay'),
- external: true,
- });
- getUpgradeActionUrlOrFallbackMock.mockReturnValue(getPublicPricingUrl('relay'));
-}
-
-/**
- * Sets up mock defaults for the "no relay feature" scenario (paywall card).
- */
-function setupWithoutRelayFeature() {
- loadLicenseStatusMock.mockResolvedValue(undefined);
- licenseLoadedMock.mockReturnValue(true);
- hasFeatureMock.mockReturnValue(false);
- isUpsellSnoozedMock.mockReturnValue(false);
- getUpgradeActionDestinationMock.mockReturnValue({
- href: getPublicPricingUrl('relay'),
- external: true,
- });
- getUpgradeActionUrlOrFallbackMock.mockReturnValue(getPublicPricingUrl('relay'));
-}
-
-// ── Tests ───────────────────────────────────────────────────────────────
-
-describe('RelayOnboardingCard', () => {
- it('keeps relay onboarding trial flow on the shared trial action owner', () => {
- expect(relayOnboardingCardStateSource).toContain('runStartProTrialAction({');
- expect(relayOnboardingCardStateSource).not.toContain('startProTrial()');
- });
-
- beforeEach(() => {
- resetAllMocks();
- });
-
- afterEach(() => {
- cleanup();
- });
-
- // ── Paywall scenario (no relay feature) ────────────────────────────
-
- describe('paywall view (no relay feature)', () => {
- it('renders the upgrade link and trial button when user lacks relay feature', async () => {
- setupWithoutRelayFeature();
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(loadLicenseStatusMock).toHaveBeenCalled();
- });
-
- // The upgrade link should be visible
- const upgradeLink = screen.getByText(/Get Relay/);
- expect(upgradeLink).toBeInTheDocument();
- expect(upgradeLink.closest('a')).toHaveAttribute('href', getPublicPricingUrl('relay'));
-
- // The trial button should be visible
- expect(screen.getByText(/or start a Pro trial/)).toBeInTheDocument();
- });
-
- it('tracks paywall viewed event', async () => {
- setupWithoutRelayFeature();
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(trackPaywallViewedMock).toHaveBeenCalledWith('relay', 'dashboard_onboarding');
- });
- });
-
- it('tracks upgrade clicks from the paywall link without starting a trial', async () => {
- setupWithoutRelayFeature();
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(screen.getByText(/Get Relay/)).toBeInTheDocument();
- });
-
- fireEvent.click(screen.getByText(/Get Relay/));
-
- expect(trackUpgradeClickedMock).toHaveBeenCalledWith('dashboard_onboarding', 'relay');
- expect(startProTrialMock).not.toHaveBeenCalled();
- });
-
- it('does not render the "Set Up Relay" button', async () => {
- setupWithoutRelayFeature();
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(loadLicenseStatusMock).toHaveBeenCalled();
- });
-
- expect(screen.queryByText('Set Up Relay')).not.toBeInTheDocument();
- });
-
- it('hides the relay paywall entirely in demo mode', async () => {
- setupWithoutRelayFeature();
- presentationPolicyHidesCommercialSurfacesMock.mockReturnValue(true);
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(loadLicenseStatusMock).toHaveBeenCalled();
- });
-
- expect(screen.queryByTestId('card')).not.toBeInTheDocument();
- expect(screen.queryByText(/Get Relay/)).not.toBeInTheDocument();
- expect(screen.queryByText(/or start a Pro trial/)).not.toBeInTheDocument();
- });
- });
-
- // ── Setup scenario (has relay feature, not connected) ──────────────
-
- describe('setup view (has relay feature, not yet paired)', () => {
- it('renders the "Set Up Relay" button when relay is available but not connected', async () => {
- setupWithRelayFeature({ connected: false, active_channels: 0 });
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(screen.getByText('Set Up Relay')).toBeInTheDocument();
- });
- });
-
- it('shows "Relay is currently disconnected" when relay reports disconnected', async () => {
- setupWithRelayFeature({ connected: false, active_channels: 0 });
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(screen.getByText('Relay is currently disconnected.')).toBeInTheDocument();
- });
- });
-
- it('navigates to relay settings when "Set Up Relay" is clicked', async () => {
- setupWithRelayFeature({ connected: false, active_channels: 0 });
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(screen.getByText('Set Up Relay')).toBeInTheDocument();
- });
-
- fireEvent.click(screen.getByText('Set Up Relay'));
- expect(mockNavigate).toHaveBeenCalledWith('/settings/system-relay');
- });
-
- it('does not render upgrade link or trial button', async () => {
- setupWithRelayFeature({ connected: false, active_channels: 0 });
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(screen.getByText('Set Up Relay')).toBeInTheDocument();
- });
-
- expect(screen.queryByText(/Get Relay/)).not.toBeInTheDocument();
- expect(screen.queryByText(/or start a Pro trial/)).not.toBeInTheDocument();
- });
-
- it('hides relay onboarding entirely in read-only demo mode', async () => {
- setupWithRelayFeature({ connected: false, active_channels: 0 });
- presentationPolicyIsReadOnlyMock.mockReturnValue(true);
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(loadLicenseStatusMock).toHaveBeenCalled();
- });
-
- expect(screen.queryByTestId('card')).not.toBeInTheDocument();
- expect(screen.queryByText('Set Up Relay')).not.toBeInTheDocument();
- expect(screen.queryByText('Pair Your Mobile Device')).not.toBeInTheDocument();
- });
- });
-
- // ── Hidden when relay is active ────────────────────────────────────
-
- describe('hidden when relay has active connections', () => {
- it('does not render when relay is connected with active channels', async () => {
- setupWithRelayFeature({ connected: true, active_channels: 1 });
- render(() => <RelayOnboardingCard />);
-
- // Wait for mount effects to complete
- await waitFor(() => {
- expect(getRelayStatusMock).toHaveBeenCalled();
- });
-
- expect(screen.queryByText('Pair Your Mobile Device')).not.toBeInTheDocument();
- expect(screen.queryByText('Set Up Relay')).not.toBeInTheDocument();
- });
- });
-
- // ── Dismiss (snooze) behavior ──────────────────────────────────────
-
- describe('dismiss behavior', () => {
- it('calls snoozeUpsell and hides the card when dismiss button is clicked', async () => {
- setupWithoutRelayFeature();
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(screen.getByText(/Get Relay/)).toBeInTheDocument();
- });
-
- const dismissBtn = screen.getByLabelText('Dismiss relay onboarding');
- fireEvent.click(dismissBtn);
-
- expect(snoozeUpsellMock).toHaveBeenCalledWith('pulse_relay_onboarding_snoozed');
-
- await waitFor(() => {
- expect(screen.queryByText('Pair Your Mobile Device')).not.toBeInTheDocument();
- });
- });
-
- it('does not render if already snoozed', async () => {
- setupWithoutRelayFeature();
- isUpsellSnoozedMock.mockReturnValue(true);
-
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(loadLicenseStatusMock).toHaveBeenCalled();
- });
-
- expect(screen.queryByText('Pair Your Mobile Device')).not.toBeInTheDocument();
- });
- });
-
- // ── Trial start flow ──────────────────────────────────────────────
-
- describe('trial start flow', () => {
- it('starts a trial successfully, shows success toast, and reloads license', async () => {
- setupWithoutRelayFeature();
- startProTrialMock.mockResolvedValue({ outcome: 'activated' });
- // After trial, license reloads and relay becomes available
- loadLicenseStatusMock.mockResolvedValue(undefined);
-
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(screen.getByText(/or start a Pro trial/)).toBeInTheDocument();
- });
-
- fireEvent.click(screen.getByText(/or start a Pro trial/));
-
- await waitFor(() => {
- expect(startProTrialMock).toHaveBeenCalled();
- });
-
- await waitFor(() => {
- expect(showSuccessMock).toHaveBeenCalledWith('Trial started. Relay is now available.');
- });
-
- expect(trackUpgradeClickedMock).toHaveBeenCalledWith('dashboard_onboarding', 'relay');
-
- // Verify license is force-reloaded after successful trial
- expect(loadLicenseStatusMock).toHaveBeenCalledWith(true);
- });
-
- it('redirects when trial returns redirect outcome', async () => {
- setupWithoutRelayFeature();
- startProTrialMock.mockResolvedValue({
- outcome: 'redirect',
- actionUrl: 'https://example.com/checkout',
- });
-
- const originalLocation = window.location;
- Object.defineProperty(window, 'location', {
- writable: true,
- value: { ...originalLocation, href: '' },
- });
-
- try {
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(screen.getByText(/or start a Pro trial/)).toBeInTheDocument();
- });
-
- fireEvent.click(screen.getByText(/or start a Pro trial/));
-
- await waitFor(() => {
- expect(window.location.href).toBe('https://example.com/checkout');
- });
- } finally {
- Object.defineProperty(window, 'location', {
- writable: true,
- value: originalLocation,
- });
- }
- });
-
- it('shows the backend error and does not redirect when trial fails', async () => {
- setupWithoutRelayFeature();
- startProTrialMock.mockRejectedValue(new Error('server error'));
-
- const originalLocation = window.location;
- Object.defineProperty(window, 'location', {
- writable: true,
- value: { ...originalLocation, href: '' },
- });
-
- try {
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(screen.getByText(/or start a Pro trial/)).toBeInTheDocument();
- });
-
- fireEvent.click(screen.getByText(/or start a Pro trial/));
-
- await waitFor(() => {
- expect(showErrorMock).toHaveBeenCalledWith('server error');
- });
-
- expect(window.location.href).toBe('');
- } finally {
- Object.defineProperty(window, 'location', {
- writable: true,
- value: originalLocation,
- });
- }
- });
-
- it('shows retry-after guidance and does not redirect when trial is rate limited', async () => {
- setupWithoutRelayFeature();
- startProTrialMock.mockRejectedValue(
- Object.assign(new Error('rate limited'), {
- status: 429,
- retryAfterSeconds: 120,
- }),
- );
-
- const originalLocation = window.location;
- Object.defineProperty(window, 'location', {
- writable: true,
- value: { ...originalLocation, href: '' },
- });
-
- try {
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(screen.getByText(/or start a Pro trial/)).toBeInTheDocument();
- });
-
- fireEvent.click(screen.getByText(/or start a Pro trial/));
-
- await waitFor(() => {
- expect(showErrorMock).toHaveBeenCalledWith('Try again in about 2 minutes');
- });
-
- expect(window.location.href).toBe('');
- } finally {
- Object.defineProperty(window, 'location', {
- writable: true,
- value: originalLocation,
- });
- }
- });
-
- it('prevents duplicate trial starts on rapid double-click', async () => {
- setupWithoutRelayFeature();
- // Never-resolving promise to keep trial in progress
- startProTrialMock.mockReturnValue(new Promise(() => {}));
-
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(screen.getByText(/or start a Pro trial/)).toBeInTheDocument();
- });
-
- const trialBtn = screen.getByText(/or start a Pro trial/);
- fireEvent.click(trialBtn);
- fireEvent.click(trialBtn);
- fireEvent.click(trialBtn);
-
- // Despite 3 clicks, startProTrial should only be called once (guard: trialStarting())
- await waitFor(() => {
- expect(startProTrialMock).toHaveBeenCalledTimes(1);
- });
- });
-
- it('shows "Starting trial..." text while trial is in progress', async () => {
- setupWithoutRelayFeature();
- // Never-resolving promise to keep trial in progress
- startProTrialMock.mockReturnValue(new Promise(() => {}));
-
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(screen.getByText(/or start a Pro trial/)).toBeInTheDocument();
- });
-
- fireEvent.click(screen.getByText(/or start a Pro trial/));
-
- await waitFor(() => {
- expect(screen.getByText('Starting trial...')).toBeInTheDocument();
- });
- });
- });
-
- // ── Relay status loading ──────────────────────────────────────────
-
- describe('relay status loading', () => {
- it('fetches relay status on mount when relay feature is available', async () => {
- setupWithRelayFeature();
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(getRelayStatusMock).toHaveBeenCalled();
- });
- });
-
- it('does not fetch relay status when relay feature is not available', async () => {
- setupWithoutRelayFeature();
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(loadLicenseStatusMock).toHaveBeenCalled();
- });
-
- expect(getRelayStatusMock).not.toHaveBeenCalled();
- });
-
- it('handles relay status fetch failure gracefully', async () => {
- setupWithRelayFeature();
- getRelayStatusMock.mockRejectedValue(new Error('network error'));
-
- render(() => <RelayOnboardingCard />);
-
- // Should still render the card (status is null, treated as not connected)
- await waitFor(() => {
- expect(screen.getByText('Set Up Relay')).toBeInTheDocument();
- });
- });
- });
-
- // ── Edge cases ────────────────────────────────────────────────────
-
- describe('edge cases', () => {
- it('does not render before license is loaded', () => {
- licenseLoadedMock.mockReturnValue(false);
- loadLicenseStatusMock.mockReturnValue(new Promise(() => {})); // never resolves
- hasFeatureMock.mockReturnValue(false);
- isUpsellSnoozedMock.mockReturnValue(false);
-
- render(() => <RelayOnboardingCard />);
-
- expect(screen.queryByText('Pair Your Mobile Device')).not.toBeInTheDocument();
- });
-
- it('renders the heading text correctly', async () => {
- setupWithoutRelayFeature();
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(screen.getByText('Pair Your Mobile Device')).toBeInTheDocument();
- });
-
- expect(screen.getByText(/Pulse Relay lets your phone securely connect/)).toBeInTheDocument();
- });
-
- it('connected relay with zero active channels still shows setup card', async () => {
- // connected=true but active_channels=0 should still show the card
- // because relayHasActiveConnections requires active_channels > 0
- setupWithRelayFeature({ connected: true, active_channels: 0 });
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(screen.getByText('Set Up Relay')).toBeInTheDocument();
- });
- });
-
- it('disconnected relay with active_channels > 0 still shows setup card', async () => {
- // connected=false should make relayHasActiveConnections return false
- // regardless of active_channels value
- setupWithRelayFeature({ connected: false, active_channels: 5 });
- render(() => <RelayOnboardingCard />);
-
- await waitFor(() => {
- expect(screen.getByText('Set Up Relay')).toBeInTheDocument();
- });
- });
- });
-});
diff --git a/frontend-modern/src/components/Dashboard/useRelayOnboardingCardState.ts b/frontend-modern/src/components/Dashboard/useRelayOnboardingCardState.ts
deleted file mode 100644
index e933f6cf1f..0000000000
--- a/frontend-modern/src/components/Dashboard/useRelayOnboardingCardState.ts
+++ /dev/null
@@ -1,138 +0,0 @@
-import { createEffect, createMemo, createSignal, onMount } from 'solid-js';
-import { useNavigate } from '@solidjs/router';
-import { RelayAPI, type RelayStatus } from '@/api/relay';
-import {
- hasFeature,
- runtimeCapabilitiesLoaded,
- loadRuntimeCapabilities,
-} from '@/stores/license';
-import { logger } from '@/utils/logger';
-import { isUpsellSnoozed, snoozeUpsell } from '@/utils/snooze';
-import { showError, showSuccess } from '@/utils/toast';
-import { trackPaywallViewed, trackUpgradeClicked } from '@/utils/upgradeMetrics';
-import { runStartProTrialAction } from '@/utils/trialStartAction';
-
-const SNOOZE_KEY = 'pulse_relay_onboarding_snoozed';
-const RELAY_SETTINGS_PATH = '/settings/system-relay';
-
-export function useRelayOnboardingCardState() {
- const navigate = useNavigate();
- const [dismissed, setDismissed] = createSignal(isUpsellSnoozed(SNOOZE_KEY));
- const [licenseReady, setLicenseReady] = createSignal<boolean>(runtimeCapabilitiesLoaded());
- const [status, setStatus] = createSignal<RelayStatus | null>(null);
- const [statusLoaded, setStatusLoaded] = createSignal(false);
- const [statusLoading, setStatusLoading] = createSignal(false);
- const [trialStarting, setTrialStarting] = createSignal(false);
-
- const hasRelay = createMemo(() => hasFeature('relay'));
- const relayHasActiveConnections = createMemo(() => {
- const nextStatus = status();
- if (!nextStatus || !nextStatus.connected) {
- return false;
- }
- return nextStatus.active_channels > 0;
- });
- const shouldShowPaywall = createMemo(() => licenseReady() && !dismissed() && !hasRelay());
- const shouldShowSetup = createMemo(
- () =>
- licenseReady() &&
- !dismissed() &&
- hasRelay() &&
- statusLoaded() &&
- !relayHasActiveConnections(),
- );
- const shouldShow = createMemo(() => shouldShowPaywall() || shouldShowSetup());
-
- const loadRelayStatusOnce = async () => {
- if (statusLoading() || statusLoaded() || !hasRelay()) {
- return;
- }
-
- setStatusLoading(true);
- try {
- const nextStatus = await RelayAPI.getStatus();
- setStatus(nextStatus);
- } catch (error) {
- logger.warn('[RelayOnboardingCard] Failed to load relay status', error);
- setStatus(null);
- } finally {
- setStatusLoaded(true);
- setStatusLoading(false);
- }
- };
-
- onMount(async () => {
- try {
- await loadRuntimeCapabilities();
- } finally {
- setLicenseReady(true);
- }
- void loadRelayStatusOnce();
- });
-
- createEffect(() => {
- if (!licenseReady()) {
- return;
- }
- if (hasRelay() && !statusLoaded() && !statusLoading()) {
- void loadRelayStatusOnce();
- }
- });
-
- createEffect((wasPaywallVisible: boolean) => {
- const isPaywallVisible = shouldShowPaywall();
- if (isPaywallVisible && !wasPaywallVisible) {
- trackPaywallViewed('relay', 'dashboard_onboarding');
- }
- return isPaywallVisible;
- }, false);
-
- const dismiss = () => {
- snoozeUpsell(SNOOZE_KEY);
- setDismissed(true);
- };
-
- const handleSetupRelay = () => {
- navigate(RELAY_SETTINGS_PATH);
- };
-
- const handleUpgradeClick = () => {
- trackUpgradeClicked('dashboard_onboarding', 'relay');
- };
-
- const handleStartTrial = async () => {
- handleUpgradeClick();
- if (trialStarting()) {
- return;
- }
-
- setTrialStarting(true);
- try {
- const outcome = await runStartProTrialAction({
- branded: true,
- successMessage: 'Trial started. Relay is now available.',
- showSuccess,
- showError,
- });
- if (outcome === 'activated') {
- await loadRuntimeCapabilities(true);
- setStatusLoaded(false);
- void loadRelayStatusOnce();
- }
- } finally {
- setTrialStarting(false);
- }
- };
-
- return {
- dismiss,
- handleSetupRelay,
- handleStartTrial,
- handleUpgradeClick,
- hasRelay,
- shouldShow,
- status,
- statusLoaded,
- trialStarting,
- };
-}
diff --git a/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts b/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts
index 832b4db877..ecff8f0936 100644
--- a/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts
@@ -192,8 +192,6 @@ import trueNASSettingsPanelStateSource from '../useTrueNASSettingsPanelState.ts?
import vmwareApiSource from '@/api/vmware.ts?raw';
import vmwareSettingsPanelSource from '../VMwareSettingsPanel.tsx?raw';
import vmwareSettingsPanelStateSource from '../useVMwareSettingsPanelState.ts?raw';
-import relayOnboardingCardSource from '@/components/Dashboard/RelayOnboardingCard.tsx?raw';
-import relayOnboardingCardStateSource from '@/components/Dashboard/useRelayOnboardingCardState.ts?raw';
import generalSettingsPanelSource from '../GeneralSettingsPanel.tsx?raw';
import networkBoundarySettingsSectionSource from '../NetworkBoundarySettingsSection.tsx?raw';
import networkDiscoverySectionSource from '../NetworkDiscoverySection.tsx?raw';
@@ -517,26 +515,6 @@ describe('monitored-system model guardrails', () => {
expect(infrastructureDiscoveryRuntimeStateSource).not.toContain('NodesAPI.getNodes');
expect(infrastructureSettingsModelSource).toContain('collectConfiguredInfrastructureHosts');
expect(infrastructureSettingsModelSource).toContain('matchConfiguredNodeToResource');
- expect(relayOnboardingCardSource).toContain('@/utils/relayPresentation');
- expect(relayOnboardingCardSource).toContain('./useRelayOnboardingCardState');
- expect(relayOnboardingCardSource).toContain('RELAY_ONBOARDING_TITLE');
- expect(relayOnboardingCardSource).toContain('RELAY_ONBOARDING_DESCRIPTION');
- expect(relayOnboardingCardSource).toContain('RELAY_ONBOARDING_UPGRADE_LABEL');
- expect(relayOnboardingCardSource).toContain('RELAY_ONBOARDING_TRIAL_LABEL');
- expect(relayOnboardingCardSource).toContain('RELAY_ONBOARDING_TRIAL_STARTING_LABEL');
- expect(relayOnboardingCardSource).toContain('RELAY_ONBOARDING_SETUP_LABEL');
- expect(relayOnboardingCardSource).toContain('RELAY_ONBOARDING_DISCONNECTED_LABEL');
- expect(relayOnboardingCardSource).not.toContain('createSignal(');
- expect(relayOnboardingCardSource).not.toContain('loadRuntimeCapabilities()');
- expect(relayOnboardingCardSource).not.toContain('RelayAPI.getStatus()');
- expect(relayOnboardingCardSource).not.toContain('startProTrial()');
- expect(relayOnboardingCardSource).not.toContain('Pair Your Mobile Device');
- expect(relayOnboardingCardSource).not.toContain('Relay is currently disconnected.');
- expect(relayOnboardingCardStateSource).toContain('loadRuntimeCapabilities()');
- expect(relayOnboardingCardStateSource).toContain('RelayAPI.getStatus()');
- expect(relayOnboardingCardStateSource).toContain('trackPaywallViewed');
- expect(relayOnboardingCardStateSource).toContain('runStartProTrialAction({');
- expect(relayOnboardingCardStateSource).not.toContain('startProTrial()');
expect(infrastructureInstallStateSource).toContain('STORAGE_KEYS.SETUP_HANDOFF');
expect(infrastructureInstallerSectionSource).toContain(
'Security configured. Save these first-run credentials now.',
@@ -544,11 +522,11 @@ describe('monitored-system model guardrails', () => {
expect(infrastructureInstallerSectionSource).toContain(
'Pulse generated the first scoped install token automatically. The install commands below are ready for the first host.',
);
- expect(setupCompletionPanelSource).toContain('@/utils/relayPresentation');
- expect(setupCompletionPanelSource).toContain('RELAY_ONBOARDING_SETUP_LABEL');
- expect(setupCompletionPanelSource).toContain('RELAY_ONBOARDING_TRIAL_STARTING_LABEL');
- expect(setupCompletionPanelSource).toContain('RELAY_ONBOARDING_SETUP_WIZARD_TRIAL_LABEL');
- expect(setupCompletionPanelSource).toContain('RELAY_ONBOARDING_TRIAL_HINT');
+ expect(setupCompletionPanelSource).not.toContain('@/utils/relayPresentation');
+ expect(setupCompletionPanelSource).not.toContain('RELAY_ONBOARDING_SETUP_LABEL');
+ expect(setupCompletionPanelSource).not.toContain('RELAY_ONBOARDING_TRIAL_STARTING_LABEL');
+ expect(setupCompletionPanelSource).not.toContain('RELAY_ONBOARDING_SETUP_WIZARD_TRIAL_LABEL');
+ expect(setupCompletionPanelSource).not.toContain('RELAY_ONBOARDING_TRIAL_HINT');
expect(setupCompletionPanelSource).not.toContain('Start Free Trial & Set Up Mobile');
expect(setupCompletionPanelSource).not.toContain('14-DAY PRO TRIAL');
expect(relayPresentationSource).toContain('export function getRelayConnectionPresentation');
diff --git a/frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx b/frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx
index 82ae647c67..8cb52d5949 100644
--- a/frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx
+++ b/frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx
@@ -4,34 +4,16 @@ import {
createEffect,
createMemo,
onCleanup,
- onMount,
Show,
For,
} from 'solid-js';
-import { useNavigate } from '@solidjs/router';
import { copyToClipboard } from '@/utils/clipboard';
import { logger } from '@/utils/logger';
import { apiFetchJSON } from '@/utils/apiClient';
import { getPulseBaseUrl } from '@/utils/url';
import type { State } from '@/types/api';
import type { Resource } from '@/types/resource';
-import { showSuccess, showError } from '@/utils/toast';
-import {
- trackAgentFirstConnected,
- trackPaywallViewed,
- trackUpgradeClicked,
-} from '@/utils/upgradeMetrics';
-import {
- isCommercialTrialActive,
- loadCommercialPosture,
-} from '@/stores/licenseCommercial';
-import {
- RELAY_ONBOARDING_SETUP_LABEL,
- RELAY_ONBOARDING_SETUP_WIZARD_TRIAL_LABEL,
- RELAY_ONBOARDING_TRIAL_HINT,
- RELAY_ONBOARDING_TRIAL_STARTING_LABEL,
-} from '@/utils/relayPresentation';
-import { runStartProTrialAction } from '@/utils/trialStartAction';
+import { trackAgentFirstConnected } from '@/utils/upgradeMetrics';
import type { WizardState } from '../SetupWizard';
import {
buildSetupCompletionConnectedSystems,
@@ -72,34 +54,18 @@ const UNIFIED_RESOURCE_GUIDANCE = {
],
} as const;
-const RELAY_SETTINGS_PATH = '/settings/system-relay';
const INFRASTRUCTURE_INSTALL_PATH = '/settings/infrastructure/install';
const INFRASTRUCTURE_PLATFORMS_PATH = '/settings/infrastructure/platforms';
const SETUP_WIZARD_TELEMETRY_SURFACE = 'setup_wizard_complete';
export const SetupCompletionPanel: Component<CompleteStepProps> = (props) => {
- const navigate = useNavigate();
const [copied, setCopied] = createSignal<'password' | 'admin-token' | null>(null);
const [showCredentials, setShowCredentials] = createSignal(true);
const [connectedSystems, setConnectedSystems] = createSignal<
ReturnType<typeof buildSetupCompletionConnectedSystems>
>([]);
- const [trialStarting, setTrialStarting] = createSignal(false);
- const [trialStarted, setTrialStarted] = createSignal(false);
- const [relayPaywallTracked, setRelayPaywallTracked] = createSignal(false);
let firstAgentConnectionTracked = false;
- onMount(() => {
- void loadCommercialPosture();
- });
-
- createEffect(() => {
- if (connectedSystems().length > 0 && !relayPaywallTracked()) {
- trackPaywallViewed('relay', 'setup_wizard');
- setRelayPaywallTracked(true);
- }
- });
-
createEffect(() => {
if (props.connectedResourcesOverride !== undefined) {
// Preview scenarios provide a static resource snapshot so browser proof
@@ -235,32 +201,6 @@ Keep these credentials secure!
props.onComplete('/');
};
- const handleStartTrial = async () => {
- trackUpgradeClicked('setup_wizard', 'relay');
- if (trialStarting()) return;
-
- setTrialStarting(true);
- try {
- const outcome = await runStartProTrialAction({
- branded: true,
- successMessage: '14-day Pro trial started! Set up Relay to monitor from your phone.',
- showSuccess,
- showError,
- });
- if (outcome === 'activated') {
- setTrialStarted(true);
- await loadCommercialPosture(true);
- }
- } finally {
- setTrialStarting(false);
- }
- };
-
- const handleSetupRelay = () => {
- props.onComplete(RELAY_SETTINGS_PATH);
- navigate(RELAY_SETTINGS_PATH);
- };
-
const completionViewModel = createMemo(() =>
buildSetupCompletionViewModel(connectedSystems()),
);
@@ -629,92 +569,6 @@ Keep these credentials secure!
</div>
</div>
- <Show when={completionViewModel().hasConnectedSystems}>
- <div class="bg-indigo-50 dark:bg-indigo-900 rounded-md border border-indigo-100 dark:border-indigo-800 p-5 text-left mt-8 overflow-hidden relative">
- <div class="flex items-start gap-4 relative z-10">
- <div class="flex h-12 w-12 items-center justify-center rounded-md bg-indigo-600 text-white shrink-0 border border-indigo-500">
- <svg
- class="w-6 h-6"
- fill="none"
- viewBox="0 0 24 24"
- stroke="currentColor"
- stroke-width="2"
- >
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- d="M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"
- />
- </svg>
- </div>
- <div class="flex-1 min-w-0">
- <h3 class="text-sm font-bold text-base-content mb-1">Monitor from Anywhere</h3>
- <p class="text-xs text-slate-600 dark:text-indigo-200 mb-4 leading-relaxed">
- Get push notifications and manage your infrastructure from your phone with Pulse
- Relay.
- </p>
- <Show
- when={!trialStarted() && !isCommercialTrialActive()}
- fallback={
- <button
- type="button"
- onClick={handleSetupRelay}
- class="inline-flex items-center gap-2 rounded-md bg-indigo-600 hover:bg-indigo-700 px-4 py-2 text-xs font-semibold text-white transition-colors"
- >
- <svg
- class="w-4 h-4"
- fill="none"
- viewBox="0 0 24 24"
- stroke="currentColor"
- stroke-width="2"
- >
- <path
- stroke-linecap="round"
- stroke-linejoin="round"
- d="M13 7l5 5m0 0l-5 5m5-5H6"
- />
- </svg>
- {RELAY_ONBOARDING_SETUP_LABEL}
- </button>
- }
- >
- <button
- type="button"
- onClick={() => void handleStartTrial()}
- disabled={trialStarting()}
- class="inline-flex items-center gap-2 rounded-md bg-indigo-600 hover:bg-indigo-700 px-4 py-2 text-xs font-semibold text-white transition-colors disabled:opacity-50"
- >
- {trialStarting() ? (
- <>
- <svg class="w-4 h-4 animate-spin" fill="none" viewBox="0 0 24 24">
- <circle
- class="opacity-25"
- cx="12"
- cy="12"
- r="10"
- stroke="currentColor"
- stroke-width="4"
- ></circle>
- <path
- class="opacity-75"
- fill="currentColor"
- d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
- ></path>
- </svg>
- {RELAY_ONBOARDING_TRIAL_STARTING_LABEL}
- </>
- ) : (
- RELAY_ONBOARDING_SETUP_WIZARD_TRIAL_LABEL
- )}
- </button>
- </Show>
- <p class="mt-3 text-[10px] text-slate-500 dark:text-indigo-300 font-medium tracking-wide">
- {RELAY_ONBOARDING_TRIAL_HINT}
- </p>
- </div>
- </div>
- </div>
- </Show>
</div>
</div>
);
diff --git a/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.guardrails.test.ts b/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.guardrails.test.ts
index 22ac7a31a4..7260f6bd3b 100644
--- a/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.guardrails.test.ts
+++ b/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.guardrails.test.ts
@@ -4,7 +4,6 @@ import setupCompletionModelSource from '../setupCompletionModel.ts?raw';
describe('SetupCompletionPanel guardrails', () => {
it('keeps setup completion aligned with the canonical infrastructure install workspace', () => {
- expect(setupCompletionPanelSource).toContain("from '@/stores/licenseCommercial';");
expect(setupCompletionPanelSource).toContain(
"const INFRASTRUCTURE_INSTALL_PATH = '/settings/infrastructure/install';",
);
@@ -25,10 +24,13 @@ describe('SetupCompletionPanel guardrails', () => {
);
expect(setupCompletionPanelSource).toContain('Use the Platform connections workspace when:');
expect(setupCompletionPanelSource).toContain('configure TLS and custom CA options');
- expect(setupCompletionPanelSource).toContain('runStartProTrialAction({');
- expect(setupCompletionPanelSource).toContain('await loadCommercialPosture(true);');
- expect(setupCompletionPanelSource).toContain('isCommercialTrialActive');
- expect(setupCompletionPanelSource).not.toContain("commercialPosture()?.subscription_state !== 'trial'");
+ expect(setupCompletionPanelSource).not.toContain("from '@/stores/licenseCommercial';");
+ expect(setupCompletionPanelSource).not.toContain('runStartProTrialAction');
+ expect(setupCompletionPanelSource).not.toContain('loadCommercialPosture');
+ expect(setupCompletionPanelSource).not.toContain('isCommercialTrialActive');
+ expect(setupCompletionPanelSource).not.toContain('Monitor from Anywhere');
+ expect(setupCompletionPanelSource).not.toContain("trackPaywallViewed('relay'");
+ expect(setupCompletionPanelSource).not.toContain("trackUpgradeClicked('setup_wizard'");
expect(setupCompletionPanelSource).not.toContain('getUpgradeActionUrlOrFallback');
});
diff --git a/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.test.tsx b/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.test.tsx
index bfe5f4525b..85ba8ab88e 100644
--- a/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.test.tsx
+++ b/frontend-modern/src/components/SetupWizard/__tests__/SetupCompletionPanel.test.tsx
@@ -5,16 +5,9 @@ import type { WizardState } from '../SetupWizard';
const copyToClipboardMock = vi.fn();
const apiFetchJSONMock = vi.fn();
-const loadLicenseStatusMock = vi.fn();
-const startProTrialMock = vi.fn();
-const showSuccessMock = vi.fn();
-const showErrorMock = vi.fn();
-const navigateMock = vi.fn();
const createObjectURLMock = vi.fn(() => 'blob:mock-url');
const revokeObjectURLMock = vi.fn();
const trackAgentFirstConnectedMock = vi.fn();
-const trackPaywallViewedMock = vi.fn();
-const trackUpgradeClickedMock = vi.fn();
class MockBlob {
readonly parts: string[];
@@ -36,14 +29,6 @@ const getLastDownloadedBlob = (): MockBlob => {
return lastCall![0];
};
-vi.mock('@solidjs/router', async () => {
- const actual = await vi.importActual<typeof import('@solidjs/router')>('@solidjs/router');
- return {
- ...actual,
- useNavigate: () => navigateMock,
- };
-});
-
vi.mock('@/utils/clipboard', () => ({
copyToClipboard: (...args: unknown[]) => copyToClipboardMock(...args),
}));
@@ -56,19 +41,6 @@ vi.mock('@/utils/url', () => ({
getPulseBaseUrl: () => 'https://pulse.example.com',
}));
-vi.mock('@/stores/licenseCommercial', () => ({
- isCommercialTrialActive: () => false,
- loadCommercialPosture: (...args: unknown[]) => loadLicenseStatusMock(...args),
- commercialPosture: () => ({ relay: false }),
- getUpgradeActionUrlOrFallback: () => 'https://pulse.example.com/upgrade',
- startProTrial: (...args: unknown[]) => startProTrialMock(...args),
-}));
-
-vi.mock('@/utils/toast', () => ({
- showSuccess: (...args: unknown[]) => showSuccessMock(...args),
- showError: (...args: unknown[]) => showErrorMock(...args),
-}));
-
vi.mock('@/utils/logger', () => ({
logger: {
error: vi.fn(),
@@ -80,8 +52,6 @@ vi.mock('@/utils/logger', () => ({
vi.mock('@/utils/upgradeMetrics', () => ({
trackAgentFirstConnected: (...args: unknown[]) => trackAgentFirstConnectedMock(...args),
- trackPaywallViewed: (...args: unknown[]) => trackPaywallViewedMock(...args),
- trackUpgradeClicked: (...args: unknown[]) => trackUpgradeClickedMock(...args),
}));
const baseState: WizardState = {
@@ -99,8 +69,6 @@ describe('SetupCompletionPanel', () => {
revokeObjectURL: revokeObjectURLMock,
});
apiFetchJSONMock.mockResolvedValue({ resources: [] });
- loadLicenseStatusMock.mockResolvedValue(undefined);
- startProTrialMock.mockResolvedValue({ outcome: 'noop' });
copyToClipboardMock.mockResolvedValue(true);
});
@@ -458,8 +426,7 @@ describe('SetupCompletionPanel', () => {
).not.toBeInTheDocument();
});
- it('routes relay setup through the canonical settings destination', async () => {
- const onComplete = vi.fn();
+ it('does not surface a Monitor from Anywhere trial CTA in the setup completion panel', async () => {
apiFetchJSONMock.mockResolvedValue({
resources: [
{
@@ -471,22 +438,16 @@ describe('SetupCompletionPanel', () => {
],
});
- render(() => <SetupCompletionPanel state={baseState} onComplete={onComplete} />);
-
- await waitFor(() => {
- expect(screen.getByText('Monitor from Anywhere')).toBeInTheDocument();
- });
-
- fireEvent.click(screen.getByRole('button', { name: 'Start Free Trial & Set Up Mobile' }));
+ render(() => <SetupCompletionPanel state={baseState} onComplete={vi.fn()} />);
await waitFor(() => {
- expect(showSuccessMock).toHaveBeenCalled();
- expect(screen.getByRole('button', { name: 'Set Up Relay' })).toBeInTheDocument();
+ expect(screen.getByText('Connected (1 system)')).toBeInTheDocument();
});
- fireEvent.click(screen.getByRole('button', { name: 'Set Up Relay' }));
-
- expect(onComplete).toHaveBeenCalledWith('/settings/system-relay');
- expect(navigateMock).toHaveBeenCalledWith('/settings/system-relay');
+ expect(screen.queryByText('Monitor from Anywhere')).not.toBeInTheDocument();
+ expect(
+ screen.queryByRole('button', { name: /start free trial/i }),
+ ).not.toBeInTheDocument();
+ expect(screen.queryByRole('button', { name: /set up relay/i })).not.toBeInTheDocument();
});
});
diff --git a/frontend-modern/src/components/shared/ActiveUseTrialNudge.tsx b/frontend-modern/src/components/shared/ActiveUseTrialNudge.tsx
deleted file mode 100644
index af9f689842..0000000000
--- a/frontend-modern/src/components/shared/ActiveUseTrialNudge.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import { Component, Show } from 'solid-js';
-import {
- ACTIVE_USE_TRIAL_NUDGE_SNOOZE_LABEL,
- ACTIVE_USE_TRIAL_NUDGE_STARTING_LABEL,
- ACTIVE_USE_TRIAL_NUDGE_START_LABEL,
- ACTIVE_USE_TRIAL_NUDGE_TITLE,
-} from './activeUseTrialNudgeModel';
-import { useActiveUseTrialNudgeState } from './useActiveUseTrialNudgeState';
-
-export const ActiveUseTrialNudge: Component = () => {
- const state = useActiveUseTrialNudgeState();
-
- return (
- <Show when={state.shouldShow()}>
- <div
- class="mb-2 rounded-md border border-indigo-200 bg-indigo-50 dark:border-indigo-900 dark:bg-indigo-900/30 px-3 py-2 text-sm text-indigo-900 dark:text-indigo-100"
- role="status"
- aria-live="polite"
- >
- <div class="flex flex-wrap items-center justify-between gap-2">
- <span class="font-medium">{ACTIVE_USE_TRIAL_NUDGE_TITLE}</span>
- <div class="flex items-center gap-2">
- <button
- type="button"
- class="text-xs font-semibold text-indigo-700 dark:text-indigo-300 hover:underline disabled:opacity-60"
- disabled={state.startingTrial()}
- onClick={state.handleStartTrial}
- >
- {state.startingTrial()
- ? ACTIVE_USE_TRIAL_NUDGE_STARTING_LABEL
- : ACTIVE_USE_TRIAL_NUDGE_START_LABEL}
- </button>
- <button
- type="button"
- class="text-xs opacity-70 hover:opacity-100"
- onClick={state.handleSnooze}
- >
- {ACTIVE_USE_TRIAL_NUDGE_SNOOZE_LABEL}
- </button>
- </div>
- </div>
- </div>
- </Show>
- );
-};
-
-export default ActiveUseTrialNudge;
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index ff1d8549ed..6c926e4da7 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -4,8 +4,6 @@ import { describe, expect, it } from 'vitest';
import calloutCardSource from '@/components/shared/CalloutCard.tsx?raw';
import commandPaletteModalSource from '@/components/shared/CommandPaletteModal.tsx?raw';
import commandPaletteModelSource from '@/components/shared/commandPaletteModel.ts?raw';
-import activeUseTrialNudgeSource from '@/components/shared/ActiveUseTrialNudge.tsx?raw';
-import activeUseTrialNudgeModelSource from '@/components/shared/activeUseTrialNudgeModel.ts?raw';
import columnPickerSource from '@/components/shared/ColumnPicker.tsx?raw';
import columnPickerModelSource from '@/components/shared/columnPickerModel.ts?raw';
import tagInputSource from '@/components/shared/TagInput.tsx?raw';
@@ -82,7 +80,6 @@ import summaryPanelSource from '@/components/shared/SummaryPanel.tsx?raw';
import summarySynchronizedReadoutSource from '@/components/shared/SummarySynchronizedReadout.tsx?raw';
import tagBadgesSource from '@/components/shared/TagBadges.tsx?raw';
import commandPaletteStateSource from '@/components/shared/useCommandPaletteState.ts?raw';
-import activeUseTrialNudgeStateSource from '@/components/shared/useActiveUseTrialNudgeState.ts?raw';
import columnPickerStateSource from '@/components/shared/useColumnPickerState.ts?raw';
import tagInputStateSource from '@/components/shared/useTagInputState.ts?raw';
import collapsibleSearchInputStateSource from '@/components/shared/useCollapsibleSearchInputState.ts?raw';
@@ -261,30 +258,6 @@ describe('shared primitive guardrails', () => {
expect(storagePoolRowSource).not.toContain('Clear selection');
});
- it('keeps active use trial nudge on shell, runtime, and model owners', () => {
- expect(activeUseTrialNudgeSource).toContain('useActiveUseTrialNudgeState');
- expect(activeUseTrialNudgeSource).toContain('ACTIVE_USE_TRIAL_NUDGE_TITLE');
- expect(activeUseTrialNudgeSource).not.toContain('createSignal');
- expect(activeUseTrialNudgeSource).not.toContain('createMemo');
- expect(activeUseTrialNudgeSource).not.toContain('startProTrial');
- expect(activeUseTrialNudgeSource).not.toContain('localStorage');
- expect(activeUseTrialNudgeSource).not.toContain('setInterval');
-
- expect(activeUseTrialNudgeStateSource).toContain('export function useActiveUseTrialNudgeState');
- expect(activeUseTrialNudgeStateSource).toContain('createSignal');
- expect(activeUseTrialNudgeStateSource).toContain('createMemo');
- expect(activeUseTrialNudgeStateSource).toContain('window.localStorage');
- expect(activeUseTrialNudgeStateSource).toContain('setInterval');
- expect(activeUseTrialNudgeStateSource).toContain('runStartProTrialAction');
- expect(activeUseTrialNudgeStateSource).toContain('snoozeUpsell');
-
- expect(activeUseTrialNudgeModelSource).toContain('ACTIVE_USE_TRIAL_NUDGE_SNOOZE_KEY');
- expect(activeUseTrialNudgeModelSource).toContain('ACTIVE_USE_TRIAL_NUDGE_FIRST_SEEN_KEY');
- expect(activeUseTrialNudgeModelSource).toContain('isActiveUseTrialNudgeEligible');
- expect(activeUseTrialNudgeModelSource).toContain('isActiveUseTrialNudgeOldEnough');
- expect(activeUseTrialNudgeModelSource).toContain('ACTIVE_USE_TRIAL_NUDGE_TITLE');
- });
-
it('keeps shared subtabs as one primitive and leaves shell styling to owning surfaces', () => {
expect(subtabsSource).not.toContain("variant?: 'default' | 'control'");
expect(subtabsSource).not.toContain('subtabsControlShellClass');
diff --git a/frontend-modern/src/components/shared/__tests__/ActiveUseTrialNudge.test.tsx b/frontend-modern/src/components/shared/__tests__/ActiveUseTrialNudge.test.tsx
deleted file mode 100644
index c2f982cee0..0000000000
--- a/frontend-modern/src/components/shared/__tests__/ActiveUseTrialNudge.test.tsx
+++ /dev/null
@@ -1,187 +0,0 @@
-import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
-import { cleanup, fireEvent, render, screen, waitFor } from '@solidjs/testing-library';
-import activeUseTrialNudgeSource from '@/components/shared/ActiveUseTrialNudge.tsx?raw';
-import activeUseTrialNudgeModelSource from '@/components/shared/activeUseTrialNudgeModel.ts?raw';
-import activeUseTrialNudgeStateSource from '@/components/shared/useActiveUseTrialNudgeState.ts?raw';
-import {
- ACTIVE_USE_TRIAL_NUDGE_FIRST_SEEN_KEY,
- ACTIVE_USE_TRIAL_NUDGE_MIN_AGE_MS,
- ACTIVE_USE_TRIAL_NUDGE_SNOOZE_KEY,
-} from '@/components/shared/activeUseTrialNudgeModel';
-
-const {
- commercialPostureMock,
- startProTrialMock,
- showSuccessMock,
- showErrorMock,
- isUpsellSnoozedMock,
- snoozeUpsellMock,
-} = vi.hoisted(() => ({
- commercialPostureMock: vi.fn(),
- startProTrialMock: vi.fn(),
- showSuccessMock: vi.fn(),
- showErrorMock: vi.fn(),
- isUpsellSnoozedMock: vi.fn(),
- snoozeUpsellMock: vi.fn(),
-}));
-
-vi.mock('@/stores/licenseCommercial', () => ({
- canShowActiveUseTrialNudge: () => {
- const posture = commercialPostureMock();
- return Boolean(
- posture &&
- posture.tier === 'free' &&
- posture.subscription_state !== 'trial' &&
- posture.subscription_state !== 'active' &&
- posture.trial_eligible !== false,
- );
- },
- commercialPosture: (...args: unknown[]) => commercialPostureMock(...args),
- startProTrial: (...args: unknown[]) => startProTrialMock(...args),
-}));
-
-vi.mock('@/stores/notifications', () => ({
- notificationStore: {
- success: (...args: unknown[]) => showSuccessMock(...args),
- error: (...args: unknown[]) => showErrorMock(...args),
- },
-}));
-
-vi.mock('@/utils/snooze', () => ({
- isUpsellSnoozed: (...args: unknown[]) => isUpsellSnoozedMock(...args),
- snoozeUpsell: (...args: unknown[]) => snoozeUpsellMock(...args),
-}));
-
-import { ActiveUseTrialNudge } from '@/components/shared/ActiveUseTrialNudge';
-
-function setEligibleFreeLicense() {
- commercialPostureMock.mockReturnValue({
- tier: 'free',
- subscription_state: 'expired',
- trial_eligible: true,
- });
-}
-
-describe('ActiveUseTrialNudge', () => {
- beforeEach(() => {
- localStorage.clear();
- commercialPostureMock.mockReset();
- startProTrialMock.mockReset();
- showSuccessMock.mockReset();
- showErrorMock.mockReset();
- isUpsellSnoozedMock.mockReset();
- snoozeUpsellMock.mockReset();
- isUpsellSnoozedMock.mockReturnValue(false);
- });
-
- afterEach(() => {
- cleanup();
- });
-
- it('keeps active use trial nudge on shell, runtime, and model owners', () => {
- expect(activeUseTrialNudgeSource).toContain('useActiveUseTrialNudgeState');
- expect(activeUseTrialNudgeSource).toContain('ACTIVE_USE_TRIAL_NUDGE_TITLE');
- expect(activeUseTrialNudgeSource).not.toContain('createSignal');
- expect(activeUseTrialNudgeSource).not.toContain('createMemo');
- expect(activeUseTrialNudgeSource).not.toContain('startProTrial');
- expect(activeUseTrialNudgeSource).not.toContain('localStorage');
- expect(activeUseTrialNudgeSource).not.toContain('setInterval');
-
- expect(activeUseTrialNudgeStateSource).toContain('export function useActiveUseTrialNudgeState');
- expect(activeUseTrialNudgeStateSource).toContain('createSignal');
- expect(activeUseTrialNudgeStateSource).toContain('createMemo');
- expect(activeUseTrialNudgeStateSource).toContain('window.localStorage');
- expect(activeUseTrialNudgeStateSource).toContain('setInterval');
- expect(activeUseTrialNudgeStateSource).toContain('canShowActiveUseTrialNudge');
- expect(activeUseTrialNudgeStateSource).not.toContain('commercialPosture()');
- expect(activeUseTrialNudgeStateSource).toContain('runStartProTrialAction');
- expect(activeUseTrialNudgeStateSource).not.toContain('startProTrial()');
- expect(activeUseTrialNudgeStateSource).toContain('snoozeUpsell');
-
- expect(activeUseTrialNudgeModelSource).toContain('ACTIVE_USE_TRIAL_NUDGE_SNOOZE_KEY');
- expect(activeUseTrialNudgeModelSource).toContain('ACTIVE_USE_TRIAL_NUDGE_FIRST_SEEN_KEY');
- expect(activeUseTrialNudgeModelSource).toContain('isActiveUseTrialNudgeEligible');
- expect(activeUseTrialNudgeModelSource).toContain('isActiveUseTrialNudgeOldEnough');
- expect(activeUseTrialNudgeModelSource).toContain('ACTIVE_USE_TRIAL_NUDGE_TITLE');
- });
-
- it('renders for eligible free users after the minimum active age', async () => {
- setEligibleFreeLicense();
- localStorage.setItem(
- ACTIVE_USE_TRIAL_NUDGE_FIRST_SEEN_KEY,
- String(Date.now() - ACTIVE_USE_TRIAL_NUDGE_MIN_AGE_MS - 1),
- );
-
- render(() => <ActiveUseTrialNudge />);
-
- expect(await screen.findByRole('status')).toBeInTheDocument();
- expect(screen.getByText('Experience the full power of Pulse — start your free trial')).toBeInTheDocument();
- expect(screen.getByRole('button', { name: 'Start 14-day trial' })).toBeInTheDocument();
- });
-
- it('does not render before the active age threshold is crossed', () => {
- setEligibleFreeLicense();
- render(() => <ActiveUseTrialNudge />);
-
- expect(screen.queryByRole('status')).toBeNull();
- expect(localStorage.getItem(ACTIVE_USE_TRIAL_NUDGE_FIRST_SEEN_KEY)).not.toBeNull();
- });
-
- it('snoozes and hides the nudge', async () => {
- setEligibleFreeLicense();
- localStorage.setItem(
- ACTIVE_USE_TRIAL_NUDGE_FIRST_SEEN_KEY,
- String(Date.now() - ACTIVE_USE_TRIAL_NUDGE_MIN_AGE_MS - 1),
- );
-
- render(() => <ActiveUseTrialNudge />);
-
- fireEvent.click(await screen.findByRole('button', { name: 'Snooze 7d' }));
-
- expect(snoozeUpsellMock).toHaveBeenCalledWith(ACTIVE_USE_TRIAL_NUDGE_SNOOZE_KEY);
- await waitFor(() => {
- expect(screen.queryByRole('status')).toBeNull();
- });
- });
-
- it('starts a trial successfully and shows a success notification', async () => {
- setEligibleFreeLicense();
- startProTrialMock.mockResolvedValue({ outcome: 'activated' });
- localStorage.setItem(
- ACTIVE_USE_TRIAL_NUDGE_FIRST_SEEN_KEY,
- String(Date.now() - ACTIVE_USE_TRIAL_NUDGE_MIN_AGE_MS - 1),
- );
-
- render(() => <ActiveUseTrialNudge />);
-
- fireEvent.click(await screen.findByRole('button', { name: 'Start 14-day trial' }));
-
- await waitFor(() => {
- expect(startProTrialMock).toHaveBeenCalledTimes(1);
- });
- expect(showSuccessMock).toHaveBeenCalledWith('Pro trial started');
- });
-
- it('shows retry-after guidance when trial start is rate limited', async () => {
- setEligibleFreeLicense();
- startProTrialMock.mockRejectedValue(
- Object.assign(new Error('rate limited'), {
- status: 429,
- retryAfterSeconds: 120,
- }),
- );
- localStorage.setItem(
- ACTIVE_USE_TRIAL_NUDGE_FIRST_SEEN_KEY,
- String(Date.now() - ACTIVE_USE_TRIAL_NUDGE_MIN_AGE_MS - 1),
- );
-
- render(() => <ActiveUseTrialNudge />);
-
- fireEvent.click(await screen.findByRole('button', { name: 'Start 14-day trial' }));
-
- await waitFor(() => {
- expect(startProTrialMock).toHaveBeenCalledTimes(1);
- });
- expect(showErrorMock).toHaveBeenCalledWith('Try again in about 2 minutes');
- });
-});
diff --git a/frontend-modern/src/components/shared/activeUseTrialNudgeModel.ts b/frontend-modern/src/components/shared/activeUseTrialNudgeModel.ts
deleted file mode 100644
index e26630057c..0000000000
--- a/frontend-modern/src/components/shared/activeUseTrialNudgeModel.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-import type { LicenseCommercialPosture } from '@/api/license';
-
-export const ACTIVE_USE_TRIAL_NUDGE_SNOOZE_KEY = 'pulse_active_use_nudge_snoozed';
-export const ACTIVE_USE_TRIAL_NUDGE_FIRST_SEEN_KEY = 'pulse_first_seen_ts';
-export const ACTIVE_USE_TRIAL_NUDGE_MIN_AGE_MS = 7 * 24 * 60 * 60 * 1000;
-export const ACTIVE_USE_TRIAL_NUDGE_REFRESH_MS = 60 * 60 * 1000;
-
-export const ACTIVE_USE_TRIAL_NUDGE_TITLE =
- 'Experience the full power of Pulse — start your free trial';
-export const ACTIVE_USE_TRIAL_NUDGE_START_LABEL = 'Start 14-day trial';
-export const ACTIVE_USE_TRIAL_NUDGE_STARTING_LABEL = 'Starting...';
-export const ACTIVE_USE_TRIAL_NUDGE_SNOOZE_LABEL = 'Snooze 7d';
-
-export function isActiveUseTrialNudgeEligible(
- entitlements: LicenseCommercialPosture | null | undefined,
-): boolean {
- if (!entitlements) return false;
-
- return (
- entitlements.tier === 'free' &&
- entitlements.subscription_state !== 'trial' &&
- entitlements.subscription_state !== 'active' &&
- entitlements.trial_eligible !== false
- );
-}
-
-export function isActiveUseTrialNudgeOldEnough(now: number, firstSeen: number): boolean {
- return now - firstSeen >= ACTIVE_USE_TRIAL_NUDGE_MIN_AGE_MS;
-}
diff --git a/frontend-modern/src/components/shared/useActiveUseTrialNudgeState.ts b/frontend-modern/src/components/shared/useActiveUseTrialNudgeState.ts
deleted file mode 100644
index 7f2ac02fbb..0000000000
--- a/frontend-modern/src/components/shared/useActiveUseTrialNudgeState.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-import { createMemo, createSignal, onCleanup, onMount } from 'solid-js';
-import { canShowActiveUseTrialNudge } from '@/stores/licenseCommercial';
-import { notificationStore } from '@/stores/notifications';
-import { isUpsellSnoozed, snoozeUpsell } from '@/utils/snooze';
-import { runStartProTrialAction } from '@/utils/trialStartAction';
-import {
- ACTIVE_USE_TRIAL_NUDGE_FIRST_SEEN_KEY,
- ACTIVE_USE_TRIAL_NUDGE_REFRESH_MS,
- ACTIVE_USE_TRIAL_NUDGE_SNOOZE_KEY,
- isActiveUseTrialNudgeOldEnough,
-} from './activeUseTrialNudgeModel';
-
-function getActiveUseTrialNudgeFirstSeenTimestamp(): number {
- if (typeof window === 'undefined') return Date.now();
-
- try {
- const raw = window.localStorage.getItem(ACTIVE_USE_TRIAL_NUDGE_FIRST_SEEN_KEY);
- if (raw) {
- const timestamp = Number(raw);
- if (Number.isFinite(timestamp) && timestamp > 0) return timestamp;
- }
-
- const now = Date.now();
- window.localStorage.setItem(ACTIVE_USE_TRIAL_NUDGE_FIRST_SEEN_KEY, String(now));
- return now;
- } catch {
- return Date.now();
- }
-}
-
-export function useActiveUseTrialNudgeState() {
- const [snoozed, setSnoozed] = createSignal(
- isUpsellSnoozed(ACTIVE_USE_TRIAL_NUDGE_SNOOZE_KEY),
- );
- const [firstSeen, setFirstSeen] = createSignal(Date.now());
- const [now, setNow] = createSignal(Date.now());
- const [startingTrial, setStartingTrial] = createSignal(false);
-
- onMount(() => {
- setFirstSeen(getActiveUseTrialNudgeFirstSeenTimestamp());
- const timer = window.setInterval(() => setNow(Date.now()), ACTIVE_USE_TRIAL_NUDGE_REFRESH_MS);
- onCleanup(() => window.clearInterval(timer));
- });
-
- const shouldShow = createMemo(() => {
- return (
- isActiveUseTrialNudgeOldEnough(now(), firstSeen()) &&
- canShowActiveUseTrialNudge() &&
- !snoozed()
- );
- });
-
- const handleSnooze = () => {
- snoozeUpsell(ACTIVE_USE_TRIAL_NUDGE_SNOOZE_KEY);
- setSnoozed(true);
- };
-
- const handleStartTrial = async () => {
- if (startingTrial()) return;
-
- setStartingTrial(true);
- try {
- await runStartProTrialAction({
- branded: true,
- showSuccess: notificationStore.success,
- showError: notificationStore.error,
- });
- } finally {
- setStartingTrial(false);
- }
- };
-
- return {
- handleSnooze,
- handleStartTrial,
- shouldShow,
- startingTrial,
- };
-}
diff --git a/frontend-modern/src/pages/Dashboard.tsx b/frontend-modern/src/pages/Dashboard.tsx
index 1c60254078..71137ddb7c 100644
--- a/frontend-modern/src/pages/Dashboard.tsx
+++ b/frontend-modern/src/pages/Dashboard.tsx
@@ -31,7 +31,6 @@ import {
TrendCharts,
} from '@/features/dashboardOverview';
import { RecentAlertsPanel } from '@/components/Alerts/RecentAlertsPanel';
-import { RelayOnboardingCard } from '@/components/Dashboard/RelayOnboardingCard';
import { DashboardRecoveryStatusPanel } from '@/components/Recovery/DashboardRecoveryStatusPanel';
import { DashboardStoragePanel } from '@/components/Storage/DashboardStoragePanel';
import { PageHeader } from '@/components/shared/PageHeader';
@@ -278,8 +277,6 @@ export default function Dashboard() {
<Match when={initialLoadComplete() && hasCachedData()}>
<section class="space-y-5">
- <RelayOnboardingCard />
-
{/* 1. Action Required Panel — only when actions exist */}
<ActionRequiredPanel
pendingApprovals={actions.pendingApprovals()}
diff --git a/frontend-modern/src/pages/__tests__/DashboardPage.test.tsx b/frontend-modern/src/pages/__tests__/DashboardPage.test.tsx
index f6ca0cf254..966f64cd41 100644
--- a/frontend-modern/src/pages/__tests__/DashboardPage.test.tsx
+++ b/frontend-modern/src/pages/__tests__/DashboardPage.test.tsx
@@ -11,7 +11,6 @@ let wsConnected = true;
let wsReconnecting = false;
const reconnectSpy = vi.fn();
const navigateSpy = vi.hoisted(() => vi.fn());
-const relayOnboardingCardSpy = vi.hoisted(() => vi.fn(() => <div data-testid="relay-onboarding-card" />));
const recoverySummaryMock: DashboardRecoverySummary = {
totalProtected: 3,
byOutcome: { success: 2, failed: 1 },
@@ -111,10 +110,6 @@ vi.mock('@/hooks/useDashboardRecovery', () => ({
useDashboardRecovery: () => () => recoverySummaryMock,
}));
-vi.mock('@/components/Dashboard/RelayOnboardingCard', () => ({
- RelayOnboardingCard: relayOnboardingCardSpy,
-}));
-
describe('Dashboard page module contract', () => {
beforeEach(() => {
overviewLoading = false;
@@ -123,7 +118,6 @@ describe('Dashboard page module contract', () => {
wsReconnecting = false;
reconnectSpy.mockReset();
navigateSpy.mockReset();
- relayOnboardingCardSpy.mockClear();
overviewMock.health.totalResources = 0;
overviewMock.storage.total = 0;
overviewMock.storage.totalCapacity = 0;
@@ -145,11 +139,11 @@ describe('Dashboard page module contract', () => {
it('routes dashboard overview panels through the dashboard overview feature owner', () => {
expect(dashboardPageSource).toContain("from '@/features/dashboardOverview'");
- expect(dashboardPageSource).toContain("from '@/components/Dashboard/RelayOnboardingCard'");
+ expect(dashboardPageSource).not.toContain("from '@/components/Dashboard/RelayOnboardingCard'");
expect(dashboardPageSource).toContain("from '@/components/shared/PageHeader'");
expect(dashboardPageSource).toContain('<PageHeader');
expect(dashboardPageSource).toContain('title="Dashboard"');
- expect(dashboardPageSource).toContain('<RelayOnboardingCard />');
+ expect(dashboardPageSource).not.toContain('<RelayOnboardingCard />');
expect(dashboardPageSource).toContain(
'ActionRequiredPanel,\n DashboardCustomizer,\n KPIStrip,\n ProblemResourcesTable,\n TrendCharts,',
);
@@ -183,7 +177,6 @@ describe('Dashboard page module contract', () => {
expect(screen.getByRole('heading', { name: 'Dashboard' })).toBeInTheDocument();
expect(screen.getByRole('heading', { name: 'No resources yet' })).toBeInTheDocument();
- expect(screen.queryByTestId('relay-onboarding-card')).toBeNull();
expect(
screen.getByText(
'Start by opening Settings → Infrastructure → Install on a host and connecting the first system you want Pulse to monitor. Your dashboard overview will appear here once that system starts reporting.',
@@ -205,7 +198,7 @@ describe('Dashboard page module contract', () => {
render(() => <DashboardPage />);
- expect(screen.getByTestId('relay-onboarding-card')).toBeInTheDocument();
+ expect(screen.queryByTestId('relay-onboarding-card')).toBeNull();
expect(screen.getByRole('heading', { name: 'Recovery Status' })).toBeInTheDocument();
expect(screen.getByRole('heading', { name: /Storage/ })).toBeInTheDocument();
expect(screen.getByText('Last recovery point over 24 hours ago')).toBeInTheDocument();
diff --git a/frontend-modern/src/stores/licenseCommercial.ts b/frontend-modern/src/stores/licenseCommercial.ts
index 26b901d72c..eb7133b766 100644
--- a/frontend-modern/src/stores/licenseCommercial.ts
+++ b/frontend-modern/src/stores/licenseCommercial.ts
@@ -244,17 +244,6 @@ export function commercialOverflowDaysRemaining(): number | null {
return typeof current === 'number' && Number.isFinite(current) ? current : null;
}
-export function canShowActiveUseTrialNudge(): boolean {
- const current = commercialPostureState();
- if (!current) return false;
- return (
- current.tier === 'free' &&
- current.subscription_state !== 'trial' &&
- current.subscription_state !== 'active' &&
- current.trial_eligible !== false
- );
-}
-
export function getUpgradeReason(key: string) {
const current = commercialPostureState();
if (!current?.upgrade_reasons?.length) return undefined;
diff --git a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
index dc50ab24e3..0b2442b62d 100644
--- a/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
+++ b/frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts
@@ -10,8 +10,6 @@ import alertTargetTypesSource from '@/utils/alertTargetTypes.ts?raw';
import resourceBadgesSource from '@/components/Infrastructure/resourceBadges.ts?raw';
import commandPaletteModalSource from '@/components/shared/CommandPaletteModal.tsx?raw';
import commandPaletteModelSource from '@/components/shared/commandPaletteModel.ts?raw';
-import activeUseTrialNudgeSource from '@/components/shared/ActiveUseTrialNudge.tsx?raw';
-import activeUseTrialNudgeModelSource from '@/components/shared/activeUseTrialNudgeModel.ts?raw';
import columnPickerSource from '@/components/shared/ColumnPicker.tsx?raw';
import columnPickerModelSource from '@/components/shared/columnPickerModel.ts?raw';
import tagInputSource from '@/components/shared/TagInput.tsx?raw';
@@ -72,7 +70,6 @@ import selectionCardGroupSource from '@/components/shared/SelectionCardGroup.tsx
import selectionCardGroupModelSource from '@/components/shared/selectionCardGroupModel.ts?raw';
import sharedInfrastructureSummaryTableModelSource from '@/components/shared/infrastructureSummaryTableModel.ts?raw';
import commandPaletteStateSource from '@/components/shared/useCommandPaletteState.ts?raw';
-import activeUseTrialNudgeStateSource from '@/components/shared/useActiveUseTrialNudgeState.ts?raw';
import columnPickerStateSource from '@/components/shared/useColumnPickerState.ts?raw';
import tagInputStateSource from '@/components/shared/useTagInputState.ts?raw';
import collapsibleSearchInputStateSource from '@/components/shared/useCollapsibleSearchInputState.ts?raw';
@@ -330,7 +327,6 @@ import k8sNamespacePresentationSource from '@/utils/k8sNamespacePresentation.ts?
import k8sStatusPresentationSource from '@/utils/k8sStatusPresentation.ts?raw';
import raidCardSource from '@/components/shared/cards/RaidCard.tsx?raw';
import raidPresentationSource from '@/utils/raidPresentation.ts?raw';
-import relayOnboardingCardSource from '@/components/Dashboard/RelayOnboardingCard.tsx?raw';
import proLicensePanelSource from '@/components/Settings/ProLicensePanel.tsx?raw';
import proLicensePlanSectionSource from '@/components/Settings/ProLicensePlanSection.tsx?raw';
import securityPostureSummarySource from '@/components/Settings/SecurityPostureSummary.tsx?raw';
@@ -410,7 +406,6 @@ import storageDomainSource from '@/features/storageBackups/storageDomain.ts?raw'
import storagePoolDetailPresentationSource from '@/features/storageBackups/storagePoolDetailPresentation.ts?raw';
import storageBarPresentationSource from '@/features/storageBackups/storageBarPresentation.ts?raw';
import storagePagePresentationSource from '@/features/storageBackups/storagePagePresentation.ts?raw';
-import relayOnboardingCardStateSource from '@/components/Dashboard/useRelayOnboardingCardState.ts?raw';
import proLicensePanelStateSource from '@/components/Settings/useProLicensePanelState.ts?raw';
import storagePageStatusSource from '@/features/storageBackups/storagePageStatus.ts?raw';
import storageRowPresentationSource from '@/features/storageBackups/rowPresentation.ts?raw';
@@ -1557,17 +1552,6 @@ describe('frontend resource type boundaries', () => {
expect(organizationBillingStateSource).toContain('@/utils/organizationSettingsPresentation');
expect(billingAdminPanelSource).toContain('./useBillingAdminPanelState');
expect(billingAdminPanelSource).toContain('./BillingAdminOrganizationsTable');
- expect(relayOnboardingCardSource).toContain('./useRelayOnboardingCardState');
- expect(relayOnboardingCardSource).toContain('presentationPolicyHidesCommercialSurfaces');
- expect(relayOnboardingCardSource).toContain(
- '!presentationPolicyHidesCommercialSurfaces() || state.hasRelay()',
- );
- expect(relayOnboardingCardSource).not.toContain('createSignal(');
- expect(relayOnboardingCardSource).not.toContain('RelayAPI.getStatus()');
- expect(relayOnboardingCardStateSource).toContain('RelayAPI.getStatus()');
- expect(relayOnboardingCardStateSource).toContain('loadRuntimeCapabilities()');
- expect(relayOnboardingCardStateSource).toContain('runStartProTrialAction({');
- expect(relayOnboardingCardStateSource).not.toContain('startProTrial()');
expect(organizationBillingPanelSource).not.toContain('normalizeOrgScope(getOrgID())');
expect(organizationBillingPanelSource).not.toContain('createSignal(');
expect(billingAdminPanelSource).not.toContain('createSignal(');
@@ -2528,7 +2512,7 @@ describe('frontend resource type boundaries', () => {
expect(proLicensePlanSectionSource).toContain('getLicenseStatusLoadingState');
expect(proLicensePlanSectionSource).toContain('getNoActiveProLicenseState');
expect(proLicensePlanSectionSource).toContain('getTrialEndedProLicenseNotice');
- expect(proLicensePlanSectionSource).toContain('getInactiveProUpsellNotice');
+ expect(proLicensePlanSectionSource).not.toContain('getInactiveProUpsellNotice');
expect(proLicensePanelSource).not.toContain('Loading license status...');
expect(proLicensePanelSource).not.toContain('No Pro license is active.');
expect(proLicensePanelSource).not.toContain('const statusLabel =');
@@ -2833,24 +2817,6 @@ describe('frontend resource type boundaries', () => {
expect(searchTipsPopoverModelSource).toContain('getSearchTipsPopoverPositionClass');
expect(searchTipsPopoverModelSource).toContain('getSearchTipsPopoverTriggerVariant');
expect(searchTipsPopoverModelSource).toContain('shouldSearchTipsPopoverOpenOnHover');
- expect(activeUseTrialNudgeSource).toContain('useActiveUseTrialNudgeState');
- expect(activeUseTrialNudgeSource).toContain('ACTIVE_USE_TRIAL_NUDGE_TITLE');
- expect(activeUseTrialNudgeSource).not.toContain('createSignal');
- expect(activeUseTrialNudgeSource).not.toContain('createMemo');
- expect(activeUseTrialNudgeSource).not.toContain('startProTrial');
- expect(activeUseTrialNudgeSource).not.toContain('localStorage');
- expect(activeUseTrialNudgeSource).not.toContain('setInterval');
- expect(activeUseTrialNudgeStateSource).toContain('createSignal');
- expect(activeUseTrialNudgeStateSource).toContain('createMemo');
- expect(activeUseTrialNudgeStateSource).toContain('window.localStorage');
- expect(activeUseTrialNudgeStateSource).toContain('setInterval');
- expect(activeUseTrialNudgeStateSource).toContain('runStartProTrialAction');
- expect(activeUseTrialNudgeStateSource).toContain('snoozeUpsell');
- expect(activeUseTrialNudgeModelSource).toContain('ACTIVE_USE_TRIAL_NUDGE_SNOOZE_KEY');
- expect(activeUseTrialNudgeModelSource).toContain('ACTIVE_USE_TRIAL_NUDGE_FIRST_SEEN_KEY');
- expect(activeUseTrialNudgeModelSource).toContain('isActiveUseTrialNudgeEligible');
- expect(activeUseTrialNudgeModelSource).toContain('isActiveUseTrialNudgeOldEnough');
- expect(activeUseTrialNudgeModelSource).toContain('ACTIVE_USE_TRIAL_NUDGE_TITLE');
expect(trialBannerSource).toContain('useTrialBannerState');
expect(trialBannerSource).toContain('TRIAL_BANNER_TITLE');
expect(trialBannerSource).not.toContain('createSignal');
diff --git a/scripts/release_control/internal/relay_registration_reconnect_drain_proof.py b/scripts/release_control/internal/relay_registration_reconnect_drain_proof.py
index 79440d6547..47b373c197 100644
--- a/scripts/release_control/internal/relay_registration_reconnect_drain_proof.py
+++ b/scripts/release_control/internal/relay_registration_reconnect_drain_proof.py
@@ -88,7 +88,6 @@ def build_command_specs(args: argparse.Namespace) -> list[CommandSpec]:
"npx",
"vitest",
"run",
- "src/components/Dashboard/__tests__/RelayOnboardingCard.test.tsx",
"src/components/Settings/__tests__/RelaySettingsPanel.runtime.test.tsx",
"src/components/Settings/__tests__/settingsReadOnlyPanels.test.tsx",
],
diff --git a/scripts/release_control/subsystem_lookup_test.py b/scripts/release_control/subsystem_lookup_test.py
index eee1b3adbc..cb6602d64e 100644
--- a/scripts/release_control/subsystem_lookup_test.py
+++ b/scripts/release_control/subsystem_lookup_test.py
@@ -711,27 +711,6 @@ class SubsystemLookupTest(unittest.TestCase):
"relay-frontend-surfaces",
)
- def test_lookup_paths_assigns_relay_onboarding_state_owner_to_cloud_paid(self) -> None:
- result = lookup_paths(["frontend-modern/src/components/Dashboard/useRelayOnboardingCardState.ts"])
- self.assertEqual(result["unowned_runtime_files"], [])
- self.assertEqual(
- {item["subsystem"] for item in result["impacted_subsystems"]},
- {"cloud-paid"},
- )
- file_entry = result["files"][0]
- self.assertEqual(file_entry["classification"], "runtime")
- self.assertEqual(
- {match["subsystem"] for match in file_entry["matches"]},
- {"cloud-paid"},
- )
- match = file_entry["matches"][0]
- self.assertEqual(match["contract"], "docs/release-control/v6/internal/subsystems/cloud-paid.md")
- self.assertEqual(match["lane_context"]["lane_id"], "L3")
- self.assertEqual(
- match["verification_requirement"]["id"],
- "relay-frontend-surfaces",
- )
-
def test_lookup_paths_assigns_recovery_route_to_storage_recovery(self) -> None:
result = lookup_paths(["frontend-modern/src/pages/RecoveryRoute.tsx"])
self.assertEqual(result["unowned_runtime_files"], [])
diff --git a/tests/integration/tests/59-dashboard-relay-onboarding-trial-rate-limit.spec.ts b/tests/integration/tests/59-dashboard-relay-onboarding-trial-rate-limit.spec.ts
deleted file mode 100644
index 3f775debea..0000000000
--- a/tests/integration/tests/59-dashboard-relay-onboarding-trial-rate-limit.spec.ts
+++ /dev/null
@@ -1,91 +0,0 @@
-import { expect, test, type Page } from '@playwright/test';
-import { ensureAuthenticated, getMockMode, setMockMode } from './helpers';
-
-const FREE_RUNTIME_CAPABILITIES = {
- capabilities: ['update_alerts', 'sso', 'ai_patrol'],
- limits: [],
- hosted_mode: false,
- max_history_days: 7,
-};
-
-async function waitForDashboardReady(page: Page) {
- await expect(page).toHaveURL(/\/dashboard(?:\?.*)?$/);
- await expect(page.getByTestId('dashboard-page')).toBeVisible();
- await page.waitForFunction(
- () => !document.querySelector('[data-testid="dashboard-loading"]'),
- undefined,
- { timeout: 30_000 },
- );
-}
-
-test.describe.serial('Dashboard relay onboarding trial rate limit', () => {
- test('shows Retry-After guidance on the live dashboard relay onboarding CTA', async ({
- page,
- }, testInfo) => {
- test.skip(
- testInfo.project.name.startsWith('mobile-'),
- 'Desktop-only dashboard relay onboarding coverage',
- );
-
- await page.route('**/api/license/runtime-capabilities', async (route) => {
- await route.fulfill({
- status: 200,
- contentType: 'application/json',
- body: JSON.stringify(FREE_RUNTIME_CAPABILITIES),
- });
- });
-
- await page.route('**/api/license/trial/start', async (route) => {
- await route.fulfill({
- status: 429,
- headers: {
- 'Content-Type': 'application/json',
- 'Retry-After': '120',
- },
- body: JSON.stringify({
- code: 'trial_rate_limited',
- error: 'Trial start rate limit exceeded',
- details: {
- retry_after_seconds: '45',
- },
- }),
- });
- });
-
- await ensureAuthenticated(page);
-
- let initialMockMode: { enabled: boolean } | null = null;
- try {
- initialMockMode = await getMockMode(page);
- if (!initialMockMode.enabled) {
- await setMockMode(page, true);
- }
- } catch (error) {
- console.warn(`[relay-onboarding] unable to read/set mock mode: ${String(error)}`);
- }
-
- try {
- await page.goto('/dashboard');
- await waitForDashboardReady(page);
-
- await expect(page.getByRole('heading', { name: 'Pair Your Mobile Device' })).toBeVisible();
-
- const startTrialButton = page.getByRole('button', { name: /or start a pro trial/i });
- await expect(startTrialButton).toBeVisible();
- await startTrialButton.click();
-
- await expect(page.getByText('Try again in about 2 minutes')).toBeVisible();
- await expect(page.getByText('Try again in about a minute')).toHaveCount(0);
- } finally {
- if (initialMockMode && !initialMockMode.enabled) {
- try {
- await setMockMode(page, false);
- } catch (error) {
- console.warn(
- `[relay-onboarding] unable to restore mock mode, continuing: ${String(error)}`,
- );
- }
- }
- }
- });
-});