diff --git a/app/electron/main.ts b/app/electron/main.ts index bf718a80..1711a111 100644 --- a/app/electron/main.ts +++ b/app/electron/main.ts @@ -5,7 +5,7 @@ import os from 'node:os' import path from 'node:path' import { CliError, DESKTOP_COLD_TIMEOUT_MS, PROGRESS_LINE_PREFIX, reapOrphanServe, resolveCodeburnPath, shutdownAll, spawnCli, spawnCliAction, startServe, type ActionResult, type SpawnPriority } from './cli' -import { MenubarCompanion, STARTUP_APPS_SETTINGS_URL, type CompanionStatus } from './menubar' +import { MenubarCompanion, readDockEnabled, STARTUP_APPS_SETTINGS_URL, type CompanionStatus } from './menubar' import { MacMenubar, NO_MAC_MENUBAR, type InstallPhase } from './mac-menubar' import { getQuota, sanitizeError } from './quota' import { Telemetry } from './telemetry' @@ -1080,8 +1080,12 @@ function bootstrap(): void { appVersion: app.getVersion(), }) // completeOnboarding tracks the first app_open itself; only already- - // onboarded installs record subsequent opens here. - if (telemetryInstance.status().onboarded) telemetryInstance.track('app_open', {}) + // onboarded installs record subsequent opens here. app_open carries the + // Capacity Dock state (on/off/none) so dock adoption is measurable. + if (telemetryInstance.status().onboarded) { + const dockPref = readDockEnabled() + telemetryInstance.track('app_open', { dock: dockPref === undefined ? 'none' : dockPref ? 'on' : 'off' }) + } setInterval(() => { void telemetryInstance?.flush() }, 5 * 60_000) } catch (err) { console.error('telemetry init failed (continuing without):', err) diff --git a/app/renderer/App.tsx b/app/renderer/App.tsx index a81f6d3f..e50b77d8 100644 --- a/app/renderer/App.tsx +++ b/app/renderer/App.tsx @@ -4,7 +4,6 @@ import { isColdHydrating } from './components/CliErrorPanel' import { EmptyNote } from './components/EmptyState' import { ErrorBoundary } from './components/ErrorBoundary' import { Hint } from './components/Hint' -import { Onboarding } from './components/Onboarding' import { Panel } from './components/Panel' import { Sidebar, type Section } from './components/Sidebar' import { Splash } from './components/Splash' @@ -55,7 +54,7 @@ import { Plans } from './sections/Plans' import { Settings, type SettingsPane } from './sections/Settings' import { SpendContent } from './sections/Spend' import { PluginsSection } from './sections/Plugins' -import type { DateRange, MenubarPayload, ModelReportRow, Period, Scope, TelemetryStatus } from './lib/types' +import type { DateRange, MenubarPayload, ModelReportRow, Period, Scope } from './lib/types' import { Icon } from './components/icons' // Bucket raw dollar amounts before they leave the machine: telemetry carries @@ -514,19 +513,19 @@ function AppMain() { if (overview.data != null || (overview.error != null && !overviewCold)) setReady(true) }, [overview.data, overview.error, overviewCold]) - // First-launch onboarding: shown until the telemetry consent screen has been - // completed once. All telemetry bridge calls are typeof-guarded so an older - // preload (or the test bridge mock) degrades to "no onboarding, no tracking". - const [onboardingStatus, setOnboardingStatus] = useState(null) + // Telemetry onboarding page is hidden for now (component kept for later). On + // first launch, silently complete onboarding with the region-aware default + // (on outside EU/EEA/UK/CH, off inside); users change it in Settings. Bridge + // calls stay typeof-guarded so an older preload degrades to no tracking. useEffect(() => { if (typeof codeburn.telemetryStatus !== 'function') return codeburn.telemetryStatus() - .then(status => { if (status && !status.onboarded) setOnboardingStatus(status) }) - .catch(() => { /* telemetry unavailable — skip onboarding */ }) - }, []) - const finishOnboarding = useCallback((enabled: boolean) => { - setOnboardingStatus(null) - if (typeof codeburn.completeOnboarding === 'function') void codeburn.completeOnboarding(enabled).catch(() => {}) + .then(status => { + if (status && !status.onboarded && typeof codeburn.completeOnboarding === 'function') { + void codeburn.completeOnboarding(status.defaultEnabled).catch(() => {}) + } + }) + .catch(() => { /* telemetry unavailable */ }) }, []) // Once-per-day anonymous usage aggregate, only from the canonical view @@ -937,7 +936,6 @@ function AppMain() { } /> - {onboardingStatus && }
} -function PrivacyClaim({ title, detail, icon }: { title: string; detail: string; icon: React.ReactNode }) { - return
{icon}
{title}
{detail}
+function PrivacyClaim({ title, detail, icon }: { title: string; detail: string; icon: IconName }) { + return
{title}
{detail}
} function ThisDevicePanel({ identity, shareStatus }: { identity: ReturnType>; shareStatus: ReturnType> }) {