Make speaker rename actually land in every transcript#19
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_ABC123in the saved .md even after the user named the speaker.rewriteSpeakerAcrossTranscripts, used bythe popup save, the Speakers tab inline rename, and the merge action.
In addition to scanning the output directory, also walk every
transcriptPathtracked by the pipeline queue so a moved outputfolder doesn't strand old transcripts.
saveSpeakerName, always rewritecandidate.transcriptPathunconditionally instead of only when the directory diverges from
outputDir. The redundant pass is harmless thanks to the new no-opshort-circuit below.
TranscriptWriter.renameSpeaker, skip the disk write when therebuilt 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.
Speaker_<hex>placeholderformat (the existing tests only covered "Speaker 7" with a space) and
verify the file-targeted rename + idempotency.