Skip to content

Onboarding hotfix 5#1227

Merged
duckduckhero merged 5 commits intomainfrom
onboarding-hotfix-5
Jul 28, 2025
Merged

Onboarding hotfix 5#1227
duckduckhero merged 5 commits intomainfrom
onboarding-hotfix-5

Conversation

@duckduckhero
Copy link
Contributor

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 28, 2025

📝 Walkthrough

Walkthrough

This change updates the microphone and system audio permission handling in both the settings and welcome modal components. It introduces state tracking for microphone permission requests, customizes permission button labels, and adjusts control flow for denied permissions. Additionally, it removes the calendar permissions step from onboarding, updates localization files, and adds a "sound" tab title in settings.

Changes

Cohort / File(s) Change Summary
Microphone Permission Handling Updates
apps/desktop/src/components/settings/views/sound.tsx
apps/desktop/src/components/welcome-modal/audio-permissions-view.tsx
Introduces micPermissionRequested state to track microphone permission requests, adds a buttonText prop to PermissionItem, and implements a handler to either request permission or open system settings if previously denied. Button labels dynamically change based on permission state. Error handling and control flow are updated to reflect these changes.
Onboarding Flow Adjustment
apps/desktop/src/components/welcome-modal/index.tsx
apps/desktop/src/components/welcome-modal/language-selection-view.tsx
Removes the calendar permissions step from the onboarding flow. Updates the language selection continue button label from "Continue" to "Finish Onboarding".
Localization Updates
apps/desktop/src/locales/en/messages.po
apps/desktop/src/locales/ko/messages.po
Updates translation metadata and source references, adds new entries for {buttonText} and "Finish Onboarding", and reactivates the "Sound" message. No actual translation content is changed.
Settings Tab Title
apps/desktop/src/routes/app.settings.tsx
Adds support for a new "sound" tab by updating the tab title function to return the localized "Sound" string.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI
    participant PermissionItem
    participant System

    User->>UI: Clicks microphone permission button
    UI->>PermissionItem: handleMicPermissionAction()
    alt Permission not yet requested
        PermissionItem->>System: Request microphone permission
        System-->>PermissionItem: Permission granted/denied
        PermissionItem->>UI: Set micPermissionRequested = true
    else Permission previously requested and denied
        PermissionItem->>System: Open system microphone settings
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Possibly related PRs

  • Onboarding hotfix 2 #1225: Both PRs modify microphone and system audio permission handling, introduce micPermissionRequested state, update PermissionItem with a buttonText prop, and add a handler for permission requests and settings navigation.
  • Onboarding hotfix 4 #1226: Both PRs touch microphone permission handling in sound.tsx; this PR adds state and button logic, while the related PR focuses on timing and refetch behavior after permission changes.
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch onboarding-hotfix-5

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (3)
apps/desktop/src/locales/ko/messages.po (2)

275-278: Localization structure is correct, but Korean translations needed.

The new {buttonText} message ID is properly added with correct source references. However, the msgstr is empty - Korean translations should be provided for completeness.


736-738: Korean translation needed for "Finish Onboarding".

The new message ID is correctly added with proper source reference, but the Korean translation (msgstr) is missing.

apps/desktop/src/components/welcome-modal/audio-permissions-view.tsx (1)

103-103: Suggest extracting shared permission logic.

The microphone permission handling logic is identical between this file and sound.tsx. Consider extracting the shared logic into a custom hook or utility function to reduce code duplication.

Example custom hook that could be shared:

// hooks/useMicrophonePermission.ts
export function useMicrophonePermission() {
  const [micPermissionRequested, setMicPermissionRequested] = useState(false);
  
  const micPermissionStatus = useQuery({
    queryKey: ["micPermission"],
    queryFn: () => listenerCommands.checkMicrophoneAccess(),
    refetchInterval: 1000,
  });

  const micPermission = useMutation({
    mutationFn: () => listenerCommands.requestMicrophoneAccess(),
    onSuccess: () => {
      setMicPermissionRequested(true);
      setTimeout(() => micPermissionStatus.refetch(), 3000);
    },
    onError: (error) => {
      setMicPermissionRequested(true);
      console.error(error);
    },
  });

  const handleMicPermissionAction = () => {
    if (micPermissionRequested && !micPermissionStatus.data) {
      listenerCommands.openMicrophoneAccessSettings();
    } else {
      micPermission.mutate();
    }
  };

  const buttonText = micPermissionRequested && !micPermissionStatus.data ? "Open Settings" : "Enable";

  return {
    micPermissionStatus,
    micPermission,
    handleMicPermissionAction,
    buttonText,
  };
}

