Skip to content

Conversation

@duckduckhero
Copy link
Contributor

@duckduckhero duckduckhero commented Aug 12, 2025

Summary by cubic

Improved floating button visibility logic and updated consent notification behavior to prevent showing it when a transcript already exists.

  • Bug Fixes
  • Floating button now only appears when relevant, avoiding unnecessary display.
  • Consent notification is suppressed if the session has a transcript, including when resuming recording.

@coderabbitai
Copy link

coderabbitai bot commented Aug 12, 2025

📝 Walkthrough

Walkthrough

Adjusts multiple editor and toolbar UI components: FloatingButton and ListenButton visibility/consent logic now consider ongoing session and transcript presence; Share/New-note button visuals and placement updated; ShareButton export/email body and popover styles changed; locale PO files updated to match new source locations.

Changes

Cohort / File(s) Summary
Editor-area button logic
apps/desktop/src/components/editor-area/floating-button.tsx, apps/desktop/src/components/editor-area/note-header/listen-button.tsx
FloatingButton: reads ongoing session status/id and transcript presence, computes isSessionInactive and canEnhanceTranscript, and broadens show guard to include transcript-for-inactive-session cases. ListenButton: reads session.words, only shows consent notification when ongoing active session matches sessionId and words.length === 0; effect deps updated.
Toolbar — Share & placement
apps/desktop/src/components/toolbar/bars/main-toolbar.tsx, apps/desktop/src/components/toolbar/buttons/share-button.tsx
Main toolbar: moved ShareButton from left isNote block to right-side isMain conditional. ShareButton: swapped icon, popover position offset, dynamic open-state bg, card-like backgrounds/borders, export "Email" flow composes richer mailto body (HTML→markdown, signature) and encodes subject/body.
Toolbar — other buttons & visuals
apps/desktop/src/components/toolbar/buttons/new-note-button.tsx, apps/desktop/src/components/toolbar/buttons/transcript-panel-button.tsx
NewNoteButton: removed variant="ghost", ensured transparent bg and explicit text color via className. TranscriptPanelButton: tooltip text changed from "Toggle widget panel" → "Toggle transcriptpanel"; behavior unchanged.
Locales
apps/desktop/src/locales/en/messages.po, apps/desktop/src/locales/ko/messages.po
Updated source-location anchors to reflect edited TSX line numbers; one tooltip msgid changed to "Toggle transcriptpanel" and the old entry marked obsolete; otherwise no msgid/msgstr content changes.

Sequence Diagram(s)

sequenceDiagram
  participant UI as EditorArea
  participant FB as FloatingButton
  participant SS as SessionStore

  UI->>FB: Render()
  FB->>SS: read ongoingSessionStatus, ongoingSessionId
  FB->>SS: read session.enhanced_memo_html, isEnhancePending, session transcript/words
  FB->>FB: compute isSessionInactive, hasTranscript, canEnhanceTranscript
  alt enhanced_memo_html || isEnhancePending || canEnhanceTranscript
    FB-->>UI: Render enhance button
  else
    FB-->>UI: Return null (do not show)
  end
Loading
sequenceDiagram
  participant NH as NoteHeader
  participant LB as ListenButton
  participant SS as SessionStore

  NH->>LB: Render(sessionId)
  LB->>SS: read ongoingActive, onboarding
  LB->>SS: read session.words for sessionId
  LB->>LB: evaluate ongoingActive matches sessionId && !onboarding && words.length === 0
  alt conditions met
    LB-->>NH: Show consent notification
  else
    LB-->>NH: Do not show consent
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • Template Selector Merge  #1089: Modifies FloatingButton visibility/props (adds template popover and props) — closely related to FloatingButton visibility changes here.
  • Update consent notification #1079: Adjusts ListenButton consent-notification logic — directly related to the ListenButton gating changes.
  • Minor fixes #1249: Changes ShareButton export/UI logic — related to the ShareButton styling and export/email body updates in this PR.
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch minor-fixes-0811

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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

cubic analysis

No issues found across 4 files. Review in cubic

Copy link

