Skip to content

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

Python

Convert the Upload view into a real modal — uses the design-system modal primitives (modal-overlay + modal-panel--lg + modal-header + modal-body + modal-close) so it now overlays the existing list / detail view instead of replacing them with a full-screen takeover; backdrop click and Escape both dismiss via the new closeUploadView() action in ui.js which restores currentView to 'detail' if a recording was open behind it or null (empty/list) otherwise; the upload-view include moved out of <main> into a sibling spot alongside the other modals so it can overlay the whole app chrome; all existing entry points (the header's New Recording button, sidebar's + button, empty-state CTA, modals.js auto-open) continue to call switchToUploadView() unchanged — only the rendering switched from inline view to modal overlay; content is otherwise unchanged this commit (file picker, microphone / system audio / mic+system buttons, folder, tags, advanced ASR options) — progressive disclosure and content polish come in follow-up commits

Murtaza Nasir171db227f0c7
diff --git a/static/js/modules/composables/ui.js b/static/js/modules/composables/ui.js
index 9a821d8c..d0ab1852 100644
--- a/static/js/modules/composables/ui.js
+++ b/static/js/modules/composables/ui.js
@@ -187,6 +187,15 @@ export function useUI(state, utils, processedTranscription) {
currentView.value = 'detail';
};
+ // Close the upload modal. If a recording was already open behind it,
+ // return to its detail view; otherwise drop back to the empty/list
+ // state by clearing currentView. Mirrors the "previous view" mental
+ // model the user has when dismissing a modal.
+ const closeUploadView = () => {
+ if (currentView.value !== 'upload') return;
+ currentView.value = selectedRecording.value ? 'detail' : null;
+ };
+
// Switch to recording view
const switchToRecordingView = () => {
currentView.value = 'recording';
@@ -2042,6 +2051,7 @@ export function useUI(state, utils, processedTranscription) {
initializeSidebar,
switchToUploadView,
switchToDetailView,
+ closeUploadView,
switchToRecordingView,
setGlobalError,
formatFileSize,
diff --git a/templates/components/upload-view.html b/templates/components/upload-view.html
index 1355f70a..b7c1c11c 100644
--- a/templates/components/upload-view.html
+++ b/templates/components/upload-view.html
@@ -1,15 +1,23 @@
-<!-- Upload View -->
-<div v-if="currentView === 'upload'" class="flex-1 flex items-center justify-center p-4 md:p-8 overflow-y-auto">
- <div class="max-w-lg w-full my-auto">
- <!-- Compact Header -->
- <div class="text-center mb-3">
- <h2 class="text-lg font-semibold flex items-center justify-center gap-2">
- <i class="fas fa-microphone text-[var(--text-accent)]"></i>
- <span v-text="t('upload.title')"></span>
- </h2>
+<!-- Upload View — rendered as a modal (overlay + panel) instead of the
+ previous full-screen takeover. The Vue gate is currentView ==='upload'
+ so the existing switchToUploadView entrypoints stay unchanged; closing
+ the modal calls closeUploadView() which restores currentView to either
+ 'detail' (if a recording is open behind it) or null (drops back to
+ the empty/list view). Backdrop-click and Esc both dismiss. -->
+<div v-if="currentView === 'upload'"
+ @click.self="closeUploadView"
+ @keydown.esc="closeUploadView"
+ tabindex="-1"
+ class="modal-overlay">
+ <div class="modal-panel modal-panel--lg" style="max-height: 92vh;">
+ <div class="modal-header">
+ <i class="fas fa-microphone text-[var(--text-accent)]"></i>
+ <h3 class="modal-title" v-text="t('upload.title')"></h3>
+ <button @click="closeUploadView" class="modal-close" :title="t('buttons.close')">
+ <i class="fas fa-times"></i>
+ </button>
</div>
-
- <div class="bg-[var(--bg-secondary)] p-4 md:p-6 rounded-xl border border-[var(--border-primary)]">
+ <div class="modal-body">
<!-- File Upload Area -->
<div @drop="handleDrop" @dragover="handleDragOver" @dragleave="handleDragLeave" @click="$refs.fileInput.click()"
:class="['border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-all duration-300', dragover ? 'border-[var(--border-accent)] bg-[var(--bg-accent)]' : 'border-[var(--border-secondary)] hover:border-[var(--border-accent)]']">
diff --git a/templates/index.html b/templates/index.html
index 0b95852c..771db2e4 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -79,8 +79,6 @@
<main :class="['flex-1 flex flex-col overflow-hidden main-content', !isSidebarCollapsed && !isMobileScreen ? 'sidebar-open' : '']">
<!-- Custom Banner -->
{% include 'components/banner.html' %}
- <!-- Upload View -->
- {% include 'components/upload-view.html' %}
<!-- Recording View -->
{% include 'components/recording-view.html' %}
@@ -90,6 +88,12 @@
</main>
</div>
+ <!-- Upload View — now a real modal so the underlying view (list
+ or detail) stays visible behind the backdrop. Lives outside
+ <main> alongside the other modals so it overlays the whole
+ chrome. -->
+ {% include 'components/upload-view.html' %}
+
<!-- Upload Progress Popup -->
{% include 'components/progress-popup.html' %}