Skip to content

Speakr is a personal, self-hosted web application designed for transcribing audio recordings

Python

Fix queue #2 — keep Identify Speakers highlight + nav alive across blur — the input's @blur handler (blurSpeaker) and the isMe checkbox's @blur=clearSpeakerHighlight were both clearing highlightedSpeaker the moment focus moved off the text input, so as soon as the user clicked the prev/next nav buttons the highlight disappeared and the buttons disabled themselves mid-walk; now the highlight is sticky — focusSpeaker overwrites it when the user focuses a DIFFERENT speaker's input, the navigate dropdown's default option clears it, and modal close clears it; the 200ms activeSpeakerInput timeout that protects the autocomplete suggestions dropdown from collapsing too early is preserved unchanged

Murtaza Nasiraa17d6f7b3d6
diff --git a/static/js/modules/composables/speakers.js b/static/js/modules/composables/speakers.js
index 9ab2f0ed..a9a1009f 100644
--- a/static/js/modules/composables/speakers.js
+++ b/static/js/modules/composables/speakers.js
@@ -724,12 +724,20 @@ export function useSpeakers(state, utils, processedTranscription) {
};
const blurSpeaker = () => {
- // Clear the active speaker input after a delay to allow clicking on suggestions
+ // Clear the active speaker input after a delay to allow clicking
+ // on suggestions before the dropdown collapses.
setTimeout(() => {
activeSpeakerInput.value = null;
speakerSuggestions.value = {};
}, 200);
- clearSpeakerHighlight();
+ // DO NOT clear the speaker highlight here. The highlight + the
+ // prev/next nav buttons should remain usable while the user
+ // walks through the speaker's segments — clicking Prev/Next
+ // moves focus off the input and would otherwise clear the
+ // navigation state mid-action. Highlight is now released only
+ // when a DIFFERENT speaker is focused (focusSpeaker overwrites
+ // highlightedSpeaker), the user picks the default "Navigate
+ // to speaker…" option, or the modal closes.
};
const clearSpeakerHighlight = () => {
diff --git a/templates/modals/speaker-modal.html b/templates/modals/speaker-modal.html
index 6d9f0aa5..9c91aee0 100644
--- a/templates/modals/speaker-modal.html
+++ b/templates/modals/speaker-modal.html
@@ -51,7 +51,6 @@
v-model="speakerMap[speaker].isMe"
@change="handleIsMeChange(speaker)"
@focus="highlightSpeakerInTranscript(speaker)"
- @blur="clearSpeakerHighlight"
class="speaker-checkbox w-4 h-4 sm:w-4 sm:h-4">
<span class="ml-1.5 select-none" v-text="t('help.me')"></span>
</label>