Skip to content

Commit 09b7b36

Browse files
Dumbrisclaude
andauthored
fix(wizard): record per-step completion/skip for Spec 046 funnel (#448)
The first-run wizard only ever called markEngaged() on dismiss — it never invoked markConnectCompleted/Skipped or markServerCompleted/ Skipped. Production telemetry (D1) confirmed the gap: every install that engaged the wizard recorded wizard_engaged=true with wizard_connect_step / wizard_server_step still NULL, making the funnel queries documented in Spec 046 SC-012/SC-013 unusable. Wire the four missing call sites: - connectOne() success → markConnectCompleted() - onServerAdded() (single) → markServerCompleted() - onBulkImport() (>0 imported) → markServerCompleted() - dismiss() → mark each unfilled step as skipped before markEngaged Each guarded against re-firing once a status is recorded. Backend, storage, telemetry payload, and worker schema were already correct; the bug was purely in the frontend wiring. Co-authored-by: Claude Code <noreply@anthropic.com>
1 parent 4bf17a0 commit 09b7b36

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

frontend/src/components/OnboardingWizard.vue

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,10 @@ async function onBulkImport(quarantine: boolean) {
936936
if (quarantine && totalImported > 0) msg += '. Approve from the Servers page.'
937937
selectionImportMessage.value = msg
938938
selection.value = new Set()
939+
// Spec 046 — bulk-import counts as completing the server step.
940+
if (totalImported > 0 && onboarding.state?.state.server_step_status !== 'completed') {
941+
await onboarding.markServerCompleted()
942+
}
939943
systemStore.addToast({
940944
type: 'success',
941945
title: 'Import complete',
@@ -1013,6 +1017,12 @@ async function connectOne(clientId: string) {
10131017
connectMessageOk.value = true
10141018
connectMessage.value = res.data.message || `Connected ${clientId}`
10151019
await fetchClients()
1020+
// Spec 046 — record connect-step completion for telemetry funnel.
1021+
// Only the first successful connect transitions the status; subsequent
1022+
// calls are no-ops on the backend.
1023+
if (onboarding.state?.state.connect_step_status !== 'completed') {
1024+
await onboarding.markConnectCompleted()
1025+
}
10161026
await onboarding.fetchState()
10171027
systemStore.addToast({
10181028
type: 'success',
@@ -1038,6 +1048,10 @@ function openAddServer() {
10381048
async function onServerAdded() {
10391049
addServerOpen.value = false
10401050
serverAddedJustNow.value = true
1051+
// Spec 046 — record server-step completion for telemetry funnel.
1052+
if (onboarding.state?.state.server_step_status !== 'completed') {
1053+
await onboarding.markServerCompleted()
1054+
}
10411055
await Promise.all([
10421056
serversStore.fetchServers(),
10431057
onboarding.fetchState(),
@@ -1054,6 +1068,16 @@ async function dismiss() {
10541068
// we don't auto-popup again. The sidebar Setup entry remains visible so
10551069
// the user can return.
10561070
if (!onboarding.isEngaged) {
1071+
// Spec 046 — any step the user never advanced through counts as "skipped"
1072+
// so the funnel (engaged - completed - skipped) reconciles to engaged
1073+
// total. Per-step calls are no-ops if a status is already recorded.
1074+
const stepState = onboarding.state?.state
1075+
if (stepState && !stepState.connect_step_status) {
1076+
await onboarding.markConnectSkipped()
1077+
}
1078+
if (stepState && !stepState.server_step_status) {
1079+
await onboarding.markServerSkipped()
1080+
}
10571081
await onboarding.markEngaged()
10581082
}
10591083
emit('close')

0 commit comments

Comments
 (0)