Skip to content

transcript option upgrade #1294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 6, 2025
Merged

transcript option upgrade #1294

merged 2 commits into from
Aug 6, 2025

Conversation

duckduckhero
Copy link
Collaborator

@duckduckhero duckduckhero commented Aug 6, 2025

Summary by cubic

Added an "Include transcript" option when exporting notes to Obsidian, allowing users to attach the full session transcript to the exported markdown.

  • New Features
    • Checkbox in the Obsidian export dialog to include or exclude the transcript.
    • Transcript is formatted with speaker labels and added to the end of the exported note if selected.

Copy link

coderabbitai bot commented Aug 6, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

A new feature was added to the Share button in the desktop app, allowing users to optionally include a formatted transcript when exporting notes to Obsidian. This includes UI changes for toggling transcript inclusion, updates to the export handler, and new helper functions for transcript formatting and speaker labeling. Additionally, inline comments were added to clarify participant synchronization logic in the note route without changing functionality.

Changes

Cohort / File(s) Change Summary
Share Button & Export Logic
apps/desktop/src/components/toolbar/buttons/share-button.tsx
Added includeTranscript state and UI checkbox; updated Obsidian export handler to accept and process transcript inclusion; introduced convertWordsToTranscript and getSpeakerLabel helpers for formatting transcript and speaker labels.
Note Route Comments
apps/desktop/src/routes/app.note.$id.tsx
Added inline comments clarifying variable roles in participant synchronization logic in the beforeLoad hook without altering code behavior.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ShareButtonInNote
    participant ExportHandlers
    participant ObsidianExport
    participant Helpers

    User->>ShareButtonInNote: Clicks Share Button
    ShareButtonInNote->>ShareButtonInNote: Shows Obsidian export UI with transcript checkbox
    User->>ShareButtonInNote: Selects folder, toggles "Include Transcript"
    ShareButtonInNote->>ExportHandlers: Calls obsidian(note, folder, includeTranscript)
    ExportHandlers->>ObsidianExport: Prepares markdown export
    alt includeTranscript is true
        ObsidianExport->>Helpers: convertWordsToTranscript(words)
        Helpers->>ObsidianExport: Returns formatted transcript
        ObsidianExport->>ExportHandlers: Appends transcript to markdown
    end
    ExportHandlers->>ShareButtonInNote: Completes export
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Possibly related PRs

  • Minor fixes #1249: Adds clipboard copy feature to the share button component, modifying the same exportHandlers object but implementing a different export option.
  • Obsidian upgrade #1170: Enhances folder selection, frontmatter metadata, and data fetching for the Obsidian export in the share button component, complementing the transcript inclusion feature.

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 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 de98544 and 59d6c2c.

📒 Files selected for processing (2)
  • apps/desktop/src/components/toolbar/buttons/share-button.tsx (6 hunks)
  • apps/desktop/src/routes/app.note.$id.tsx (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • apps/desktop/src/routes/app.note.$id.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/desktop/src/components/toolbar/buttons/share-button.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 (windows, windows-latest)
  • GitHub Check: ci (macos, macos-latest)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch obsidian-upgrade-2

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

Support

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

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

@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: 2

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 52a4314 and de98544.

📒 Files selected for processing (1)
  • apps/desktop/src/components/toolbar/buttons/share-button.tsx (6 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/toolbar/buttons/share-button.tsx
🔇 Additional comments (4)
apps/desktop/src/components/toolbar/buttons/share-button.tsx (4)

41-41: LGTM!

The new state variable is properly initialized and follows React conventions.


189-189: LGTM!

The includeTranscript parameter is correctly passed through and has a proper default value.

Also applies to: 448-448


325-359: LGTM!

The UI implementation for the transcript toggle is well-structured with proper labeling and state management.


471-479: LGTM!

The conditional transcript appending logic is correct and properly checks for both the flag and the existence of word data before processing.

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

1 issue found across 1 file • Review in cubic

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

|| (currentSpeaker?.type === "unassigned" && word.speaker?.type === "unassigned"
&& currentSpeaker.value.index === word.speaker.value.index)
|| (currentSpeaker?.type === "assigned" && word.speaker?.type === "assigned"
&& currentSpeaker.value.id === word.speaker.value.id);
Copy link

Choose a reason for hiding this comment

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

currentSpeaker.value or word.speaker.value can be undefined, so accessing .id risks a runtime crash. Add optional-chaining before dereferencing.

Prompt for AI agents
Address the following comment on apps/desktop/src/components/toolbar/buttons/share-button.tsx at line 604:

<comment>currentSpeaker.value or word.speaker.value can be undefined, so accessing .id risks a runtime crash. Add optional-chaining before dereferencing.</comment>

<file context>
@@ -561,3 +586,59 @@ async function fetchObsidianFolders(): Promise&lt;ObsidianFolder[]&gt; {
     return [{ value: &quot;default&quot;, label: &quot;Default (Root)&quot; }];
   }
 }
+
+function convertWordsToTranscript(words: any[]): string {
+  if (!words || words.length === 0) {
+    return &quot;&quot;;
+  }
+
</file context>
Suggested change
&& currentSpeaker.value.id === word.speaker.value.id);
&& currentSpeaker?.value?.id === word.speaker?.value?.id);

@duckduckhero duckduckhero merged commit c1878f7 into main Aug 6, 2025
7 checks passed
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