Skip to content

listen button + settings tab analytics #1491

Merged
duckduckhero merged 1 commit intomainfrom
lilnemo-analytics-2
Sep 23, 2025
Merged

listen button + settings tab analytics #1491
duckduckhero merged 1 commit intomainfrom
lilnemo-analytics-2

Conversation

@duckduckhero
Copy link
Contributor

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 23, 2025

📝 Walkthrough

Walkthrough

Adds userId-scoped analytics to desktop UI interactions: recording controls and microphone selection in the Listen Button, plus settings tab switches. Retrieves userId from useHypr and emits analytics events with distinct_id on specific actions without altering public interfaces.

Changes

Cohort / File(s) Summary of Changes
Listen Button Analytics
apps/desktop/src/components/editor-area/note-header/listen-button.tsx
Emits analytics with distinct_id=userId for: mic mute and system mute (on mute only), opening mic options, and selecting a mic device. Pulls userId via useHypr; wires events into existing handlers.
Settings Tab Analytics
apps/desktop/src/routes/app.settings.tsx
On tab change, maps recognized tabs (general, ai-llm, ai-stt) to event names and fires analytics with distinct_id=userId within a useEffect. Imports useHypr and analyticsCommands.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor U as User
  participant LB as ListenButton UI
  participant AC as Analytics

  rect rgb(238,246,255)
  note over U,LB: Recording controls
  U->>LB: Click Mic Mute
  alt Muting
    LB->>AC: track("mic_muted", { distinct_id: userId })
  else Unmuting
    LB--xAC: no event
  end

  U->>LB: Open Mic Options
  LB->>AC: track("mic_options_opened", { distinct_id: userId })

  U->>LB: Select Mic Device
  LB->>AC: track("mic_device_selected", { distinct_id: userId, deviceId })
  end
Loading
sequenceDiagram
  autonumber
  actor U as User
  participant ST as Settings Page
  participant AC as Analytics

  rect rgb(243,255,243)
  note over U,ST: Tab navigation
  U->>ST: Switch Tab (general | ai-llm | ai-stt)
  ST->>AC: track("<tab_event>", { distinct_id: userId })
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request has no author-provided description (the description field is blank), so there is nothing to evaluate for relevance or intent against the changeset. Because a description is missing, this check fails under the requirement that the PR should at least document its purpose. Request the author to add a brief description summarizing what was changed (analytics added to the listen button and settings tabs), why the changes were made, which analytics events are emitted, and any privacy or opt-out considerations; a short paragraph is sufficient.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title "listen button + settings tab analytics" accurately summarizes the primary change set, which adds analytics for the listen button and for settings tab navigation; it is concise and directly related to the changes in the diff. It is clear enough for a teammate scanning PR history to understand the main intent. Minor stylistic issues (lowercase and the '+' symbol) do not make it misleading.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch lilnemo-analytics-2

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e2d0f10 and 857368f.

⛔ Files ignored due to path filters (2)
  • apps/desktop/src/locales/en/messages.po is excluded by !**/*.po
  • apps/desktop/src/locales/ko/messages.po is excluded by !**/*.po
📒 Files selected for processing (2)
  • apps/desktop/src/components/editor-area/note-header/listen-button.tsx (4 hunks)
  • apps/desktop/src/routes/app.settings.tsx (2 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/routes/app.settings.tsx
  • apps/desktop/src/components/editor-area/note-header/listen-button.tsx
🧬 Code graph analysis (2)
apps/desktop/src/routes/app.settings.tsx (1)
apps/desktop/src/contexts/hypr.tsx (1)
  • useHypr (63-69)
apps/desktop/src/components/editor-area/note-header/listen-button.tsx (2)
apps/desktop/src/contexts/hypr.tsx (1)
  • useHypr (63-69)
packages/utils/src/contexts/ongoing-session.tsx (1)
  • useOngoingSession (32-46)
⏰ 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 (9)
apps/desktop/src/components/editor-area/note-header/listen-button.tsx (6)

302-302: LGTM: userId added for analytics tracking.

The change to include userId from the useHypr context enables analytics tracking in the recording controls. The destructuring is consistent with the existing pattern.


309-322: LGTM: Analytics tracking on mic mute with correct condition.

The analytics event is properly scoped to only trigger when muting (not unmuting) and includes the distinct_id for user tracking. The event name "recording_mute_mic" is descriptive and consistent.


325-338: LGTM: Analytics tracking on system mute with correct condition.

Similar to the mic mute tracking, this properly tracks only the muting action (not unmuting) with appropriate event naming "recording_mute_system".


423-423: LGTM: userId added for microphone selector analytics.

Consistent addition of userId for analytics tracking in the microphone selector component.


440-446: LGTM: Analytics on microphone device selection.

The event "recording_select_mic_trigger" appropriately tracks when a user selects a microphone device, triggered after the device is successfully set.


481-488: LGTM: Analytics on microphone options menu opening.

The event "recording_select_mic_option" tracks when users open the microphone options popover, providing insight into user interaction patterns.

apps/desktop/src/routes/app.settings.tsx (3)

21-22: LGTM: Required imports for analytics tracking.

The imports for useHypr, analyticsCommands, and useEffect are properly added to support the new analytics functionality.

Also applies to: 24-24


91-91: LGTM: userId extraction for analytics.

Consistent with the pattern used in the listen-button component, extracting userId from the useHypr context for analytics tracking.


93-109: Well-implemented settings tab analytics tracking.

The implementation correctly:

  • Guards analytics calls with userId check
  • Maps only specific tabs to events (general, ai-llm, ai-stt)
  • Uses descriptive event names with consistent naming pattern
  • Includes proper dependencies in the useEffect hook
  • Tracks tab changes without affecting existing functionality

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@duckduckhero duckduckhero merged commit 6d46a51 into main Sep 23, 2025
7 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Dec 13, 2025
@ComputelessComputer ComputelessComputer deleted the lilnemo-analytics-2 branch December 14, 2025 15:22
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.

1 participant