Skip to content

Make speaker rename actually land in every transcript#19

Merged
execsumo merged 1 commit into
masterfrom
claude/speaker-name-transcript-replace-0U8cW
May 22, 2026
Merged

Make speaker rename actually land in every transcript#19
execsumo merged 1 commit into
masterfrom
claude/speaker-name-transcript-replace-0U8cW

Conversation

@execsumo

Copy link
Copy Markdown
Owner

The popup save and the Speakers settings tab both relied on a single
directory scan to rewrite Speaker_<hex> placeholders into real names,
and the popup's "specific transcript" fallback only ran when the
transcript's directory differed from the configured output dir. That
made the rename quietly skip the file whenever a URL-comparison quirk
(symlink resolution, trailing-slash normalization, etc.) made the two
URLs compare unequal in one direction but equal in the other — leaving
Speaker_ABC123 in the saved .md even after the user named the speaker.

  • Centralize the rewrite in rewriteSpeakerAcrossTranscripts, used by
    the popup save, the Speakers tab inline rename, and the merge action.
    In addition to scanning the output directory, also walk every
    transcriptPath tracked by the pipeline queue so a moved output
    folder doesn't strand old transcripts.
  • In saveSpeakerName, always rewrite candidate.transcriptPath
    unconditionally instead of only when the directory diverges from
    outputDir. The redundant pass is harmless thanks to the new no-op
    short-circuit below.
  • In TranscriptWriter.renameSpeaker, skip the disk write when the
    rebuilt content matches what's already on disk. The defensive scans
    now hit many transcripts that don't contain the placeholder, and
    rewriting unchanged files just churns the FS.
  • Add tests that pin down the production Speaker_<hex> placeholder
    format (the existing tests only covered "Speaker 7" with a space) and
    verify the file-targeted rename + idempotency.

The popup save and the Speakers settings tab both relied on a single
directory scan to rewrite `Speaker_<hex>` placeholders into real names,
and the popup's "specific transcript" fallback only ran when the
transcript's directory differed from the configured output dir. That
made the rename quietly skip the file whenever a URL-comparison quirk
(symlink resolution, trailing-slash normalization, etc.) made the two
URLs compare unequal in one direction but equal in the other — leaving
`Speaker_ABC123` in the saved .md even after the user named the speaker.

- Centralize the rewrite in `rewriteSpeakerAcrossTranscripts`, used by
  the popup save, the Speakers tab inline rename, and the merge action.
  In addition to scanning the output directory, also walk every
  `transcriptPath` tracked by the pipeline queue so a moved output
  folder doesn't strand old transcripts.
- In `saveSpeakerName`, always rewrite `candidate.transcriptPath`
  unconditionally instead of only when the directory diverges from
  `outputDir`. The redundant pass is harmless thanks to the new no-op
  short-circuit below.
- In `TranscriptWriter.renameSpeaker`, skip the disk write when the
  rebuilt content matches what's already on disk. The defensive scans
  now hit many transcripts that don't contain the placeholder, and
  rewriting unchanged files just churns the FS.
- Add tests that pin down the production `Speaker_<hex>` placeholder
  format (the existing tests only covered "Speaker 7" with a space) and
  verify the file-targeted rename + idempotency.
@execsumo
execsumo merged commit b0daadf into master May 22, 2026
3 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.

2 participants