Skip to content

Conversation

@ComputelessComputer
Copy link
Collaborator

No description provided.

When the user stops the ongoing session, this change checks if the session
has any words recorded. If the session has no words, it dismisses the
"recording-consent-reminder" toast notification.

This ensures that the toast is only shown when the user has actually
recorded some words during the session.
Adds a check to only generate a title if the session has transcript
words. This ensures that the title is only generated when there is
sufficient content to do so, avoiding unnecessary API calls.
@coderabbitai
Copy link

coderabbitai bot commented Jul 5, 2025

📝 Walkthrough

Walkthrough

The changes introduce conditional logic to handle session transcript words in the editor area and listen button components. Title generation is now skipped when there are no transcript words, and the recording consent reminder toast is dismissed if a session ends without any recorded words. Localization files were updated to reflect new source code line references.

Changes

Files/Groups Change Summary
apps/desktop/src/components/editor-area/index.tsx Added a selector for transcript words; conditionally triggers title generation only if transcript words exist.
apps/desktop/src/components/editor-area/note-header/listen-button.tsx Enhanced session stop logic to dismiss consent reminder toast if no words were recorded in the session.
apps/desktop/src/locales/en/messages.po
apps/desktop/src/locales/ko/messages.po
Updated source line numbers for translation entries; no changes to translations themselves.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ListenButton
    participant Session
    participant Toast
    participant EditorArea

    User->>ListenButton: Click Stop
    ListenButton->>Session: Stop ongoing session
    ListenButton->>Session: Get sessionWords
    alt sessionWords is empty
        ListenButton->>Toast: Dismiss "recording-consent-reminder"
    end

    Session->>EditorArea: Enhance session (mutation)
    EditorArea->>Session: Check hasTranscriptWords
    alt hasTranscriptWords is true
        EditorArea->>Session: generateTitle.mutate()
    else
        EditorArea-->>Session: Skip title generation
    end
Loading

Possibly related PRs

  • Update consent notification #1079: Both PRs modify the listen-button.tsx component to enhance user notification behavior related to session recording consent, with the main PR adding logic to dismiss the consent reminder toast when no transcript words exist, directly building upon the consent notification mechanism introduced in the retrieved PR.

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6b6fc99 and 49d4f9b.

📒 Files selected for processing (4)
  • apps/desktop/src/components/editor-area/index.tsx (1 hunks)
  • apps/desktop/src/components/editor-area/note-header/listen-button.tsx (2 hunks)
  • apps/desktop/src/locales/en/messages.po (3 hunks)
  • apps/desktop/src/locales/ko/messages.po (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{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".

**/*.{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".

⚙️ Source: CodeRabbit Configuration File

List of files the instruction was applied to:

  • apps/desktop/src/components/editor-area/index.tsx
  • apps/desktop/src/components/editor-area/note-header/listen-button.tsx
🧬 Code Graph Analysis (2)
apps/desktop/src/components/editor-area/index.tsx (1)
packages/utils/src/contexts/sessions.tsx (1)
  • useSession (49-74)
apps/desktop/src/components/editor-area/note-header/listen-button.tsx (3)
packages/utils/src/contexts/ongoing-session.tsx (1)
  • useOngoingSession (32-46)
packages/utils/src/contexts/sessions.tsx (1)
  • useSession (49-74)
packages/ui/src/components/ui/toast.tsx (1)
  • sonnerToast (6-6)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: ci (macos, macos-latest)
  • GitHub Check: ci (windows, windows-latest)
🔇 Additional comments (7)
apps/desktop/src/components/editor-area/index.tsx (2)

66-66: LGTM: Good defensive programming.

The hasTranscriptWords selector efficiently checks if the session contains transcript words, preventing unnecessary operations when no content exists.


73-75: LGTM: Conditional title generation improves efficiency.

The conditional check prevents title generation when there are no transcript words, which aligns with the PR objective of adding session words checks. This avoids unnecessary API calls and improves user experience.

apps/desktop/src/locales/ko/messages.po (1)

884-884: LGTM: Localization line references updated correctly.

The line number updates for "Pause", "Search...", and "Stop" entries correctly reflect the source code changes in the corresponding TypeScript files.

Also applies to: 970-970, 1042-1042

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

884-884: LGTM: Localization line references updated correctly.

The line number updates for "Pause", "Search...", and "Stop" entries correctly reflect the source code changes, maintaining consistency with the Korean localization file.

Also applies to: 970-970, 1042-1042

apps/desktop/src/components/editor-area/note-header/listen-button.tsx (3)

221-221: LGTM: Appropriate use of session hook.

The ongoingSessionId retrieval using the useOngoingSession hook is correctly implemented and follows the established pattern.


226-226: LGTM: Session words retrieval with proper null handling.

The sessionWords hook correctly uses the non-null assertion (!) on ongoingSessionId since this component (WhenActive) only renders when there's an active ongoing session.


238-240: LGTM: Smart consent reminder dismissal logic.

The conditional logic to dismiss the "recording-consent-reminder" toast when no words were recorded is well-implemented. This prevents unnecessary consent reminders when a session ends without any actual recording content.

✨ Finishing Touches
  • 📝 Generate Docstrings

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 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.

@yujonglee yujonglee merged commit e012bd7 into main Jul 5, 2025
5 checks passed
@yujonglee yujonglee deleted the add-session-words-check-on-stop-session branch July 5, 2025 18:30
@coderabbitai coderabbitai bot mentioned this pull request Sep 9, 2025
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.

3 participants