Speakr is a personal, self-hosted web application designed for transcribing audio recordings
Python
Improve bulk action bar UX: vertical floating design, persist selection, fix modal z-index
Murtaza Nasirc5f7ce582eb8
diff --git a/static/css/styles.css b/static/css/styles.cssindex c883613e..d53f7490 100644--- a/static/css/styles.css+++ b/static/css/styles.css@@ -1822,6 +1822,17 @@ body {transform: translateY(100%);}+/* Vue transition for slide-right (vertical bulk action bar) */+.slide-right-enter-active,+.slide-right-leave-active {+ transition: transform 0.3s ease, opacity 0.3s ease;+}+.slide-right-enter-from,+.slide-right-leave-to {+ transform: translateX(-100%) translateY(-50%);+ opacity: 0;+}+.follow-player-control .follow-icon {font-size: 11px;flex-shrink: 0;diff --git a/static/js/modules/composables/bulk-operations.js b/static/js/modules/composables/bulk-operations.jsindex 0dd30f68..5631e5e6 100644--- a/static/js/modules/composables/bulk-operations.js+++ b/static/js/modules/composables/bulk-operations.js@@ -14,7 +14,6 @@ export function useBulkOperations({availableTags,showToast,setGlobalError,- exitSelectionMode,startReprocessingPoll}) {// Modal state@@ -79,10 +78,11 @@ export function useBulkOperations({selectedRecording.value = null;}+ // Remove deleted IDs from selection+ deletedIds.forEach(id => selectedRecordingIds.value.delete(id));+const count = deletedIds.size;showToast(`${count} recording${count !== 1 ? 's' : ''} deleted`, 'fa-trash', 3000, 'success');-- exitSelectionMode();} catch (error) {console.error('Bulk delete error:', error);setGlobalError(`Failed to delete recordings: ${error.message}`);@@ -181,8 +181,6 @@ export function useBulkOperations({const count = data.affected_ids?.length || ids.length;const actionText = action === 'add' ? 'added to' : 'removed from';showToast(`Tag ${actionText} ${count} recording${count !== 1 ? 's' : ''}`, 'fa-tags', 3000, 'success');-- exitSelectionMode();} catch (error) {console.error('Bulk tag error:', error);setGlobalError(`Failed to ${action} tag: ${error.message}`);@@ -251,8 +249,6 @@ export function useBulkOperations({const count = queuedIds.size;const typeText = bulkReprocessType.value === 'transcription' ? 'Transcription' : 'Summary';showToast(`${typeText} reprocessing queued for ${count} recording${count !== 1 ? 's' : ''}`, 'fa-sync-alt', 3000, 'success');-- exitSelectionMode();} catch (error) {console.error('Bulk reprocess error:', error);setGlobalError(`Failed to queue reprocessing: ${error.message}`);@@ -312,8 +308,6 @@ export function useBulkOperations({const count = affectedIds.size;const actionText = value ? 'added to' : 'removed from';showToast(`${count} recording${count !== 1 ? 's' : ''} ${actionText} inbox`, 'fa-inbox', 3000, 'success');-- exitSelectionMode();} catch (error) {console.error('Bulk toggle inbox error:', error);setGlobalError(`Failed to update inbox status: ${error.message}`);@@ -369,8 +363,6 @@ export function useBulkOperations({const count = affectedIds.size;const actionText = value ? 'highlighted' : 'unhighlighted';showToast(`${count} recording${count !== 1 ? 's' : ''} ${actionText}`, 'fa-star', 3000, 'success');-- exitSelectionMode();} catch (error) {console.error('Bulk toggle highlight error:', error);setGlobalError(`Failed to update highlight status: ${error.message}`);diff --git a/templates/components/sidebar.html b/templates/components/sidebar.htmlindex 37e5e663..367f9f4b 100644--- a/templates/components/sidebar.html+++ b/templates/components/sidebar.html@@ -464,5 +464,55 @@</div></div></div>+</div></aside>++<!-- Vertical Floating Bulk Action Bar - To the right of sidebar -->+<transition name="slide-right">+ <div v-if="selectionMode && selectedCount > 0 && !isSidebarCollapsed"+ class="fixed top-1/2 -translate-y-1/2 left-80 z-50 flex flex-col gap-1 p-2 bg-[var(--bg-secondary)] border border-[var(--border-primary)] rounded-r-xl shadow-lg">+ <!-- Selection count badge -->+ <div class="text-center text-xs font-medium text-[var(--text-accent)] py-1 border-b border-[var(--border-primary)] mb-1">+ ${ selectedCount }+ </div>++ <button @click="openBulkTagModal('add')"+ class="w-10 h-10 flex items-center justify-center bg-[var(--bg-tertiary)] hover:bg-[var(--bg-input)] rounded-lg transition-colors border border-[var(--border-secondary)]"+ title="Add or remove tags">+ <i class="fas fa-tags text-[var(--text-muted)]"></i>+ </button>++ <button @click="bulkToggleInbox()"+ class="w-10 h-10 flex items-center justify-center bg-[var(--bg-tertiary)] hover:bg-[var(--bg-input)] rounded-lg transition-colors border border-[var(--border-secondary)]"+ title="Toggle inbox status">+ <i class="fas fa-inbox text-blue-500"></i>+ </button>++ <button @click="bulkToggleHighlight()"+ class="w-10 h-10 flex items-center justify-center bg-[var(--bg-tertiary)] hover:bg-[var(--bg-input)] rounded-lg transition-colors border border-[var(--border-secondary)]"+ title="Toggle highlight">+ <i class="fas fa-star text-amber-500"></i>+ </button>++ <button @click="openBulkReprocessModal"+ class="w-10 h-10 flex items-center justify-center bg-[var(--bg-tertiary)] hover:bg-[var(--bg-input)] rounded-lg transition-colors border border-[var(--border-secondary)]"+ title="Reprocess">+ <i class="fas fa-redo text-[var(--text-muted)]"></i>+ </button>++ <div class="border-t border-[var(--border-primary)] my-1"></div>++ <button @click="openBulkDeleteModal"+ class="w-10 h-10 flex items-center justify-center bg-red-600 hover:bg-red-700 text-white rounded-lg transition-colors"+ title="Delete selected">+ <i class="fas fa-trash"></i>+ </button>++ <button @click="exitSelectionMode"+ class="w-10 h-10 flex items-center justify-center text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-tertiary)] rounded-lg transition-colors"+ title="Exit selection mode">+ <i class="fas fa-times"></i>+ </button>+ </div>+</transition>diff --git a/templates/index.html b/templates/index.htmlindex fa9ee068..69afb5ed 100644--- a/templates/index.html+++ b/templates/index.html@@ -107,8 +107,7 @@{% include 'modals/global-error.html' %}{% include 'modals/toast-container.html' %}- <!-- Bulk Operations -->- {% include 'modals/bulk-action-bar.html' %}+ <!-- Bulk Operations Modals -->{% include 'modals/bulk-delete-modal.html' %}{% include 'modals/bulk-tag-modal.html' %}{% include 'modals/bulk-reprocess-modal.html' %}diff --git a/templates/modals/bulk-action-bar.html b/templates/modals/bulk-action-bar.htmlindex 7252d5ff..572433c2 100644--- a/templates/modals/bulk-action-bar.html+++ b/templates/modals/bulk-action-bar.html@@ -1,73 +1,67 @@-<!-- Bulk Action Bar - Fixed at bottom when in selection mode -->+<!-- Bulk Action Bar - Fixed at bottom of sidebar when in selection mode --><transition name="slide-up"><div v-if="selectionMode && selectedCount > 0"- class="fixed bottom-0 left-0 right-0 bg-[var(--bg-secondary)] border-t border-[var(--border-primary)] shadow-lg z-50 transform transition-transform duration-300"- :class="{ 'translate-y-full': bulkActionInProgress }">- <div class="max-w-4xl mx-auto px-4 py-3">- <div class="flex items-center justify-between gap-4">- <!-- Selection info -->- <div class="flex items-center gap-3">+ class="fixed bottom-0 left-0 w-80 bg-[var(--bg-secondary)] border-t border-r border-[var(--border-primary)] shadow-lg z-50 transform transition-transform duration-300"+ :class="[+ { 'translate-y-full': bulkActionInProgress },+ isSidebarCollapsed ? '-translate-x-full' : ''+ ]">+ <div class="px-3 py-2">+ <!-- Compact vertical layout for sidebar width -->+ <div class="flex flex-col gap-2">+ <!-- Selection info row -->+ <div class="flex items-center justify-between"><span class="text-sm font-medium text-[var(--text-primary)]">${ selectedCount } selected</span>- <button @click="selectAll"- v-if="!allVisibleSelected"- class="text-xs text-[var(--text-accent)] hover:underline">- Select all- </button>- <button @click="clearSelection"- class="text-xs text-[var(--text-muted)] hover:text-[var(--text-primary)]">- Clear- </button>+ <div class="flex items-center gap-2">+ <button @click="allVisibleSelected ? clearSelection() : selectAll()"+ class="text-xs text-[var(--text-accent)] hover:underline">+ ${ allVisibleSelected ? 'Clear' : 'All' }+ </button>+ <button @click="exitSelectionMode"+ class="p-1 text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-tertiary)] rounded transition-colors"+ title="Exit selection mode">+ <i class="fas fa-times text-xs"></i>+ </button>+ </div></div>- <!-- Action buttons -->- <div class="flex items-center gap-2">- <!-- Tags -->+ <!-- Action buttons row -->+ <div class="flex items-center justify-between gap-1"><button @click="openBulkTagModal('add')"- class="px-3 py-2 text-sm bg-[var(--bg-tertiary)] hover:bg-[var(--bg-input)] rounded-lg transition-colors flex items-center gap-2"+ class="flex-1 px-2 py-1.5 text-xs bg-[var(--bg-tertiary)] hover:bg-[var(--bg-input)] rounded-md transition-colors flex items-center justify-center gap-1"title="Add or remove tags"><i class="fas fa-tags text-[var(--text-muted)]"></i>- <span class="hidden sm:inline">Tags</span>+ <span>Tags</span></button>- <!-- Inbox Toggle --><button @click="bulkToggleInbox()"- class="px-3 py-2 text-sm bg-[var(--bg-tertiary)] hover:bg-[var(--bg-input)] rounded-lg transition-colors flex items-center gap-2"+ class="flex-1 px-2 py-1.5 text-xs bg-[var(--bg-tertiary)] hover:bg-[var(--bg-input)] rounded-md transition-colors flex items-center justify-center gap-1"title="Toggle inbox status"><i class="fas fa-inbox text-blue-500"></i>- <span class="hidden sm:inline">Inbox</span>+ <span>Inbox</span></button>- <!-- Star Toggle --><button @click="bulkToggleHighlight()"- class="px-3 py-2 text-sm bg-[var(--bg-tertiary)] hover:bg-[var(--bg-input)] rounded-lg transition-colors flex items-center gap-2"+ class="flex-1 px-2 py-1.5 text-xs bg-[var(--bg-tertiary)] hover:bg-[var(--bg-input)] rounded-md transition-colors flex items-center justify-center gap-1"title="Toggle highlight"><i class="fas fa-star text-amber-500"></i>- <span class="hidden sm:inline">Star</span>+ <span>Star</span></button>- <!-- Reprocess --><button @click="openBulkReprocessModal"- class="px-3 py-2 text-sm bg-[var(--bg-tertiary)] hover:bg-[var(--bg-input)] rounded-lg transition-colors flex items-center gap-2"- title="Reprocess transcription or summary">+ class="flex-1 px-2 py-1.5 text-xs bg-[var(--bg-tertiary)] hover:bg-[var(--bg-input)] rounded-md transition-colors flex items-center justify-center gap-1"+ title="Reprocess"><i class="fas fa-redo text-[var(--text-muted)]"></i>- <span class="hidden sm:inline">Reprocess</span>+ <span>Redo</span></button>- <!-- Delete --><button @click="openBulkDeleteModal"- class="px-3 py-2 text-sm bg-red-600 hover:bg-red-700 text-white rounded-lg transition-colors flex items-center gap-2"- title="Delete selected recordings">+ class="flex-1 px-2 py-1.5 text-xs bg-red-600 hover:bg-red-700 text-white rounded-md transition-colors flex items-center justify-center gap-1"+ title="Delete selected"><i class="fas fa-trash"></i>- <span class="hidden sm:inline">Delete</span>- </button>-- <!-- Close selection mode -->- <button @click="exitSelectionMode"- class="px-2 py-2 text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--bg-tertiary)] rounded-lg transition-colors ml-2"- title="Exit selection mode">- <i class="fas fa-times"></i>+ <span>Delete</span></button></div></div>@@ -76,9 +70,9 @@<!-- Loading overlay --><div v-if="bulkActionInProgress"class="absolute inset-0 bg-[var(--bg-secondary)] bg-opacity-80 flex items-center justify-center">- <div class="flex items-center gap-3">- <i class="fas fa-spinner fa-spin text-lg text-[var(--text-accent)]"></i>- <span class="text-sm text-[var(--text-secondary)]">Processing...</span>+ <div class="flex items-center gap-2">+ <i class="fas fa-spinner fa-spin text-[var(--text-accent)]"></i>+ <span class="text-xs text-[var(--text-secondary)]">Processing...</span></div></div></div>diff --git a/templates/modals/bulk-delete-modal.html b/templates/modals/bulk-delete-modal.htmlindex 1731f4c6..e3326529 100644--- a/templates/modals/bulk-delete-modal.html+++ b/templates/modals/bulk-delete-modal.html@@ -1,5 +1,5 @@<!-- Bulk Delete Confirmation Modal -->-<div v-if="showBulkDeleteModal" @click.self="closeBulkDeleteModal" class="fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-50 p-4 backdrop-blur-sm">+<div v-if="showBulkDeleteModal" @click.self="closeBulkDeleteModal" class="fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-[100] p-4 backdrop-blur-sm"><div class="bg-[var(--bg-secondary)] rounded-lg shadow-xl w-full max-w-md"><div class="p-6"><div class="flex items-center justify-between mb-4">diff --git a/templates/modals/bulk-reprocess-modal.html b/templates/modals/bulk-reprocess-modal.htmlindex 0b6b9ffe..66d01dfa 100644--- a/templates/modals/bulk-reprocess-modal.html+++ b/templates/modals/bulk-reprocess-modal.html@@ -1,5 +1,5 @@<!-- Bulk Reprocess Modal -->-<div v-if="showBulkReprocessModal" @click.self="closeBulkReprocessModal" class="fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-50 p-4 backdrop-blur-sm">+<div v-if="showBulkReprocessModal" @click.self="closeBulkReprocessModal" class="fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-[100] p-4 backdrop-blur-sm"><div class="bg-[var(--bg-secondary)] rounded-xl shadow-2xl w-full max-w-md"><div class="p-6 border-b border-[var(--border-primary)]"><div class="flex items-center justify-between">diff --git a/templates/modals/bulk-tag-modal.html b/templates/modals/bulk-tag-modal.htmlindex fa73b456..028f0a67 100644--- a/templates/modals/bulk-tag-modal.html+++ b/templates/modals/bulk-tag-modal.html@@ -1,5 +1,5 @@<!-- Bulk Tag Modal -->-<div v-if="showBulkTagModal" @click.self="closeBulkTagModal" class="fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-50 p-4 backdrop-blur-sm">+<div v-if="showBulkTagModal" @click.self="closeBulkTagModal" class="fixed inset-0 bg-black bg-opacity-70 flex items-center justify-center z-[100] p-4 backdrop-blur-sm"><div class="bg-[var(--bg-secondary)] rounded-xl shadow-2xl w-full max-w-md max-h-[80vh] flex flex-col"><div class="p-6 border-b border-[var(--border-primary)] flex-shrink-0"><div class="flex items-center justify-between">