Skip to content

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

Python

Optimize recording view for mobile with compact layout and proper text wrapping in warning banner

Murtaza Nasir7e2f61f305d0
diff --git a/templates/index.html b/templates/index.html
index 4e3feb31..c9a3a337 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -636,58 +636,47 @@
</div>
<!-- Recording View -->
- <div v-else-if="currentView === 'recording'" class="flex-1 flex flex-col p-4 md:p-8 bg-[var(--bg-primary)] min-h-0">
+ <div v-else-if="currentView === 'recording'" class="flex-1 flex flex-col p-2 md:p-8 bg-[var(--bg-primary)] min-h-0">
<div class="flex-1 flex flex-col max-w-4xl w-full mx-auto bg-[var(--bg-secondary)] rounded-xl border border-[var(--border-primary)] min-h-0 overflow-hidden">
<!-- Top: Visualizer and Status (Fixed) -->
- <div class="flex-shrink-0 p-4 md:p-6 text-center bg-[var(--bg-tertiary)] border-b border-[var(--border-primary)]">
- <div v-if="isRecording" class="w-full mx-auto mb-4">
+ <div class="flex-shrink-0 p-3 md:p-6 text-center bg-[var(--bg-tertiary)] border-b border-[var(--border-primary)]">
+ <div v-if="isRecording" class="w-full mx-auto mb-3 md:mb-4">
<!-- Dual visualizer for 'both' mode -->
- <div v-if="recordingMode === 'both'" class="max-w-4xl mx-auto flex gap-4">
- <div class="w-1/2 min-h-[12rem] h-48 md:h-40 flex flex-col bg-[var(--bg-primary)] rounded-lg p-2">
- <div class="flex-1 w-full overflow-hidden rounded-md" style="min-height: 10rem;">
+ <div v-if="recordingMode === 'both'" class="max-w-4xl mx-auto flex gap-2 md:gap-4">
+ <div class="w-1/2 min-h-[8rem] md:min-h-[12rem] h-32 md:h-48 flex flex-col bg-[var(--bg-primary)] rounded-lg p-1.5 md:p-2">
+ <div class="flex-1 w-full overflow-hidden rounded-md" style="min-height: 6rem;">
<canvas ref="micVisualizer" class="w-full h-full"></canvas>
</div>
- <p class="text-xs text-[var(--text-muted)] pt-1" v-text="t('recording.microphone')"></p>
+ <p class="text-xs text-[var(--text-muted)] pt-0.5 md:pt-1" v-text="t('recording.microphone')"></p>
</div>
- <div class="w-1/2 min-h-[12rem] h-48 md:h-40 flex flex-col bg-[var(--bg-primary)] rounded-lg p-2">
- <div class="flex-1 w-full overflow-hidden rounded-md" style="min-height: 10rem;">
+ <div class="w-1/2 min-h-[8rem] md:min-h-[12rem] h-32 md:h-48 flex flex-col bg-[var(--bg-primary)] rounded-lg p-1.5 md:p-2">
+ <div class="flex-1 w-full overflow-hidden rounded-md" style="min-height: 6rem;">
<canvas ref="systemVisualizer" class="w-full h-full"></canvas>
</div>
- <p class="text-xs text-[var(--text-muted)] pt-1" v-text="t('recording.systemAudio')"></p>
+ <p class="text-xs text-[var(--text-muted)] pt-0.5 md:pt-1" v-text="t('recording.systemAudio')"></p>
</div>
</div>
<!-- Single visualizer for other modes -->
- <div v-else class="min-h-[12rem] h-48 md:h-40 max-w-2xl mx-auto bg-[var(--bg-primary)] rounded-lg p-2 flex flex-col">
- <div class="flex-1 w-full overflow-hidden rounded-md" style="min-height: 10rem;">
+ <div v-else class="min-h-[8rem] md:min-h-[12rem] h-32 md:h-48 max-w-2xl mx-auto bg-[var(--bg-primary)] rounded-lg p-1.5 md:p-2 flex flex-col">
+ <div class="flex-1 w-full overflow-hidden rounded-md" style="min-height: 6rem;">
<canvas ref="visualizer" class="w-full h-full"></canvas>
</div>
- <p class="text-xs text-[var(--text-muted)] pt-1 capitalize">${recordingMode}</p>
+ <p class="text-xs text-[var(--text-muted)] pt-0.5 md:pt-1 capitalize">${recordingMode}</p>
</div>
</div>
- <div v-if="!isRecording && audioBlobURL" class="w-full mb-4">
+ <div v-if="!isRecording && audioBlobURL" class="w-full mb-3 md:mb-4">
<div class="audio-player-container">
<audio :src="audioBlobURL" controls class="w-full">
Your browser does not support the audio element.
</audio>
</div>
</div>
- <!-- Mobile Background Recording Warning -->
- <div v-if="isRecording && isMobileDevice"
- class="mb-4 p-3 bg-amber-50 dark:bg-amber-900 dark:bg-opacity-20 border border-amber-300 dark:border-amber-700 rounded-lg">
- <div class="flex items-start gap-2 text-left">
- <i class="fas fa-exclamation-triangle text-amber-600 dark:text-amber-400 mt-0.5 flex-shrink-0"></i>
- <div class="text-xs text-amber-800 dark:text-amber-200">
- <strong class="block mb-1">Keep this app visible!</strong>
- <span>Recording will pause if you minimize the window or lock your screen. For long meetings, keep Speakr in the foreground or use a native recording app and upload the file when done.</span>
- </div>
- </div>
- </div>
<div>
- <div class="text-2xl font-mono text-[var(--text-accent)]">${formatTime(recordingTime)}</div>
- <p class="text-sm text-[var(--text-muted)]">${ isRecording ? 'Recording in progress...' : 'Recording finished' }</p>
+ <div class="text-xl md:text-2xl font-mono text-[var(--text-accent)]">${formatTime(recordingTime)}</div>
+ <p class="text-xs md:text-sm text-[var(--text-muted)]">${ isRecording ? 'Recording in progress...' : 'Recording finished' }</p>
<!-- Real-time file size display -->
- <div v-if="isRecording && estimatedFileSize > 0" class="mt-2">
+ <div v-if="isRecording && estimatedFileSize > 0" class="mt-1.5">
<p class="text-xs text-[var(--text-muted)]">
Estimated size: <span class="font-mono">${formatFileSize(estimatedFileSize)}</span>
<span v-if="actualBitrate > 0" class="ml-2">
@@ -695,43 +684,57 @@
</span>
</p>
<!-- Size warning indicator -->
- <div v-if="estimatedFileSize > (maxRecordingMB * 1024 * 1024 * 0.8)" class="mt-1">
+ <div v-if="estimatedFileSize > (maxRecordingMB * 1024 * 1024 * 0.8)" class="mt-0.5">
<div class="flex items-center text-xs text-amber-600 dark:text-amber-400">
<i class="fas fa-exclamation-triangle mr-1"></i>
<span v-text="t('help.approachingLimit', { limit: maxRecordingMB })"></span>
</div>
</div>
</div>
+
+ <!-- Mobile Background Recording Warning - Below timer -->
+ <div v-if="isRecording && isMobileDevice"
+ class="mt-2 p-2 bg-amber-50 dark:bg-amber-900 dark:bg-opacity-20 border border-amber-300 dark:border-amber-700 rounded">
+ <div class="flex items-start gap-1.5 text-left">
+ <i class="fas fa-exclamation-triangle text-amber-600 dark:text-amber-400 flex-shrink-0 text-xs" style="margin-top: 2px;"></i>
+ <div class="flex-1 min-w-0">
+ <div class="text-xs text-amber-800 dark:text-amber-200 leading-snug">
+ <strong class="font-semibold">Keep this app visible!</strong>
+ <span class="block text-[10px] mt-0.5">Recording pauses if minimized or screen locked.</span>
+ </div>
+ </div>
+ </div>
+ </div>
</div>
</div>
<!-- Scrollable Content Area: Notes + Actions -->
<div class="flex-1 min-h-0 overflow-y-auto flex flex-col">
<!-- Middle: Notepad (flexible height) -->
- <div class="flex-1 p-4 md:p-6 flex flex-col" style="min-height: 300px;">
- <label for="recordingNotes" class="block text-sm font-medium text-[var(--text-secondary)] mb-2 flex-shrink-0">
+ <div class="flex-1 p-3 md:p-6 flex flex-col" style="min-height: 200px;">
+ <label for="recordingNotes" class="block text-sm font-medium text-[var(--text-secondary)] mb-1.5 flex-shrink-0">
<i class="fas fa-pencil-alt mr-1"></i>
Recording Notes (Markdown)
</label>
- <div class="flex-1 recording-notes-editor" style="min-height: 250px;">
+ <div class="flex-1 recording-notes-editor" style="min-height: 150px;">
<textarea ref="recordingNotesEditor" v-model="recordingNotes"
- class="w-full h-full bg-[var(--bg-input)] border border-[var(--border-secondary)] rounded-lg p-3 text-sm focus:outline-none focus:ring-2 focus:ring-[var(--ring-focus)] resize-none"
+ class="w-full h-full bg-[var(--bg-input)] border border-[var(--border-secondary)] rounded-lg p-2 md:p-3 text-sm focus:outline-none focus:ring-2 focus:ring-[var(--ring-focus)] resize-none"
:placeholder="t('form.notesPlaceholder')"></textarea>
</div>
</div>
<!-- Bottom: Action Buttons -->
- <div class="flex-shrink-0 p-4 md:p-6 bg-[var(--bg-tertiary)] border-t border-[var(--border-primary)]">
+ <div class="flex-shrink-0 p-3 md:p-6 bg-[var(--bg-tertiary)] border-t border-[var(--border-primary)]">
<div v-if="isRecording" class="text-center">
<button @click="stopRecording"
- class="px-8 py-3 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors animate-pulse">
+ class="px-6 md:px-8 py-2.5 md:py-3 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors animate-pulse text-sm md:text-base">
<i class="fas fa-stop mr-2"></i>Stop Recording
</button>
</div>
- <div v-if="!isRecording && audioBlobURL" class="flex flex-col gap-4">
+ <div v-if="!isRecording && audioBlobURL" class="flex flex-col gap-3 md:gap-4">
<!-- Tag Selection -->
<div>
- <label for="recordingTagSelect" class="block text-sm font-medium text-[var(--text-secondary)] mb-2">
+ <label for="recordingTagSelect" class="block text-sm font-medium text-[var(--text-secondary)] mb-1.5 md:mb-2">
<i class="fas fa-tags mr-1"></i>
Select Tags (optional, in priority order)
</label>