Also applies to: 120-120, 125-128, 142-148

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fffa246 and 0511b25.

📒 Files selected for processing (7)
  • apps/desktop/src/components/settings/views/sound.tsx (9 hunks)
  • apps/desktop/src/components/welcome-modal/audio-permissions-view.tsx (9 hunks)
  • apps/desktop/src/components/welcome-modal/index.tsx (1 hunks)
  • apps/desktop/src/components/welcome-modal/language-selection-view.tsx (1 hunks)
  • apps/desktop/src/locales/en/messages.po (13 hunks)
  • apps/desktop/src/locales/ko/messages.po (13 hunks)
  • apps/desktop/src/routes/app.settings.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,ts,tsx,rs}

⚙️ CodeRabbit Configuration File

**/*.{js,ts,tsx,rs}: 1. No error handling.
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/welcome-modal/language-selection-view.tsx
  • apps/desktop/src/components/welcome-modal/audio-permissions-view.tsx
  • apps/desktop/src/components/welcome-modal/index.tsx
  • apps/desktop/src/components/settings/views/sound.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-latest)
  • GitHub Check: ci (windows, windows-latest)
🔇 Additional comments (15)
apps/desktop/src/components/welcome-modal/language-selection-view.tsx (1)

180-180: LGTM! Button text correctly reflects final onboarding step.

The change from "Continue" to "Finish Onboarding" accurately represents that this is now the final step in the onboarding flow, aligning with the removal of the calendar permissions step.

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

75-76: LGTM! Sound tab title properly implemented.

The addition follows the existing pattern and correctly uses i18n for the "Sound" tab title, enabling proper navigation display for the new sound settings view.

apps/desktop/src/components/welcome-modal/index.tsx (2)

17-17: LGTM! Properly commented out unused import.

The CalendarPermissionsView import is correctly commented out since the calendar permissions step has been removed from the onboarding flow.


32-38: LGTM! State type correctly updated.

The removal of "calendar-permissions" from the currentStep union type properly reflects the streamlined onboarding flow that no longer includes the calendar permissions step.

apps/desktop/src/locales/en/messages.po (2)

275-278: LGTM! Button text placeholder properly localized.

The new {buttonText} message ID is correctly added with proper source references and English translation, supporting the dynamic button labeling in permission components.


736-738: LGTM! "Finish Onboarding" properly localized.

The new message ID is correctly implemented with proper source reference and English translation, supporting the updated onboarding flow completion.

apps/desktop/src/components/settings/views/sound.tsx (6)

4-4: LGTM: useState import added correctly.

The import is properly placed and follows React conventions.


20-20: LGTM: PermissionItem interface properly extended.

The buttonText prop is correctly typed, added to the function signature, and properly used in the component for dynamic button labeling.

Also applies to: 30-30, 64-64


75-75: LGTM: State initialization is appropriate.

The micPermissionRequested state is properly initialized to track permission request attempts.


92-92: LGTM: Mutation handlers properly updated.

Setting micPermissionRequested to true in both success and error cases is correct - it ensures users who deny permissions are directed to system settings on subsequent attempts.

Also applies to: 97-100


114-120: LGTM: Permission handler logic is sound.

The conditional logic correctly directs users to system settings when permissions were previously requested but denied, improving the user experience.


131-132: LGTM: PermissionItem usage correctly updated.

The microphone permission item properly uses the new handler and dynamic button text, while system audio permission maintains consistent "Enable" labeling.

Also applies to: 142-142

apps/desktop/src/components/welcome-modal/audio-permissions-view.tsx (3)

12-12: LGTM: useState import added correctly.

The import is properly placed and follows React conventions.


22-22: LGTM: PermissionItem interface consistently extended.

The buttonText prop implementation matches the pattern used in sound.tsx, ensuring consistency across components.

Also applies to: 33-33, 82-82


169-170: LGTM: PermissionItem usage correctly implemented.

The implementation is consistent with the sound.tsx file, properly using the new handler and dynamic button text for improved user experience.

Also applies to: 180-180

@duckduckhero duckduckhero merged commit 177006c into main Jul 28, 2025
7 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Nov 14, 2025
@ComputelessComputer ComputelessComputer deleted the onboarding-hotfix-5 branch December 14, 2025 15:23
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