desktop: settings pane fixes (#1501)
Some checks failed
CI / semgrep (push) Waiting to run
Tests / test (22) (push) Waiting to run
Tests / test (22.13.0) (push) Waiting to run
Tests / test (24) (push) Waiting to run
Tests / test (26) (push) Waiting to run
Tests / test-platforms (macos-latest) (push) Waiting to run
Tests / test-platforms (windows-latest) (push) Waiting to run
Tests / desktop (push) Waiting to run
Windows Menubar CI / check (ubuntu-latest) (push) Has been cancelled
Windows Menubar CI / check (windows-latest) (push) Has been cancelled
macOS Menubar CI / test (push) Has been cancelled

* desktop: fix privacy pane icons and row alignment

Local-only and No API keys passed raw <rect>/<path> as their icon, which never
rendered (no <svg> wrapper), so those rows lost their icon and their text sat
further left than the icon rows. PrivacyClaim now uses the Icon component (lock,
shield) so all four rows share one icon column and align.

* desktop: drop the first-run onboarding screen

Onboarding now completes automatically on first launch using the region default
(off in EU/EEA/UK/CH, on elsewhere) instead of showing the screen. The Settings
toggle stays as the control; the component is kept for later.

* desktop: record dock state on app open

app_open carries dock: on/off/none from readDockEnabled(), so dock usage is
visible. 'none' covers installs with no dock set up, so it is never inflated.
This commit is contained in:
Resham Joshi 2026-09-19 15:56:57 -07:00 • committed by GitHub
parent 4cf1885593
commit 08dae3bcc7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 23 additions and 21 deletions

View file

@ -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)

View file

@ -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<TelemetryStatus | null>(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() {
<Sidebar active={section} onNavigate={navigate} status={<StatusLine polled={overview} snapshot={headlineSnapshot} />} />
<ToastHost />
<Splash hasData={overview.data != null || headlineSnapshot != null} hasError={overview.error != null && !overviewCold} />
{onboardingStatus && <Onboarding defaultEnabled={onboardingStatus.defaultEnabled} onDone={finishOnboarding} />}
<div className="ct" aria-busy={refreshing}>
<div className={refreshing ? 'switch-line on' : 'switch-line'} aria-hidden="true" />
<UpdateBanner />

View file

@ -29,7 +29,7 @@ import { rateLimitedNote } from './Plans'
import { SharingPane } from './SettingsSharing'
import { CapacityDockPane, MenuBarPane } from './SettingsTray'
import type { ActionResult, AliasRow, ClaudeConfigSelector, CompanionStatus, CliError, CombinedUsage, DeviceScanResult, Identity, JsonPlanSummary, MenubarPayload, Period, PlanId, PlanProvider, PriceOverrideList, PriceOverrideRow, PriceRates, ProjectFilter, ProjectRow, ProjectsReport, ProviderName, QuotaProvider, Scope, ShareStatus, StatusJson, TelemetryStatus } from '../lib/types'
import { Icon } from '../components/icons'
import { Icon, type IconName } from '../components/icons'
export type SettingsPane = 'general' | 'providers' | 'projects' | 'aliases' | 'pricing' | 'plans' | 'devices' | 'export' | 'privacy' | 'sharing' | 'menubar' | 'dock'
type Pane = SettingsPane
@ -650,8 +650,8 @@ function PrivacyPane() {
showToast(t('settings.privacy.snapshotsCleared'), 'ok')
}
return <section className="set-p on"><div><h3 className="set-h">{t('settings.privacy.heading')}</h3><p className="set-sub">{t('settings.privacy.subtitle')}</p></div><div className="card">
<PrivacyClaim title={t('settings.privacy.localOnly.title')} detail={t('settings.privacy.localOnly.detail')} icon={<><rect x="4.5" y="10" width="15" height="11" rx="2" /><path d="M8 10V7a4 4 0 0 1 8 0v3" /></>} />
<PrivacyClaim title={t('settings.privacy.noApiKeys.title')} detail={t('settings.privacy.noApiKeys.detail')} icon={<path d="M12 3l8 3v6c0 5-3.5 8-8 9-4.5-1-8-4-8-9V6z" />} />
<PrivacyClaim title={t('settings.privacy.localOnly.title')} detail={t('settings.privacy.localOnly.detail')} icon="lock" />
<PrivacyClaim title={t('settings.privacy.noApiKeys.title')} detail={t('settings.privacy.noApiKeys.detail')} icon="shield" />
<div className="set-claim"><Icon name="trash-2" /><div style={{ flex: 1 }}><div className="set-claim-t">{t('settings.privacy.snapshots.title')}</div><div className="set-claim-d">{t('settings.privacy.snapshots.detail')}</div></div><button type="button" className="btnp" onClick={clearSnapshots}>{t('settings.privacy.clearButton')}</button></div>
<TelemetryClaim />
</div></section>
@ -683,8 +683,8 @@ function TelemetryClaim() {
</div>
}
function PrivacyClaim({ title, detail, icon }: { title: string; detail: string; icon: React.ReactNode }) {
return <div className="set-claim">{icon}<div><div className="set-claim-t">{title}</div><div className="set-claim-d">{detail}</div></div></div>
function PrivacyClaim({ title, detail, icon }: { title: string; detail: string; icon: IconName }) {
return <div className="set-claim"><Icon name={icon} /><div style={{ flex: 1 }}><div className="set-claim-t">{title}</div><div className="set-claim-d">{detail}</div></div></div>
}
function ThisDevicePanel({ identity, shareStatus }: { identity: ReturnType<typeof usePolled<Identity>>; shareStatus: ReturnType<typeof usePolled<ShareStatus>> }) {