Tracks: add settings & appearance change events - #4434
Open
wojtekn wants to merge 3 commits into
Open
Conversation
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
marked this pull request as ready for review
August 4, 2026 14:49
Collaborator
📊 Performance Test ResultsComparing 94e2278 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 thestudio_setting_<x>_changeform (this also satisfies the Tracks ingestion gate, which silently rejects names with fewer than three segments). All events carry asurface: 'settings'prop.Privacy: the default-directory event sends only an
is_defaultboolean — 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.Testing Instructions
npm start(dev builds run withNODE_ENV=development, which logs events instead of sending them),Would have recorded Tracks event: studio_setting_*_change …line in the main-process terminal with the expected props.is_defaultand never the path, and thatstudio_setting_ui_changereports the rightsurface(settings/banner/menu) for each entry point. (AddSTUDIO_DEBUG_TRACKS=1if you also want the rawTracks event URL: …line printed.)All nine events were verified this way (
mode/locale/editor/terminal/is_default/behavior/installed/enabled/typerespectively).Pre-merge Checklist