3 Commits
Author SHA1 Message Date
hauke 299c93f8d6 chore #14740: release 0.2.3 2026-11-09 15:08:00 +01:00
haukeandClaude Opus 5.5 36cefaab5f feat #14740: delete transcribed calls
Transcribed (Done) calls get a "Löschen" button next to the upload
control, with a confirmation dialog in the app's style instead of
window.confirm. Deleting reuses discard_call (not a parallel path),
which now also refuses while the call's transcript is being uploaded,
consistent with the existing refusals for recording/processing/
CleanupPending.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-11-09 14:45:17 +01:00
hauke 697f13e13a chore #14740: update feed 0.2.2 2026-11-09 12:06:37 +01:00
7 changed files with 219 additions and 24 deletions
Generated
+1 -1
View File
@@ -445,7 +445,7 @@ dependencies = [
[[package]] [[package]]
name = "call-recorder" name = "call-recorder"
version = "0.2.2" version = "0.2.3"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"chrono", "chrono",
+4 -4
View File
@@ -1,10 +1,10 @@
{ {
"version": "0.2.1", "version": "0.2.2",
"pub_date": "2026-11-06T14:48:27Z", "pub_date": "2026-11-09T11:05:43Z",
"platforms": { "platforms": {
"windows-x86_64": { "windows-x86_64": {
"signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVUdGpRa1ZvalU2SU9ZeUN6RUpYcjNFQ0VFTTZrZFpEa255SkRib0JtMVE4aEdVOG9ack5valRJdVAwZy9wcHZ2a1JFUHREZmJGT21Yd2hNOTh2TmMwSTVYRlRhQ1NqREFZPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzkzOTc2NDgwCWZpbGU6R2VzcHLDpGNoc3Jla29yZGVyXzAuMi4xX3g2NC1zZXR1cC5leGUJdmVyc2lvbjowLjIuMQplYUZLR25PZVk0dm4xZUczMElNYlpYeEZ5Um9VbTgwbEJKUmQwU2l1QkZPUE9Bdy9sd1FIUHAyb0MyeEZlemkxaktwM0VBd05PZDBRV3NYWTVOSmlBQT09Cg==", "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVUdGpRa1ZvalU2SVB0NjJZT09kazJxZlBBWi9tQWZFSUtZVTRaVnNDdnFsSUJZeDc2QWZybytFL2lUR1E5QStWY3k5Tk5xSUMxM1M3TFlhU1A5VUNkNzh0UlBvVDRMcndnPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNzk0MjIyMzIxCWZpbGU6R2VzcHLDpGNoc3Jla29yZGVyXzAuMi4yX3g2NC1zZXR1cC5leGUJdmVyc2lvbjowLjIuMgpObWpiWWJKc1hodm1penNPc3BDM244elhiQ0kvUmF2ZUZVKzJSTkZ2aVArQzRTSUIvUXZ6Y0VYSUU1R3k3eFBnU1pid1ZMRHpDak9GYWtzYXdrSmlEZz09Cg==",
"url": "https://gitea.euvino.eu/public/call-recorder/releases/download/v0.2.1/Gespraechsrekorder_0.2.1_x64-setup.exe" "url": "https://gitea.euvino.eu/public/call-recorder/releases/download/v0.2.2/Gespraechsrekorder_0.2.2_x64-setup.exe"
} }
} }
} }
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "call-recorder" name = "call-recorder"
version = "0.2.2" version = "0.2.3"
description = "Gesprächsrekorder desktop app" description = "Gesprächsrekorder desktop app"
edition = "2021" edition = "2021"
+75 -8
View File
@@ -37,6 +37,7 @@ const MANUAL_APP: &str = "Manuell";
const TEST_DURATION: Duration = Duration::from_secs(5); const TEST_DURATION: Duration = Duration::from_secs(5);
const TEST_POLL: Duration = Duration::from_millis(50); const TEST_POLL: Duration = Duration::from_millis(50);
const ALREADY_PROCESSING: &str = "Wird bereits verarbeitet"; const ALREADY_PROCESSING: &str = "Wird bereits verarbeitet";
const ALREADY_UPLOADING: &str = "Wird bereits hochgeladen";
/// Why [`AppState::discard_call`] refused. /// Why [`AppState::discard_call`] refused.
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq)]
@@ -362,7 +363,7 @@ impl AppState {
pub fn claim_upload(&self, id: CallId) -> Result<UploadClaim<'_>, String> { pub fn claim_upload(&self, id: CallId) -> Result<UploadClaim<'_>, String> {
let mut uploading = lock(&self.uploading); let mut uploading = lock(&self.uploading);
if uploading.contains(&id) { if uploading.contains(&id) {
return Err("Wird bereits hochgeladen".to_string()); return Err(ALREADY_UPLOADING.to_string());
} }
if lock(&self.upload_confirmed_unsaved).contains(&id) { if lock(&self.upload_confirmed_unsaved).contains(&id) {
return Err("Bereits hochgeladen".to_string()); return Err("Bereits hochgeladen".to_string());
@@ -712,11 +713,15 @@ impl AppState {
.ok_or_else(|| "Gespräch nicht gefunden".to_string()) .ok_or_else(|| "Gespräch nicht gefunden".to_string())
} }
/// Deletes a finished call: both audio files and the row, and takes it /// Deletes a finished (or still undecided/failed) call: both audio files
/// out of the prompt queue. Returns how many calls still wait for the /// and the row, cascading to its segments, speaker names, merges and
/// prompt. A call that is being processed, or whose DeepScript jobs /// recorded remote jobs — this is also how a transcribed (`Done`) call's
/// are still on record ([`DiscardError::CleanupPending`]), is not /// "Löschen" removes it. Takes it out of the prompt queue and returns how
/// deleted. /// many calls still wait for it. Refused while the call is being
/// recorded, processed ([`AppState::claim_processing`]/
/// [`AppState::reserve_processing`] or status `Processing`), uploaded
/// ([`AppState::claim_upload`]), or while its DeepScript jobs are still
/// on record ([`DiscardError::CleanupPending`]).
pub fn discard_call(&self, id: CallId) -> Result<usize, DiscardError> { pub fn discard_call(&self, id: CallId) -> Result<usize, DiscardError> {
if lock(&self.current) if lock(&self.current)
.as_ref() .as_ref()
@@ -724,11 +729,17 @@ impl AppState {
{ {
return Err("Das Gespräch wird gerade aufgenommen".to_string().into()); return Err("Das Gespräch wird gerade aufgenommen".to_string().into());
} }
// Held until the call is gone, so no run can claim it meanwhile. // Both held until the call is gone, so neither a pipeline run nor an
// upload can claim it meanwhile (same uploading -> store lock order
// as `claim_upload`, so this can never deadlock against it).
let processing = lock(&self.processing); let processing = lock(&self.processing);
if processing.contains(&id) { if processing.contains(&id) {
return Err(ALREADY_PROCESSING.to_string().into()); return Err(ALREADY_PROCESSING.to_string().into());
} }
let uploading = lock(&self.uploading);
if uploading.contains(&id) {
return Err(ALREADY_UPLOADING.to_string().into());
}
let call = self let call = self
.store .store
.get_call(id) .get_call(id)
@@ -742,7 +753,8 @@ impl AppState {
return Err(DiscardError::CleanupPending); return Err(DiscardError::CleanupPending);
} }
// Files first: if one cannot be deleted, the row stays so the user // Files first: if one cannot be deleted, the row stays so the user
// can try again instead of leaving orphaned audio behind. // can try again instead of leaving orphaned audio behind. Already
// gone (e.g. removed by retention) is not an error.
for path in [&call.mic_path, &call.out_path] { for path in [&call.mic_path, &call.out_path] {
if path.as_os_str().is_empty() { if path.as_os_str().is_empty() {
continue; continue;
@@ -768,6 +780,7 @@ impl AppState {
} }
return Err(format!("Gespräch konnte nicht gelöscht werden: {e}").into()); return Err(format!("Gespräch konnte nicht gelöscht werden: {e}").into());
} }
drop(uploading);
drop(processing); drop(processing);
Ok(self.prompts_waiting()) Ok(self.prompts_waiting())
} }
@@ -1147,6 +1160,60 @@ mod tests {
assert!(f.state.reserve_processing(id)); assert!(f.state.reserve_processing(id));
} }
#[test]
fn a_transcribed_call_is_deleted_like_any_other() {
let f = fixture();
let (id, mic, out) = finished_call(&f, "a");
f.state
.store
.set_status(id, CallStatus::Done, None)
.unwrap();
assert_eq!(f.state.discard_call(id), Ok(0));
assert!(!mic.exists());
assert!(!out.exists());
assert_eq!(f.state.store.get_call(id).unwrap(), None);
}
#[test]
fn a_call_being_uploaded_is_not_discarded() {
let f = fixture();
let (id, mic, out) = finished_call(&f, "a");
f.state
.store
.set_status(id, CallStatus::Done, None)
.unwrap();
let claim = f.state.claim_upload(id).unwrap();
assert_eq!(
f.state.discard_call(id),
Err(DiscardError::Other("Wird bereits hochgeladen".to_string()))
);
assert!(mic.exists());
assert!(out.exists());
assert!(f.state.store.get_call(id).unwrap().is_some());
// Once the upload is done, the delete goes through.
drop(claim);
assert_eq!(f.state.discard_call(id), Ok(0));
}
#[test]
fn a_call_already_uploaded_here_is_deleted_without_touching_the_crm() {
let f = fixture();
let (id, mic, out) = finished_call(&f, "a");
f.state
.store
.set_status(id, CallStatus::Done, None)
.unwrap();
f.state.mark_uploaded(id, "4711").unwrap();
assert_eq!(f.state.discard_call(id), Ok(0));
assert!(!mic.exists());
assert!(!out.exists());
assert_eq!(f.state.store.get_call(id).unwrap(), None);
}
#[test] #[test]
fn a_cleanup_reserves_a_call_of_any_status() { fn a_cleanup_reserves_a_call_of_any_status() {
let f = fixture(); let f = fixture();
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "Gesprächsrekorder", "productName": "Gesprächsrekorder",
"version": "0.2.2", "version": "0.2.3",
"identifier": "eu.euvino.callrecorder", "identifier": "eu.euvino.callrecorder",
"build": { "build": {
"frontendDist": "../ui/dist", "frontendDist": "../ui/dist",
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "ui", "name": "ui",
"private": true, "private": true,
"version": "0.2.2", "version": "0.2.3",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
+129 -1
View File
@@ -45,6 +45,12 @@
let actionError = $state('') let actionError = $state('')
let busy = $state(false) let busy = $state(false)
// "Löschen" (transcribed calls): confirmed with a dialog instead of
// running straight away like the other actions.
let deleteDialogOpen = $state(false)
let deleteBusy = $state(false)
let deleteError = $state('')
// Uploads run per call and may outlive the selection (the login can // Uploads run per call and may outlive the selection (the login can
// take a while); their errors are kept per call too. // take a while); their errors are kept per call too.
let uploading = $state<CallId[]>([]) let uploading = $state<CallId[]>([])
@@ -105,6 +111,8 @@
actionError = '' actionError = ''
editingTitle = false editingTitle = false
titleError = '' titleError = ''
deleteDialogOpen = false
deleteError = ''
refreshDetail() refreshDetail()
} }
@@ -115,6 +123,8 @@
actionError = '' actionError = ''
editingTitle = false editingTitle = false
titleError = '' titleError = ''
deleteDialogOpen = false
deleteError = ''
} }
onMount(() => { onMount(() => {
@@ -189,6 +199,49 @@
refreshList() refreshList()
}) })
/** "Löschen" on a transcribed call: asks for confirmation first. */
function askDelete() {
deleteError = ''
deleteDialogOpen = true
}
function cancelDelete() {
deleteDialogOpen = false
deleteError = ''
}
/** Confirmed delete: same backend path as "Verwerfen" (`discard_call`).
* On success the selection moves to the next call in the list, or clears
* if none is left. */
async function confirmDelete() {
if (!detail) return
const id = detail.call.id
deleteBusy = true
try {
await discardCall(id)
deleteDialogOpen = false
selectAfterDelete(id)
refreshList()
} catch (err) {
deleteError = errorText(err)
} finally {
deleteBusy = false
}
}
/** Selects the call that took `deletedId`'s place in the list (or the one
* before it, if `deletedId` was last), else clears the selection. */
function selectAfterDelete(deletedId: CallId) {
const index = calls.findIndex((c) => c.id === deletedId)
const remaining = calls.filter((c) => c.id !== deletedId)
if (remaining.length === 0) {
clearSelection()
return
}
const next = remaining[Math.min(Math.max(index, 0), remaining.length - 1)]
select(next.id)
}
/** Uploads the shown call's transcript (logging in first if needed). A /** Uploads the shown call's transcript (logging in first if needed). A
* call already uploaded has no button any more: the CRM never gets a * call already uploaded has no button any more: the CRM never gets a
* duplicate. */ * duplicate. */
@@ -351,7 +404,8 @@
{:else if call.status === 'failed'} {:else if call.status === 'failed'}
<button class="btn primary" disabled={busy} onclick={retry}>Erneut versuchen</button> <button class="btn primary" disabled={busy} onclick={retry}>Erneut versuchen</button>
<button class="btn danger" disabled={busy} onclick={discard}>Verwerfen</button> <button class="btn danger" disabled={busy} onclick={discard}>Verwerfen</button>
{:else if call.status === 'done' && !call.uploaded_at} {:else if call.status === 'done'}
{#if !call.uploaded_at}
<button <button
class="btn primary" class="btn primary"
disabled={!call.transcribed_at || isUploading} disabled={!call.transcribed_at || isUploading}
@@ -361,6 +415,10 @@
{isUploading ? 'wird hochgeladen…' : 'Transkript hochladen'} {isUploading ? 'wird hochgeladen…' : 'Transkript hochladen'}
</button> </button>
{/if} {/if}
<button class="btn danger" disabled={deleteBusy || isUploading} onclick={askDelete}>
Löschen
</button>
{/if}
</span> </span>
</div> </div>
{#if shownActionError} {#if shownActionError}
@@ -397,6 +455,40 @@
/> />
{/if} {/if}
</div> </div>
{#if deleteDialogOpen}
<div
class="dialog-backdrop"
onclick={cancelDelete}
onkeydown={(e) => e.key === 'Escape' && cancelDelete()}
role="presentation"
>
<div
class="dialog"
role="alertdialog"
aria-modal="true"
aria-labelledby="delete-dialog-title"
tabindex="-1"
onclick={(e) => e.stopPropagation()}
onkeydown={(e) => e.stopPropagation()}
>
<p class="dialog-title" id="delete-dialog-title">Gespräch löschen?</p>
<p>Audio und Transkript werden unwiderruflich von diesem PC gelöscht.</p>
{#if call.uploaded_at}
<p>Die Kopie im CRM bleibt erhalten.</p>
{/if}
{#if deleteError}
<p class="error">{deleteError}</p>
{/if}
<div class="dialog-actions">
<button class="btn danger" disabled={deleteBusy} onclick={confirmDelete}>
Löschen
</button>
<button class="btn" disabled={deleteBusy} onclick={cancelDelete}>Abbrechen</button>
</div>
</div>
</div>
{/if}
{:else if detailError} {:else if detailError}
<p class="error pad">{detailError}</p> <p class="error pad">{detailError}</p>
{:else if loaded && selectedId === null && calls.length > 0} {:else if loaded && selectedId === null && calls.length > 0}
@@ -574,4 +666,40 @@
background: var(--rec-soft); background: var(--rec-soft);
color: var(--rec); color: var(--rec);
} }
.dialog-backdrop {
position: fixed;
inset: 0;
background: rgba(29, 35, 48, 0.4);
display: flex;
align-items: center;
justify-content: center;
z-index: 10;
}
.dialog {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 10px;
box-shadow: 0 12px 32px rgba(29, 35, 48, 0.25);
padding: 20px;
width: min(420px, calc(100vw - 32px));
}
.dialog-title {
font-size: 16px;
font-weight: 600;
margin: 0 0 8px;
}
.dialog p {
margin: 0 0 8px;
}
.dialog-actions {
display: flex;
justify-content: flex-end;
gap: 8px;
margin-top: 16px;
}
</style> </style>