Skip to content

Tracks: add settings & appearance change events - #4434

Open
wojtekn wants to merge 3 commits into
trunkfrom
stu-2121-tracks-settings-appearance-events
Open

Tracks: add settings & appearance change events#4434
wojtekn wants to merge 3 commits into
trunkfrom
stu-2121-tracks-settings-appearance-events

Conversation

@wojtekn

@wojtekn wojtekn commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Claude Code explored the existing Tracks infrastructure, mapped each setting's Main-process persist point, wrote the emits, unit tests, and docs, and verified every event fires with correct props via a dev run. I reviewed the code and confirmed the runtime output for all nine events myself, and iterated with Claude to fix bugs.

Proposed Changes

Adds Tracks analytics for user-preference changes in the Settings surfaces, so we can understand which appearance, editor, terminal, language, quit-behavior, CLI, agentic-features, and UI-mode choices users actually make. Each event fires only when a change is committed and is suppressed when the user has opted out of analytics.

Following the naming already established by studio_setting_telemetry_change, every event uses the studio_setting_<x>_change form (this also satisfies the Tracks ingestion gate, which silently rejects names with fewer than three segments). All events carry a surface: 'settings' prop.

Privacy: the default-directory event sends only an is_default boolean — the directory path (which contains the user's home path) is never included.

Events added: studio_setting_appearance_change, studio_setting_language_change, studio_setting_code_editor_change, studio_setting_terminal_change, studio_setting_default_directory_change, studio_setting_quit_action_change, studio_setting_cli_change, studio_setting_agentic_features_change, studio_setting_ui_change.

Note: server-side registration of these events and their eventprops via the Tracks Registration tool is a separate, out-of-band step (per the issue's Definition of Done) and is not part of this PR.

Testing Instructions

  1. Start Studio: npm start (dev builds run with NODE_ENV=development, which logs events instead of sending them),
  2. In the running app change each setting (Appearance, Language, Code editor, Terminal, Default directory, Quit action, Studio CLI toggle, Agentic features toggle, and the Classic/Agentic UI switch from Settings, the "Try it" banner, and the app menu).
  3. Each change logs a Would have recorded Tracks event: studio_setting_*_change … line in the main-process terminal with the expected props.
  4. Confirm the default-directory event shows is_default and never the path, and that studio_setting_ui_change reports the right surface (settings/banner/menu) for each entry point. (Add STUDIO_DEBUG_TRACKS=1 if you also want the raw Tracks event URL: … line printed.)

All nine events were verified this way (mode/locale/editor/terminal/is_default/behavior/installed/enabled/type respectively).

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

Add nine studio_setting_*_change Tracks events for user-preference changes in the Settings surfaces, emitted from their Main-process committed-save points and gated by the analytics opt-out via the existing wrapper. The default-directory event sends only an is_default boolean, never the path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The agentic-UI switch fires from several entry points (Settings, the 'Try it' banner, the app menu), but the surface was hardcoded to 'settings'. Thread the actual surface through so each is labelled correctly, and skip the event entirely for the boot-time seeding migration.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@wojtekn
wojtekn marked this pull request as ready for review August 4, 2026 14:49
@wojtekn
wojtekn requested a review from a team August 4, 2026 14:49
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 94e2278 vs trunk

app-size

Metric trunk 94e2278 Diff Change
App Size (Mac) 1402.84 MB 1402.84 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk 94e2278 Diff Change
load 1064 ms 1067 ms +3 ms ⚪ 0.0%

site-startup

Metric trunk 94e2278 Diff Change
siteCreation 7520 ms 7484 ms 36 ms ⚪ 0.0%
siteStartup 2866 ms 2876 ms +10 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants