Skip to content

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

Python

Speaker modal: revert HEADER + FOOTER + restore modal-content class to exact v0.8.21 markup — actual side-by-side diff found three more genuine regressions I had missed; (1) the main content div was supposed to carry the .modal-content class which supplies max-height: calc(100vh - 200px) + overflow-y: auto from styles.css — I removed it in an earlier 'fix' thinking it was fighting the layout, but it was actually load-bearing for the virtual-scroll container size (the user remembers it working in v0.8.21 because v0.8.21 had this class); (2) the header was using the new .modal-header primitive with different padding (var(--sp-4) var(--sp-5)) and a separate banner sibling for the >16 speakers warning — v0.8.21 nested the warning INSIDE the header div with p-3 sm:p-5; restored the exact v0.8.21 header markup; (3) the footer was using .modal-footer modal-footer--between primitive — v0.8.21 used custom 'bg-tertiary px-3 sm:px-6 py-2 sm:py-4 flex flex-row justify-between rounded-b-xl' chrome with the original purple split-button and gradient apply-suggested button; restored to exact v0.8.21; net effect: the speaker-modal.html is now BYTE-for-byte the v0.8.21 markup with the only addition being the video-collapse toggle I added recently (kept because it's user-requested functionality); SW cache bumped to v6 so users pick up the new modal template via the cached homepage HTML; this is the last big revert — if it's still buggy after a hard SW refresh, the bug is somewhere else and we'll need to actually instrument scroll events to find it

Murtaza Nasirc76b4e3eebe0
diff --git a/static/sw.js b/static/sw.js
index 33a5e68d..b475ce82 100644
--- a/static/sw.js
+++ b/static/sw.js
@@ -4,7 +4,7 @@
// stale code even after a hard refresh. Forgetting to bump this was what
// made the speaker-modal scroll fixes appear to do nothing: the SW kept
// serving the broken pre-fix app.modular.js.
-const CACHE_NAME = 'Speakr-cache-v5';
+const CACHE_NAME = 'Speakr-cache-v6';
const ASSETS_TO_CACHE = [
'/',
'/static/offline.html',
diff --git a/templates/modals/speaker-modal.html b/templates/modals/speaker-modal.html
index c0b92942..d1e7ee50 100644
--- a/templates/modals/speaker-modal.html
+++ b/templates/modals/speaker-modal.html
@@ -14,15 +14,27 @@
the rest of the app is preserved. -->
<div v-if="showSpeakerModal" @click.self="closeSpeakerModal" class="fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-50 p-2 sm:p-4 backdrop-blur-sm">
<div @click="closeSpeakerSuggestionsOnClick" class="bg-[var(--bg-secondary)] rounded-xl shadow-2xl w-full max-w-4xl flex flex-col h-[95vh] sm:h-[85vh]">
- <div class="modal-header">
- <h3 class="modal-title" v-text="t('modal.identifySpeakers')"></h3>
- <button @click="closeSpeakerModal" class="modal-close" :title="t('buttons.close')"><i class="fas fa-times"></i></button>
- </div>
- <div v-if="modalSpeakers.length > 16" class="banner banner--warn" style="display: flex; align-items: flex-start; gap: var(--sp-2); margin: var(--sp-3) var(--sp-5) 0;">
- <i class="fas fa-exclamation-triangle" style="margin-top: 2px;"></i>
- <div>
- <div class="t-body-strong" v-text="t('help.moreSpeakersThanColors')"></div>
- <div class="t-meta mt-1" v-text="t('help.youHaveXSpeakers', { count: modalSpeakers.length })"></div>
+ <!-- Header — kept as v0.8.21 raw Tailwind, NOT the modal-header
+ primitive, because the primitive has different padding and
+ a different flex behaviour that affected the heights the
+ virtual-scroll relies on. -->
+ <div class="p-3 sm:p-5 border-b border-[var(--border-primary)] flex-shrink-0">
+ <div class="flex items-center justify-between">
+ <h3 class="text-base sm:text-xl font-bold text-[var(--text-primary)]" v-text="t('modal.identifySpeakers')"></h3>
+ <button @click="closeSpeakerModal" class="text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors">
+ <i class="fas fa-times text-xl"></i>
+ </button>
+ </div>
+ <!-- Warning for too many speakers -->
+ <div v-if="modalSpeakers.length > 16" class="mt-3 p-3 bg-[var(--bg-warn-light)] border border-amber-300 dark:border-amber-800 rounded-lg">
+ <div class="flex items-start">
+ <i class="fas fa-exclamation-triangle text-[var(--text-warn-strong)] mt-0.5 mr-2"></i>
+ <div class="text-sm">
+ <p class="font-medium text-[var(--text-warn-strong)]" v-text="t('help.moreSpeakersThanColors')"></p>
+ <p class="text-[var(--text-warn-strong)] mt-1" v-text="t('help.youHaveXSpeakers', { count: modalSpeakers.length })">
+ </p>
+ </div>
+ </div>
</div>
</div>
@@ -45,17 +57,13 @@
</div>
<!-- Main Content - Tab-based on mobile, side-by-side on desktop.
- modal-content class intentionally REMOVED: it carries
- 'max-height: calc(100vh - 200px); overflow-y: auto' from
- styles.css that fought the new .modal-panel flex-column
- layout — it introduced a SECOND scrollable container
- between the modal panel and the transcript pane, making
- the transcript's clientHeight unstable and feeding back
- into virtualScroll's range recompute. With it removed the
- flex-grow takes the natural remaining height of the
- modal-panel and the only scrollable container is the
- transcript pane itself. -->
- <div class="flex-grow flex flex-col lg:flex-row overflow-hidden">
+ modal-content class is REQUIRED here — v0.8.21-alpha had it
+ and I incorrectly removed it earlier when chasing a
+ different bug. The class supplies max-height + overflow-y:
+ auto from styles.css which give the content area a stable
+ scrollable boundary for the virtual-scroll'd transcript
+ pane to size against. Don't remove it again. -->
+ <div class="flex-grow flex flex-col lg:flex-row overflow-hidden modal-content">
<!-- Speaker List Panel - shown on mobile when speakers tab active, always on desktop -->
<div class="lg:w-1/3 p-3 sm:p-6 space-y-2 sm:space-y-4 overflow-y-auto custom-scrollbar lg:border-r border-[var(--border-primary)]"
:class="{ 'hidden lg:block': speakerModalTab !== 'speakers', 'flex-1': speakerModalTab === 'speakers' }">
@@ -350,33 +358,53 @@
</label>
</div>
- <div class="modal-footer modal-footer--between">
+ <!-- Footer — kept as v0.8.21 raw Tailwind, NOT the modal-footer
+ primitive, for the same height-stability reason as the
+ header above. -->
+ <div class="bg-[var(--bg-tertiary)] px-3 sm:px-6 py-2 sm:py-4 flex flex-row justify-between items-center gap-2 border-t border-[var(--border-primary)] flex-shrink-0 rounded-b-xl">
+ <!-- Left: Auto Identify Split Button + Apply Suggested -->
<div class="flex items-center gap-2">
+ <!-- Split Button: Auto Identify -->
<div class="relative inline-flex" ref="autoIdSplitBtn">
- <button @click="autoIdentifySpeakers(false)" class="btn btn--primary" style="border-top-right-radius: 0; border-bottom-right-radius: 0;" :disabled="isAutoIdentifying">
- <i class="fas fa-magic"></i>
+ <!-- Main button: identify missing only -->
+ <button @click="autoIdentifySpeakers(false)" class="px-2 sm:px-3 py-1.5 sm:py-2 bg-purple-600 text-white rounded-l-md hover:bg-purple-700 active:scale-[0.98] transition-all flex items-center justify-center text-xs sm:text-sm font-medium" :disabled="isAutoIdentifying">
+ <i class="fas fa-magic mr-1 sm:mr-1.5"></i>
<span v-if="!isAutoIdentifying" class="hidden sm:inline" v-text="t('help.autoIdentify')"></span>
<span v-if="!isAutoIdentifying" class="sm:hidden" v-text="t('help.autoIdentifyMobile')"></span>
- <span v-else><div class="spinner"></div></span>
+ <span v-else>
+ <i class="fas fa-spinner fa-spin"></i>
+ </span>
</button>
- <button @click="showAutoIdDropdown = !showAutoIdDropdown" class="btn btn--primary btn--icon" style="border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid rgba(255,255,255,0.2);" :disabled="isAutoIdentifying">
+ <!-- Dropdown arrow -->
+ <button @click="showAutoIdDropdown = !showAutoIdDropdown" class="px-1.5 py-1.5 sm:py-2 bg-purple-600 text-white rounded-r-md border-l border-purple-500 hover:bg-purple-700 active:scale-[0.98] transition-all text-xs sm:text-sm" :disabled="isAutoIdentifying">
<i class="fas fa-caret-down"></i>
</button>
- <div v-if="showAutoIdDropdown" class="absolute bottom-full left-0 mb-1 surface-raised z-50" style="min-width: 200px;">
- <button @click="autoIdentifySpeakers(true)" class="w-full px-3 py-2 text-left text-sm hover:bg-[var(--bg-tertiary)] transition-colors">
+ <!-- Dropdown menu -->
+ <div v-if="showAutoIdDropdown" class="absolute bottom-full left-0 mb-1 bg-[var(--bg-secondary)] border border-[var(--border-primary)] rounded-md shadow-lg z-50 min-w-[180px]">
+ <button @click="autoIdentifySpeakers(true)" class="w-full px-3 py-2 text-left text-xs sm:text-sm text-[var(--text-primary)] hover:bg-[var(--bg-tertiary)] transition-colors rounded-md">
<i class="fas fa-users mr-2"></i><span v-text="t('help.identifyAllSpeakers')"></span>
</button>
</div>
</div>
- <button v-if="hasAnySuggestions" @click="applySuggestedNames" class="btn btn--primary">
- <i class="fas fa-lightbulb"></i>
+ <!-- Apply Suggested Button -->
+ <button v-if="hasAnySuggestions" @click="applySuggestedNames" class="px-2 sm:px-3 py-1.5 sm:py-2 bg-gradient-to-r from-blue-600 to-purple-600 text-white rounded-md hover:from-blue-700 hover:to-purple-700 active:scale-[0.98] transition-all flex items-center text-xs sm:text-sm font-medium">
+ <i class="fas fa-lightbulb mr-1 sm:mr-1.5"></i>
<span class="hidden sm:inline" v-text="t('help.applySuggested')"></span>
<span class="sm:hidden" v-text="t('help.applySuggestedMobile')"></span>
</button>
</div>
+ <!-- Right: Cancel & Save Buttons -->
<div class="flex gap-2">
- <button @click="closeSpeakerModal" class="btn btn--ghost" v-text="t('common.cancel')"></button>
- <button @click="saveSpeakerNames" :disabled="!hasSpeakerNames" class="btn btn--primary" v-text="t('buttons.saveNames')"></button>
+ <button @click="closeSpeakerModal" class="px-3 sm:px-4 py-1.5 sm:py-2 bg-[var(--bg-secondary)] text-[var(--text-secondary)] rounded-md border border-[var(--border-secondary)] hover:bg-[var(--bg-tertiary)] active:scale-[0.98] transition-all text-xs sm:text-sm" v-text="t('common.cancel')"></button>
+ <button
+ @click="saveSpeakerNames"
+ :disabled="!hasSpeakerNames"
+ class="px-3 sm:px-4 py-1.5 sm:py-2 rounded-md transition-all text-xs sm:text-sm font-medium active:scale-[0.98]"
+ :class="hasSpeakerNames
+ ? 'bg-[var(--bg-accent)] text-[var(--text-accent)] hover:bg-[var(--bg-accent-hover)] cursor-pointer'
+ : 'bg-gray-400 text-gray-200 cursor-not-allowed'"
+ v-text="t('buttons.saveNames')"
+ ></button>
</div>
</div>
</div>