feat #14740: done only once uploaded
A done call only shows "fertig" once its transcript reached this build's backend (uploaded_here); otherwise it's "bereit zum Hochladen". The list row gets a blue dot for anything needing action (ready to upload or not transcribed yet), and the sidebar header shows "Gespräche · N offen". Adds ListState/needs_action to CallListItem, computed in recorder-core so the UI doesn't re-implement the rule. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -28,12 +28,15 @@
|
||||
aria-current={call.id === selectedId}
|
||||
onclick={() => onselect(call.id)}
|
||||
>
|
||||
{#if call.needs_action}
|
||||
<span class="dot" title="Offen" aria-label="Offen"></span>
|
||||
{/if}
|
||||
<span class="title">{call.title ?? appLine(call)}</span>
|
||||
<span class="meta">
|
||||
<span class="muted">
|
||||
{call.title ? `${appLine(call)} · ` : ''}{formatListTime(call.started_at)}
|
||||
</span>
|
||||
<StatusPill status={call.status} interrupted={call.interrupted} />
|
||||
<StatusPill state={call.list_state} interrupted={call.interrupted} />
|
||||
</span>
|
||||
</button>
|
||||
</li>
|
||||
@@ -53,11 +56,12 @@
|
||||
}
|
||||
|
||||
.row {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 3px;
|
||||
width: 100%;
|
||||
padding: 9px 10px;
|
||||
padding: 9px 10px 9px 18px;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
background: none;
|
||||
@@ -67,6 +71,17 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.dot {
|
||||
position: absolute;
|
||||
left: 7px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
border-radius: 50%;
|
||||
background: var(--primary);
|
||||
}
|
||||
|
||||
.row:hover {
|
||||
background: var(--bg);
|
||||
}
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
<script lang="ts">
|
||||
import type { CallStatus } from './api'
|
||||
import type { ListState } from './api'
|
||||
|
||||
let { status, interrupted = false }: { status: CallStatus; interrupted?: boolean } = $props()
|
||||
let { state, interrupted = false }: { state: ListState; interrupted?: boolean } = $props()
|
||||
|
||||
const pills: Record<CallStatus, { text: string; kind: string }> = {
|
||||
const pills: Record<ListState, { text: string; kind: string }> = {
|
||||
done: { text: 'fertig', kind: 'done' },
|
||||
ready_to_upload: { text: 'bereit zum Hochladen', kind: 'ready' },
|
||||
processing: { text: 'wird verarbeitet…', kind: 'processing' },
|
||||
awaiting_decision: { text: 'nicht transkribiert', kind: 'awaiting' },
|
||||
failed: { text: 'fehlgeschlagen', kind: 'failed' },
|
||||
recording: { text: 'Aufnahme läuft', kind: 'recording' },
|
||||
}
|
||||
|
||||
let pill = $derived(pills[status])
|
||||
let pill = $derived(pills[state])
|
||||
</script>
|
||||
|
||||
<span class="pill status {pill.kind}">
|
||||
{pill.text}{#if interrupted && status === 'awaiting_decision'}, unterbrochen{/if}
|
||||
{pill.text}{#if interrupted && state === 'awaiting_decision'}, unterbrochen{/if}
|
||||
</span>
|
||||
|
||||
<style>
|
||||
@@ -28,6 +29,11 @@
|
||||
color: var(--ok);
|
||||
}
|
||||
|
||||
.ready {
|
||||
background: var(--primary-soft);
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
.processing {
|
||||
background: #fff4d6;
|
||||
color: #8a6100;
|
||||
|
||||
@@ -79,6 +79,18 @@ export interface PendingPrompt extends CallBrief {
|
||||
|
||||
export type CallStatus = 'recording' | 'awaiting_decision' | 'processing' | 'done' | 'failed'
|
||||
|
||||
/** What the status pill shows and whether the row needs the user's
|
||||
* attention. Mirrors `CallStatus`, except `done` splits into `done`
|
||||
* (uploaded to this build's backend — "fertig") and `ready_to_upload`
|
||||
* (not uploaded here yet — "bereit zum Hochladen"). */
|
||||
export type ListState =
|
||||
| 'recording'
|
||||
| 'awaiting_decision'
|
||||
| 'processing'
|
||||
| 'failed'
|
||||
| 'done'
|
||||
| 'ready_to_upload'
|
||||
|
||||
/** A row of the main window's call list. Times are RFC 3339. */
|
||||
export interface CallListItem {
|
||||
id: CallId
|
||||
@@ -87,6 +99,10 @@ export interface CallListItem {
|
||||
/** 0 while recording. */
|
||||
duration_secs: number
|
||||
status: CallStatus
|
||||
list_state: ListState
|
||||
/** Whether this row needs the user to act on it (the dot in the list,
|
||||
* counted in the sidebar header's "N offen"). */
|
||||
needs_action: boolean
|
||||
interrupted: boolean
|
||||
/** The name the user gave the call, if any. */
|
||||
title: string | null
|
||||
|
||||
@@ -326,13 +326,17 @@
|
||||
// A failed start (e.g. missing key) also marks the call failed; its
|
||||
// error is then shown once, in the failure box.
|
||||
let shownActionError = $derived(actionError !== detail?.call.error ? actionError : '')
|
||||
|
||||
// Calls that still need the user's attention (not transcribed, or
|
||||
// transcribed but not uploaded here) — shown as "Gespräche · N offen".
|
||||
let openCount = $derived(calls.filter((c) => c.needs_action).length)
|
||||
</script>
|
||||
|
||||
<main class="main">
|
||||
<UpdateBanner />
|
||||
<aside class="sidebar">
|
||||
<header class="sidebar-header">
|
||||
<h1>Gespräche</h1>
|
||||
<h1>Gespräche{#if openCount > 0} <span class="open-count">· {openCount} offen</span>{/if}</h1>
|
||||
<div class="header-actions">
|
||||
<button
|
||||
class="btn small record-btn"
|
||||
@@ -381,7 +385,7 @@
|
||||
<button class="edit-title" title="Titel ändern" onclick={startTitleEdit}>✎</button>
|
||||
</h1>
|
||||
{/if}
|
||||
<StatusPill status={call.status} interrupted={call.interrupted} />
|
||||
<StatusPill state={call.list_state} interrupted={call.interrupted} />
|
||||
</div>
|
||||
{#if editingTitle}
|
||||
<p class="muted subline">Enter speichert, Esc bricht ab. Leer = Standardtitel.</p>
|
||||
@@ -525,18 +529,31 @@
|
||||
|
||||
.sidebar-header {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 4px 8px;
|
||||
padding: 14px 12px 10px 16px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.sidebar-header h1 {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
font-size: 16px;
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
.open-count {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--primary);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.header-actions {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user