Enhance release process: require clean worktree for publishing, update tagging behavior, and improve UI for audio file uploads
This commit is contained in:
+5
-4
@@ -44,9 +44,11 @@ const getQueued = () => queueTransaction('readonly', (store) => store.getAll());
|
||||
const putQueued = (recording) => queueTransaction('readwrite', (store) => store.put(recording));
|
||||
const deleteQueued = (id) => queueTransaction('readwrite', (store) => store.delete(id));
|
||||
|
||||
function setMessage(message, isError = false) {
|
||||
function setMessage(message, isError = false, isSuccess = false) {
|
||||
elements['capture-message'].textContent = message;
|
||||
elements['capture-message'].style.color = isError ? 'var(--coral)' : '';
|
||||
elements['capture-message'].classList.toggle('upload-confirmed', isSuccess);
|
||||
elements['capture-message'].setAttribute('aria-label', isSuccess ? 'Server confirmed the recording is stored.' : message);
|
||||
}
|
||||
|
||||
function updateNetwork() {
|
||||
@@ -229,7 +231,7 @@ async function syncQueue() {
|
||||
const response = await fetch('/api/notes', { method: 'POST', body: form });
|
||||
if (!response.ok) throw new Error(`Upload failed: ${response.status}`);
|
||||
await deleteQueued(recording.id);
|
||||
setMessage('Server confirmed the recording is stored.');
|
||||
setMessage('✓', false, true);
|
||||
} catch {
|
||||
setMessage('Upload paused. Your recording is still saved on this device.');
|
||||
break;
|
||||
@@ -379,8 +381,7 @@ async function loadAwaitingNotes() {
|
||||
|
||||
elements['record-button'].addEventListener('click', () => mediaRecorder?.state === 'recording' ? stopRecording() : startRecording());
|
||||
elements['audio-file-input'].addEventListener('change', async (event) => {
|
||||
const [file] = event.target.files;
|
||||
if (file) await queueAudioFile(file);
|
||||
for (const file of event.target.files) await queueAudioFile(file);
|
||||
event.target.value = '';
|
||||
});
|
||||
elements['sync-button'].addEventListener('click', syncQueue);
|
||||
|
||||
+2
-2
@@ -34,7 +34,7 @@
|
||||
</div>
|
||||
<div class="audio-upload-row">
|
||||
<label class="audio-upload-button" for="audio-file-input">↑ Upload audio</label>
|
||||
<input id="audio-file-input" type="file" accept="audio/*,.mp3,.m4a,.aac,.ogg,.opus,.flac,.wav" />
|
||||
<input id="audio-file-input" type="file" accept="audio/*,.mp3,.m4a,.aac,.ogg,.opus,.flac,.wav" multiple />
|
||||
<span>Files stay on this device until the server confirms storage.</span>
|
||||
</div>
|
||||
<div class="record-meter"><span id="record-meter-fill"></span></div>
|
||||
@@ -59,7 +59,7 @@
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<footer><p>Faerro KB - Copyright Andrea Ferronato © 2026</p></footer>
|
||||
<footer><p>Faerro KB © 2026</p></footer>
|
||||
<script src="/app.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -44,6 +44,7 @@ h1 em { color: var(--moss); font-weight: 500; }
|
||||
.record-meter { height: 2px; max-width: 590px; margin-inline: auto; background: #e4e3dc; }
|
||||
.record-meter span { display: block; height: 100%; width: 0; background: var(--coral); transition: width .25s linear; }
|
||||
.capture-message { height: 20px; max-width: 590px; margin-inline: auto; padding-top: 6px; color: var(--muted); font-size: 11px; text-align: center; }
|
||||
.capture-message.upload-confirmed { color: forestgreen; font-size: 16px; }
|
||||
.audio-upload-row { max-width: 590px; margin: 14px auto 0; display: flex; align-items: center; justify-content: center; gap: 12px; }
|
||||
.audio-upload-button { display: inline-flex; min-height: 36px; align-items: center; gap: 7px; border: 1px solid var(--line); padding: 0 12px; color: var(--moss-dark); background: #fffefa; font-size: 12px; cursor: pointer; }
|
||||
.audio-upload-button:hover { border-color: var(--moss); }
|
||||
|
||||
Reference in New Issue
Block a user