@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/components/editor-area/note-header/listen-button.tsx (1)

99-105: Prevent duplicate consent toasts; confirm toast deduplication by id

The effect will re-run on dependency changes. You pass a fixed toast id ("recording-consent-reminder"), which likely dedupes, but please verify the toast wrapper enforces id-based uniqueness to avoid repeated pop-ups.

If ids aren’t deduped by the UI toast, consider guarding with a ref so we toast at most once per mount:

  • Expected behavior: Only a single consent toast shows during “running_active” while transcript is empty.
  • If the wrapper doesn’t dedupe by id, add a ref guard:

Outside the effect:

const hasShownConsentRef = useRef(false);

Inside the condition:

if (/* existing conditions */ && !hasShownConsentRef.current) {
  showConsentNotification();
  hasShownConsentRef.current = true;
}
apps/desktop/src/components/editor-area/floating-button.tsx (2)

77-83: New visibility logic reads well; consider more precise naming for isSessionInactive

The predicate also covers “different ongoing session id,” not just inactivity. Consider renaming to reduce ambiguity (e.g., isNotCurrentOngoingSession) for clarity.


191-195: Render guard inversion changes visibility semantics — please verify UX

Previously the button was hidden unless memo HTML was absent and not pending. Now it’s shown when any of the following is true: enhanced memo exists, enhancement is pending, or transcript exists for a non-current/inactive session. This looks intentional per PR objectives, but it’s a behavioral change. Please validate these flows:

  • No transcript, not pending, no enhanced memo → button hidden (expected).
  • Transcript exists and session is inactive/not current → button visible to allow enhancement (expected).
  • Enhanced memo exists → button visible for raw/enhanced toggle and rerun (expected).

Also minor: coerce to boolean for readability and type clarity.

Apply this diff locally:

-  const shouldShowButton = session.enhanced_memo_html || isEnhancePending || canEnhanceTranscript;
+  const shouldShowButton = Boolean(session.enhanced_memo_html) || isEnhancePending || canEnhanceTranscript;
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8c58c1c and 481468d.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • apps/desktop/src/components/editor-area/floating-button.tsx (2 hunks)
  • apps/desktop/src/components/editor-area/note-header/listen-button.tsx (1 hunks)
  • apps/desktop/src/locales/en/messages.po (7 hunks)
  • apps/desktop/src/locales/ko/messages.po (7 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/components/editor-area/note-header/listen-button.tsx
  • apps/desktop/src/components/editor-area/floating-button.tsx
🔇 Additional comments (3)
apps/desktop/src/components/editor-area/note-header/listen-button.tsx (1)

95-96: Gating consent by transcript presence — LGTM

Using sessionWords to avoid showing consent once there’s already a transcript is the right call and aligns with the PR’s intent.

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

271-274: PO source-location updates only — LGTM

Only reference anchors moved to match listen-button.tsx edits; no msgid/msgstr changes. Safe to merge.

Also applies to: 1120-1122, 1200-1202, 1284-1286, 1297-1299, 1438-1440, 1442-1444, 1487-1489

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

271-274: PO source-location updates only — LGTM

Same as ko: purely metadata (source refs) updated for listen-button.tsx; translations unchanged.

Also applies to: 1120-1122, 1200-1202, 1283-1286, 1296-1299, 1437-1440, 1441-1444, 1486-1489

Copy link

@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 (1)
apps/desktop/src/components/toolbar/buttons/new-note-button.tsx (1)

37-37: Button styling is consistent but consider design system alignment.

The explicit bg-transparent text-black classes ensure consistent button appearance. However, verify this aligns with your design system's button variants rather than using inline overrides.

Consider using a dedicated button variant if this styling pattern is used elsewhere:

-className="hover:bg-neutral-200 bg-transparent text-black"
+variant="toolbar"  // or similar semantic variant
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 481468d and eae7830.

📒 Files selected for processing (6)
  • apps/desktop/src/components/toolbar/bars/main-toolbar.tsx (1 hunks)
  • apps/desktop/src/components/toolbar/buttons/new-note-button.tsx (1 hunks)
  • apps/desktop/src/components/toolbar/buttons/share-button.tsx (7 hunks)
  • apps/desktop/src/components/toolbar/buttons/transcript-panel-button.tsx (1 hunks)
  • apps/desktop/src/locales/en/messages.po (9 hunks)
  • apps/desktop/src/locales/ko/messages.po (9 hunks)
✅ Files skipped from review due to trivial changes (1)
  • apps/desktop/src/components/toolbar/buttons/transcript-panel-button.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/desktop/src/locales/ko/messages.po
🧰 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/components/toolbar/bars/main-toolbar.tsx
  • apps/desktop/src/components/toolbar/buttons/new-note-button.tsx
  • apps/desktop/src/components/toolbar/buttons/share-button.tsx
🧬 Code Graph Analysis (1)
apps/desktop/src/components/toolbar/bars/main-toolbar.tsx (1)
apps/desktop/src/components/toolbar/buttons/share-button.tsx (1)
  • ShareButton (28-31)
⏰ 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). (3)
  • GitHub Check: zizmor
  • GitHub Check: ci (macos, macos-latest)
  • GitHub Check: ci (windows, windows-latest)
