Conversation
📝 WalkthroughWalkthroughAdds analytics instrumentation across AI settings and notifications: integrates useHypr to read userId, converts several event handlers to async, and conditionally calls analyticsCommands.setProperties after user actions (model selection, autonomy selection, STT provider change, notification toggles). Prop types updated to pass userId in local STT view components. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant UI as Settings UI
participant Hypr as Hypr Context
participant API as Backend/API
participant Analytics as Analytics Service
rect rgb(240,245,255)
note right of UI: STT local model selection
User->>UI: Click ModelEntry
UI->>Hypr: get userId
alt userId present
UI->>Analytics: setProperties {distinct_id: userId, set: {stt: "local-pro"|"local-basic"}}
Analytics-->>UI: ack
else no userId
note over UI: Skip analytics
end
UI->>API: select/start model (existing flow)
API-->>UI: done
end
rect rgb(245,255,240)
note right of UI: LLM autonomy selection
User->>UI: Click autonomy level
UI->>Hypr: get userId
alt userId present
UI->>Analytics: setProperties {distinct_id: userId, set: {"llm-autonomy": value}}
Analytics-->>UI: ack
else
note over UI: Skip analytics
end
UI->>API: mutate AI specificity (existing)
API-->>UI: done
end
rect rgb(255,245,240)
note right of UI: STT provider -> Custom
User->>UI: Select "Custom"
UI->>API: mutate provider=Custom
API-->>UI: done
UI->>Hypr: get userId
alt userId present
UI->>Analytics: setProperties {distinct_id: userId, set: {stt: "custom"}}
Analytics-->>UI: ack
else
note over UI: Skip analytics
end
end
rect rgb(250,250,250)
note right of UI: Notification toggles
User->>UI: Toggle notification
UI->>API: mutate toggle
API-->>UI: success
UI->>API: refetch current state
API-->>UI: state
UI->>Hypr: get userId
alt userId present
UI->>Analytics: setProperties {distinct_id: userId, set: {event_notification|audio_notification: value}}
Analytics-->>UI: ack
else
note over UI: Skip analytics
end
UI->>UI: continue side effects (start/stop, toast)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (5)
apps/desktop/src/components/settings/views/ai-llm.tsx (1)
733-757: Gate event on userId and tighten comment intent.
- Keep analytics consistent with other views by guarding the legacy event with userId.
- Make comments “why”-focused or remove.
Apply:
- // legacy: send analytics event - analyticsCommands.event({ - event: "autonomy_selected", - distinct_id: userId, - level: level, - }); + // analytics: keep backward-compatible event for funnels + if (userId) { + analyticsCommands.event({ + event: "autonomy_selected", + distinct_id: userId, + level, + }); + } - // set user properties + // analytics: set autonomy level for segmentationapps/desktop/src/components/settings/views/notifications.tsx (1)
80-81: Trim “what” comments.Prefer brief “why” or omit; code is self-explanatory.
Apply:
- // Track notification setting change in analytics + // analytics: persist user setting for targetingAlso applies to: 117-118
apps/desktop/src/components/settings/components/ai/stt-view-local.tsx (3)
46-47: Reduce prop drilling (optional).Instead of threading userId through sections, ModelEntry can read useHypr() directly. Keeps props slimmer.
Also applies to: 59-59, 144-145, 161-162, 181-182, 211-212, 230-231, 284-285
376-395: Model selection analytics is solid; minor UX nit.Awaiting setProperties is fine; if you prefer non-blocking UI, fire-and-forget.
Apply:
- await analyticsCommands.setProperties({ + void analyticsCommands.setProperties({ distinct_id: userId, set: { stt: sttType, }, });
385-387: Replace prefix-based pro detection with explicit model list
All current pro keys (“am-parakeet-v2”, “am-parakeet-v3”) start with “am-”, but use the existing pro models array (used in your query filters) instead ofstartsWith("am-")to avoid future misclassification.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (2)
apps/desktop/src/locales/en/messages.pois excluded by!**/*.poapps/desktop/src/locales/ko/messages.pois excluded by!**/*.po
📒 Files selected for processing (4)
apps/desktop/src/components/settings/components/ai/stt-view-local.tsx(11 hunks)apps/desktop/src/components/settings/views/ai-llm.tsx(1 hunks)apps/desktop/src/components/settings/views/ai-stt.tsx(1 hunks)apps/desktop/src/components/settings/views/notifications.tsx(4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,ts,tsx,rs}
⚙️ CodeRabbit configuration file
**/*.{js,ts,tsx,rs}: 1. Do not add any error handling. Keep the existing one.
2. No unused imports, variables, or functions.
3. For comments, keep it minimal. It should be about "Why", not "What".
Files:
apps/desktop/src/components/settings/views/ai-llm.tsxapps/desktop/src/components/settings/views/notifications.tsxapps/desktop/src/components/settings/views/ai-stt.tsxapps/desktop/src/components/settings/components/ai/stt-view-local.tsx
🧬 Code graph analysis (2)
apps/desktop/src/components/settings/views/notifications.tsx (1)
apps/desktop/src/contexts/hypr.tsx (1)
useHypr(63-69)
apps/desktop/src/components/settings/components/ai/stt-view-local.tsx (1)
apps/desktop/src/contexts/hypr.tsx (1)
useHypr(63-69)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: ci (windows, windows-latest)
- GitHub Check: ci (macos, macos-14)
🔇 Additional comments (5)
apps/desktop/src/components/settings/views/ai-stt.tsx (1)
52-59: LGTM: analytics property set is correctly gated and awaited.Consistent with the PR pattern (uses distinct_id, “stt: custom”).
apps/desktop/src/components/settings/views/notifications.tsx (3)
9-11: LGTM: user context and analytics imports are correctly introduced and used.Also applies to: 29-29
77-89: LGTM: event toggle analytics runs post-refetch and is user-gated.
114-126: LGTM: detect toggle analytics mirrors event toggle flow.apps/desktop/src/components/settings/components/ai/stt-view-local.tsx (1)
7-10: LGTM: added context and analytics deps are used.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/desktop/src/components/settings/components/ai/stt-view-remote.tsx (1)
17-17: Discard returned Promise from setProviderToCustom to avoid floating-promise lint errors
setProviderToCustom()now returns aPromise<void>. Inapps/desktop/src/components/settings/components/ai/stt-view-remote.tsx, prependvoidto each invocation to explicitly discard the promise and satisfy the linter:
- onClick at line 94
- onFocus at lines 154, 182, 209
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (2)
apps/desktop/src/locales/en/messages.pois excluded by!**/*.poapps/desktop/src/locales/ko/messages.pois excluded by!**/*.po
📒 Files selected for processing (1)
apps/desktop/src/components/settings/components/ai/stt-view-remote.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,ts,tsx,rs}
⚙️ CodeRabbit configuration file
**/*.{js,ts,tsx,rs}: 1. Do not add any error handling. Keep the existing one.
2. No unused imports, variables, or functions.
3. For comments, keep it minimal. It should be about "Why", not "What".
Files:
apps/desktop/src/components/settings/components/ai/stt-view-remote.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: ci (macos, macos-14)
- GitHub Check: ci (windows, windows-latest)
No description provided.