Skip to content

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

Python

feat: primary Upload button closes the upload modal after queuing; new 'Upload & Add More' secondary button keeps it open (close flag survives the disclaimer round-trip, reset on disclaimer cancel)

Murtaza Nasir5447648d00fe
diff --git a/static/js/app.modular.js b/static/js/app.modular.js
index 9c347c96..11742c13 100644
--- a/static/js/app.modular.js
+++ b/static/js/app.modular.js
@@ -2508,6 +2508,7 @@ document.addEventListener('DOMContentLoaded', async () => {
const cancelUploadDisclaimer = () => {
showUploadDisclaimerModal.value = false;
+ uploadComposable.cancelPendingUploadClose();
};
// Add startUpload to utils for audio composable to use
diff --git a/static/js/modules/composables/upload.js b/static/js/modules/composables/upload.js
index 9a9bd773..581e7dbd 100644
--- a/static/js/modules/composables/upload.js
+++ b/static/js/modules/composables/upload.js
@@ -366,9 +366,25 @@ export function useUpload(state, utils) {
};
// Start processing all queued files
+ // "Upload" closes the modal after queuing; "Upload & Add More" keeps it
+ // open. The flag survives the disclaimer round-trip (startUpload returns
+ // early, acceptUploadDisclaimer re-invokes it) and is reset when the
+ // disclaimer is cancelled (cancelPendingUploadClose).
+ let closeModalAfterUpload = false;
+
+ const startUploadAndClose = () => {
+ closeModalAfterUpload = true;
+ startUpload();
+ };
+
+ const cancelPendingUploadClose = () => {
+ closeModalAfterUpload = false;
+ };
+
const startUpload = () => {
const pendingFiles = uploadQueue.value.filter(item => item.status === 'queued');
if (pendingFiles.length === 0) {
+ closeModalAfterUpload = false;
return;
}
// Show upload disclaimer if configured
@@ -401,6 +417,10 @@ export function useUpload(state, utils) {
progressPopupMinimized.value = false;
progressPopupClosed.value = false;
startProcessingQueue();
+ if (closeModalAfterUpload) {
+ closeModalAfterUpload = false;
+ if (showUploadModal) showUploadModal.value = false;
+ }
};
// --- Parallel Upload System ---
@@ -1208,6 +1228,8 @@ export function useUpload(state, utils) {
cancelWaitingFile,
clearCompletedUploads,
startUpload,
+ startUploadAndClose,
+ cancelPendingUploadClose,
startProcessingQueue,
resetCurrentFileProcessingState,
startStatusPolling,
diff --git a/static/locales/de.json b/static/locales/de.json
index 40906b98..7155ad6a 100644
--- a/static/locales/de.json
+++ b/static/locales/de.json
@@ -1766,7 +1766,8 @@
"keepAudioOnlyLargerAllowed": "Größere Uploads erlaubt",
"largeVideoNotice": "Großes Videodatei. Upload wird fortgesetzt; Transkription dauert ggf. länger und nutzt das Chunking auf dem Server.",
"options": "Optionen",
- "transcriptionOptions": "Transkriptionsoptionen"
+ "transcriptionOptions": "Transkriptionsoptionen",
+ "uploadAndAddMore": "Hochladen & weitere hinzufügen"
},
"uploadProgress": {
"title": "Upload-Fortschritt"
diff --git a/static/locales/en.json b/static/locales/en.json
index c88eb676..ce3d4fab 100644
--- a/static/locales/en.json
+++ b/static/locales/en.json
@@ -1783,7 +1783,8 @@
"keepAudioOnlyLargerAllowed": "Larger uploads allowed",
"largeVideoNotice": "Large video file. Upload will proceed; transcription may take longer and uses chunking on the server.",
"options": "Options",
- "transcriptionOptions": "Transcription Options"
+ "transcriptionOptions": "Transcription Options",
+ "uploadAndAddMore": "Upload & Add More"
},
"uploadProgress": {
"title": "Upload Progress"
diff --git a/static/locales/es.json b/static/locales/es.json
index 0db4d42a..f3c60dbc 100644
--- a/static/locales/es.json
+++ b/static/locales/es.json
@@ -1766,7 +1766,8 @@
"keepAudioOnlyLargerAllowed": "Se permiten subidas más grandes",
"largeVideoNotice": "Archivo de vídeo grande. La subida continuará; la transcripción puede tardar más y usa el troceado en el servidor.",
"options": "Opciones",
- "transcriptionOptions": "Opciones de transcripción"
+ "transcriptionOptions": "Opciones de transcripción",
+ "uploadAndAddMore": "Subir y añadir más"
},
"uploadProgress": {
"title": "Progreso de Carga"
diff --git a/static/locales/fr.json b/static/locales/fr.json
index aac6a355..891f9cac 100644
--- a/static/locales/fr.json
+++ b/static/locales/fr.json
@@ -1766,7 +1766,8 @@
"keepAudioOnlyLargerAllowed": "Envois plus volumineux autorisés",
"largeVideoNotice": "Fichier vidéo volumineux. L’envoi va se poursuivre ; la transcription peut être plus longue et utilise le découpage côté serveur.",
"options": "Options",
- "transcriptionOptions": "Options de transcription"
+ "transcriptionOptions": "Options de transcription",
+ "uploadAndAddMore": "Téléverser et ajouter plus"
},
"uploadProgress": {
"title": "Progression du Téléchargement"
diff --git a/static/locales/pt-BR.json b/static/locales/pt-BR.json
index 878e4b4c..f762e0ae 100644
--- a/static/locales/pt-BR.json
+++ b/static/locales/pt-BR.json
@@ -1766,7 +1766,8 @@
"keepAudioOnlyLargerAllowed": "Envios maiores permitidos",
"largeVideoNotice": "Arquivo de vídeo grande. O envio será concluído; a transcrição pode demorar mais e usa o particionamento no servidor.",
"options": "Opções",
- "transcriptionOptions": "Opções de transcrição"
+ "transcriptionOptions": "Opções de transcrição",
+ "uploadAndAddMore": "Enviar e adicionar mais"
},
"uploadProgress": {
"title": "Progresso do Envio"
diff --git a/static/locales/ru.json b/static/locales/ru.json
index 2b667171..cff656df 100644
--- a/static/locales/ru.json
+++ b/static/locales/ru.json
@@ -1766,7 +1766,8 @@
"keepAudioOnlyLargerAllowed": "Допустимы более крупные загрузки",
"largeVideoNotice": "Большой видеофайл. Загрузка продолжится; транскрибация может занять больше времени и использует разбивку на сервере.",
"options": "Параметры",
- "transcriptionOptions": "Параметры транскрипции"
+ "transcriptionOptions": "Параметры транскрипции",
+ "uploadAndAddMore": "Загрузить и добавить ещё"
},
"uploadProgress": {
"title": "Прогресс загрузки"
diff --git a/static/locales/zh.json b/static/locales/zh.json
index 98278c8c..0767b34f 100644
--- a/static/locales/zh.json
+++ b/static/locales/zh.json
@@ -1766,7 +1766,8 @@
"keepAudioOnlyLargerAllowed": "允许更大文件",
"largeVideoNotice": "视频文件较大。上传将继续;转录可能耗时更长,并依赖服务器端的分块处理。",
"options": "选项",
- "transcriptionOptions": "转录选项"
+ "transcriptionOptions": "转录选项",
+ "uploadAndAddMore": "上传并继续添加"
},
"uploadProgress": {
"title": "上传进度"
diff --git a/templates/components/upload-view.html b/templates/components/upload-view.html
index 8a6a51ee..460968e6 100644
--- a/templates/components/upload-view.html
+++ b/templates/components/upload-view.html
@@ -887,15 +887,24 @@
<span v-text="t('common.cancel')"></span>
</button>
- <!-- Normal Upload Button (when not in incognito mode or feature disabled) -->
- <button v-if="!incognitoMode || !enableIncognitoMode"
- @click="startUpload"
- :disabled="pendingQueueFiles.length === 0"
- class="btn btn--primary">
- <i class="fas fa-cloud-upload-alt"></i>
- <span v-if="pendingQueueFiles.length === 0">${ t('upload.title') || 'Upload' }</span>
- <span v-else v-text="t('upload.uploadNFiles', { count: pendingQueueFiles.length })"></span>
- </button>
+ <!-- Normal Upload Buttons (when not in incognito mode or feature disabled) -->
+ <div v-if="!incognitoMode || !enableIncognitoMode" class="flex items-center gap-2">
+ <!-- Queue the files but keep the modal open for more -->
+ <button @click="startUpload"
+ :disabled="pendingQueueFiles.length === 0"
+ class="btn btn--ghost">
+ <i class="fas fa-plus"></i>
+ <span v-text="t('upload.uploadAndAddMore')"></span>
+ </button>
+ <!-- Queue the files and close the modal -->
+ <button @click="startUploadAndClose"
+ :disabled="pendingQueueFiles.length === 0"
+ class="btn btn--primary">
+ <i class="fas fa-cloud-upload-alt"></i>
+ <span v-if="pendingQueueFiles.length === 0">${ t('upload.title') || 'Upload' }</span>
+ <span v-else v-text="t('upload.uploadNFiles', { count: pendingQueueFiles.length })"></span>
+ </button>
+ </div>
<!-- Incognito Upload Button (only when feature enabled and mode selected) -->
<button v-else