Skip to content

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

Python

feat: visible New folder / New tag buttons opposite the section headers in the upload dialog, replacing the folder dropdown's create option

Murtaza Nasirfd214f46d3ce
diff --git a/static/js/app.modular.js b/static/js/app.modular.js
index af5283b4..e798f069 100644
--- a/static/js/app.modular.js
+++ b/static/js/app.modular.js
@@ -2496,20 +2496,6 @@ document.addEventListener('DOMContentLoaded', async () => {
},
});
};
- // The folder <select> offers a "+ New folder" sentinel option;
- // revert the selection and open the create modal. The revert must
- // wait a tick: same-tick restore leaves the net value unchanged,
- // so Vue would skip the DOM patch and the select would stay stuck
- // on the sentinel option.
- watch(selectedFolderId, (val, oldVal) => {
- if (val === '__create__') {
- nextTick(() => {
- selectedFolderId.value = oldVal === '__create__' ? null : oldVal;
- });
- createFolderFromUpload();
- }
- });
-
// Upload disclaimer handlers
const acceptUploadDisclaimer = () => {
showUploadDisclaimerModal.value = false;
diff --git a/templates/components/upload-view.html b/templates/components/upload-view.html
index 81d5b09b..8a6a51ee 100644
--- a/templates/components/upload-view.html
+++ b/templates/components/upload-view.html
@@ -525,11 +525,18 @@
<!-- Folder Selection (only shown if folders are enabled) -->
<div v-if="foldersEnabled" class="mt-4">
- <label class="block text-sm font-medium text-[var(--text-secondary)] mb-2">
- <i class="fas fa-folder mr-1"
- :style="{ color: selectedFolderId ? getFolderColor(selectedFolderId) : 'var(--text-muted)' }"></i>
- ${ t('form.folder') }
- </label>
+ <div class="flex items-center justify-between mb-2">
+ <label class="block text-sm font-medium text-[var(--text-secondary)]">
+ <i class="fas fa-folder mr-1"
+ :style="{ color: selectedFolderId ? getFolderColor(selectedFolderId) : 'var(--text-muted)' }"></i>
+ ${ t('form.folder') }
+ </label>
+ <button @click="createFolderFromUpload"
+ class="inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded border border-[var(--border-secondary)] text-[var(--text-accent)] hover:border-[var(--border-focus)] hover:bg-[var(--bg-secondary)] transition-colors">
+ <i class="fas fa-plus" style="font-size: 9px;"></i>
+ <span v-text="t('form.newFolderOption')"></span>
+ </button>
+ </div>
<div class="relative">
<select v-model="selectedFolderId"
class="w-full pl-8 pr-8 py-2 text-sm rounded-lg cursor-pointer focus:outline-none focus:ring-2 focus:ring-[var(--border-focus)] appearance-none border border-[var(--border-secondary)] bg-[var(--bg-tertiary)] text-[var(--text-primary)] hover:bg-[var(--bg-input)] transition-colors">
@@ -537,7 +544,6 @@
<option v-for="folder in availableFolders" :key="folder.id" :value="folder.id">
${ folder.name }
</option>
- <option value="__create__" v-text="'+ ' + t('form.newFolderOption')"></option>
</select>
<i class="fas fa-folder absolute left-2.5 top-1/2 transform -translate-y-1/2 pointer-events-none"
:style="{ color: selectedFolderId ? getFolderColor(selectedFolderId) : 'var(--text-muted)' }"></i>
@@ -555,10 +561,17 @@
<!-- Tag Selection -->
<div class="mt-4">
- <label class="block text-sm font-medium text-[var(--text-secondary)] mb-2">
- <i class="fas fa-tags mr-1 text-[var(--text-muted)]"></i>
- ${ t('tags.title') }
- </label>
+ <div class="flex items-center justify-between mb-2">
+ <label class="block text-sm font-medium text-[var(--text-secondary)]">
+ <i class="fas fa-tags mr-1 text-[var(--text-muted)]"></i>
+ ${ t('tags.title') }
+ </label>
+ <button @click="createTagFromUploadSearch"
+ class="inline-flex items-center gap-1 px-2 py-0.5 text-xs rounded border border-[var(--border-secondary)] text-[var(--text-accent)] hover:border-[var(--border-focus)] hover:bg-[var(--bg-secondary)] transition-colors">
+ <i class="fas fa-plus" style="font-size: 9px;"></i>
+ <span v-text="t('help.newTag')"></span>
+ </button>
+ </div>
<!-- Selected Tags Display - Compact with Drag Reorder -->
<div v-if="selectedTags.length > 0" class="mb-2">