Enhance release process: require clean worktree for publishing, update tagging behavior, and improve UI for audio file uploads

This commit is contained in:
2026-09-28 08:14:27 +02:00
parent 0f7d5e950c
commit cb16c77bad
7 changed files with 18 additions and 11 deletions
+5 -4
View File
@@ -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);