🔇 Additional comments (15)
apps/desktop/src/components/toolbar/bars/main-toolbar.tsx (1)

60-60: LGTM! ShareButton placement improvement.

The ShareButton is now properly placed on the right side of the toolbar within the main window context, which aligns with the PR objectives to improve UI organization. The conditional rendering ensures it only appears when viewing a note in the main window.

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

1120-1122: Translation reference updated correctly.

The "No Template (Default)" reference has been updated to line 519, which aligns with the source location changes.


1539-1544: New translation entry properly added with obsolete cleanup.

The new "Toggle transcriptpanel" translation has been added with the correct reference (line 36), and the obsolete "Toggle widget panel" entry is properly marked with #~. This follows proper PO file maintenance practices.


637-639: Translation reference is accurate – no change needed.

Verified that the <Trans>Create new note</Trans> string resides on line 46 of
apps/desktop/src/components/toolbar/buttons/new-note-button.tsx, matching the reference in
apps/desktop/src/locales/en/messages.po:637.
No mismatch detected; you can disregard the original comment.

Likely an incorrect or invalid review comment.


271-273: Placeholder references are accurate
The .po entries at lines 271–273 (#: …listen-button.tsx:222, …:244, …:264) match the <Trans> calls in apps/desktop/src/components/editor-area/note-header/listen-button.tsx at lines 222, 244, and 264. No update to line numbers is needed.

apps/desktop/src/components/toolbar/buttons/share-button.tsx (10)

7-7: Icon import change looks good.

Changed from Share2Icon to Share - verify this provides the desired visual appearance in the UI.


242-242: Dynamic background state for open popover.

The conditional background class provides visual feedback when the popover is open, enhancing UX. The implementation is clean and follows React patterns.


245-245: Icon usage updated consistently.

Updated to use the new Share icon component imported on line 7.


251-251: Popover positioning adjustment.

The sideOffset={7} provides better visual spacing between the trigger and popover content.


272-272: Card-style visual treatment applied consistently.

The white background and border styling creates a clean card appearance for the direct action buttons.


276-276: Button styling maintains consistency.

Explicit white background ensures consistent appearance across the button states.


299-303: Expandable option styling improved.

The card-style treatment with consistent backgrounds and hover states provides better visual hierarchy. The conditional styling based on expanded state is well implemented.


315-315: Content container styling enhanced.

The lighter border (border-gray-100) and white background create proper visual separation for expanded content.


368-368: Export button styling updated.

Changed from bg-gray-800 to bg-black and transition-colors to transition-all for more prominent styling and smoother transitions.


442-455: Enhanced email export body content.

The email body now includes:

  1. A descriptive prefix
  2. Proper markdown conversion from HTML content
  3. A signature with the app URL
  4. Proper URL encoding

This provides a much richer email sharing experience.

@duckduckhero duckduckhero merged commit 16b2eeb into main Aug 12, 2025
7 checks passed
This was referenced Aug 20, 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.

2 participants