Skip to content

fix webapp copy transcript uses resolved speaker names instead of generic labels#5533

Merged
mdmohsin7 merged 2 commits intomainfrom
fix/webapp-copy-transcript-speaker-names
Mar 10, 2026
Merged

fix webapp copy transcript uses resolved speaker names instead of generic labels#5533
mdmohsin7 merged 2 commits intomainfrom
fix/webapp-copy-transcript-speaker-names

Conversation

@krushnarout
Copy link
Member

Summary

  • Copy transcript now uses tagged person names (e.g. "Marcus") instead of generic "Speaker 0/1/2"
  • Applies to both the conversations webapp and the memories chat context

Demo

Before

Screen.Recording.2026-03-10.at.8.22.39.AM.mov

After

Screen.Recording.2026-03-10.at.8.23.33.AM.mov

🤖 Generated with Claude Code

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 10, 2026

Greptile Summary

This PR improves the "copy transcript" feature and the AI chat context in both the conversations webapp and the memories frontend so that tagged person names (e.g. "Marcus") are shown instead of generic "Speaker 0/1/2" labels. The changes are minimal and well-scoped: the people lookup is threaded through existing prop chains and the fallback behavior (unknown person → speaker_name → generic label) is maintained for backward compatibility.

Key changes:

  • ConversationActionsMenu — accepts a new optional people prop and the generateTranscript helper now resolves person_id → name with a proper three-level fallback chain.
  • ConversationDetailPanel — passes the already-loaded people array (from usePeople()) into the actions menu.
  • chat.tsx (memories) — the inline transcriptText computation now resolves person names; however it is missing a useMemo wrapper, causing an O(n × m) re-computation on every render (including each keystroke in the input field).
  • memory-with-tabs.tsx — passes memory.people to the Chat component.

Notes:

  • The memory.types.ts TranscriptSegment does not include a speaker_name field, so the fallback logic in chat.tsx correctly omits that intermediate step, unlike ConversationActionsMenu.tsx where the conversation.ts type does define it.
  • Unrelated JSX reformatting and Tailwind class sorting are bundled into the chat.tsx diff, increasing noise but having no functional impact.

Confidence Score: 4/5

  • Safe to merge — the logic is functionally correct and backward-compatible; the only notable issue is a missing useMemo that affects performance but not correctness.
  • All four changes are small and well-targeted. The speaker-name resolution logic is correct across both apps, fallback chains are sound, and the optional people prop keeps everything backward-compatible. The sole concern is the missing useMemo around transcriptText in chat.tsx, which causes redundant O(n×m) work on every render but will not produce incorrect output.
  • web/frontend/src/components/memories/chat/chat.tsx — transcriptText should be wrapped in useMemo.

Important Files Changed

Filename Overview
web/app/src/components/conversations/ConversationActionsMenu.tsx Adds optional people prop and updates generateTranscript to resolve person_id → name with correct fallback chain (person.namespeaker_name → generic label). Logic is sound and backward-compatible.
web/app/src/components/conversations/ConversationDetailPanel.tsx One-line change that threads the already-available people array (from usePeople()) into ConversationActionsMenu. No issues.
web/frontend/src/components/memories/chat/chat.tsx People-aware speaker resolution added correctly, but transcriptText is computed inline without useMemo, causing unnecessary O(n×m) re-computation on every render (e.g. every keystroke in the input field). Also includes unrelated JSX reformatting and Tailwind class sorting.
web/frontend/src/components/memories/summary/memory-with-tabs.tsx One-line change that passes memory.people (already available on the Memory type) down to the Chat component. No issues.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Copy Transcript / Build Chat Context] --> B{segment.is_user?}
    B -- Yes --> C["Speaker = 'You' / 'Owner'"]
    B -- No --> D{segment.person_id AND people provided?}
    D -- Yes --> E[people.find p.id === segment.person_id]
    E -- Found --> F[Speaker = person.name]
    E -- Not Found --> G{ConversationActionsMenu only: segment.speaker_name?}
    G -- Yes --> H[Speaker = segment.speaker_name]
    G -- No --> I["Speaker = 'Speaker {speaker_id}'"]
    D -- No --> J{ConversationActionsMenu only: segment.speaker_name?}
    J -- Yes --> K[Speaker = segment.speaker_name]
    J -- No --> L["Speaker = 'Speaker {speaker_id}'"]
    C --> M[Append 'Speaker: text' line]
    F --> M
    H --> M
    I --> M
    K --> M
    L --> M
    M --> N[Join all lines with double newline]
Loading

Last reviewed commit: e2b8f89

@krushnarout krushnarout requested a review from mdmohsin7 March 10, 2026 03:05
@mdmohsin7 mdmohsin7 merged commit 63408f5 into main Mar 10, 2026
2 of 3 checks passed
@mdmohsin7 mdmohsin7 deleted the fix/webapp-copy-transcript-speaker-names branch March 10, 2026 07:10
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