Fix progress overlay, play-from-position, layout cutoff, speaker info

- Replace progress bar with task checklist showing pipeline steps
  (load model, transcribe, load diarization, identify speakers, merge)
- Fix WaveformPlayer: track ready state, disable controls until loaded,
  play from current position instead of resetting to start
- Fix workspace height calc to prevent bottom content cutoff
- Show HF_TOKEN setup hint in SpeakerManager when no speakers detected
- Add console logging for progress events to aid debugging

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 18:02:48 -08:00
parent 4d7b9d524f
commit ed626b8ba0
5 changed files with 141 additions and 36 deletions

View File

@@ -140,7 +140,7 @@ class PipelineService:
# Step 3: Merge (or skip if diarization failed) # Step 3: Merge (or skip if diarization failed)
if diarization is not None: if diarization is not None:
write_message( write_message(
progress_message(request_id, 90, "pipeline", "Merging transcript with speakers...") progress_message(request_id, 90, "merging", "Merging transcript with speakers...")
) )
result = self._merge_results(transcription, diarization.speaker_segments) result = self._merge_results(transcription, diarization.speaker_segments)
result.speakers = diarization.speakers result.speakers = diarization.speakers

View File

@@ -7,6 +7,38 @@
} }
let { visible = false, percent = 0, stage = '', message = '' }: Props = $props(); let { visible = false, percent = 0, stage = '', message = '' }: Props = $props();
// Map internal stage names to user-friendly labels
const stageLabels: Record<string, string> = {
'pipeline': 'Pipeline',
'loading_model': 'Loading Model',
'transcribing': 'Transcribing',
'loading_diarization': 'Loading Diarization',
'diarizing': 'Speaker Detection',
'done': 'Complete',
};
// Pipeline steps for the task list
const pipelineSteps = [
{ key: 'loading_model', label: 'Load transcription model' },
{ key: 'transcribing', label: 'Transcribe audio' },
{ key: 'loading_diarization', label: 'Load speaker detection model' },
{ key: 'diarizing', label: 'Identify speakers' },
{ key: 'merging', label: 'Merge results' },
];
function getStepStatus(stepKey: string, currentStage: string): 'pending' | 'active' | 'done' {
const stepOrder = pipelineSteps.map(s => s.key);
const currentIdx = stepOrder.indexOf(currentStage);
const stepIdx = stepOrder.indexOf(stepKey);
if (currentStage === 'done') return 'done';
if (stepIdx < currentIdx) return 'done';
if (stepIdx === currentIdx) return 'active';
return 'pending';
}
let displayStage = $derived(stageLabels[stage] || stage || 'Processing...');
</script> </script>
{#if visible} {#if visible}
@@ -14,12 +46,28 @@
<div class="progress-card"> <div class="progress-card">
<div class="spinner-row"> <div class="spinner-row">
<div class="spinner"></div> <div class="spinner"></div>
<h3>{stage || 'Processing...'}</h3> <h3>{displayStage}</h3>
</div> </div>
<div class="bar-track">
<div class="bar-fill" style="width: {Math.max(percent, 2)}%"></div> <div class="steps">
{#each pipelineSteps as step}
{@const status = getStepStatus(step.key, stage)}
<div class="step" class:step-done={status === 'done'} class:step-active={status === 'active'}>
<span class="step-icon">
{#if status === 'done'}
{:else if status === 'active'}
{:else}
·
{/if}
</span>
<span class="step-label">{step.label}</span>
</div> </div>
<p class="status-text">{percent}% — {message || 'Please wait...'}</p> {/each}
</div>
<p class="status-text">{message || 'Please wait...'}</p>
<p class="hint-text">This may take several minutes for large files</p> <p class="hint-text">This may take several minutes for large files</p>
</div> </div>
</div> </div>
@@ -39,7 +87,8 @@
background: #16213e; background: #16213e;
padding: 2rem 2.5rem; padding: 2rem 2.5rem;
border-radius: 12px; border-radius: 12px;
min-width: 420px; min-width: 380px;
max-width: 440px;
color: #e0e0e0; color: #e0e0e0;
border: 1px solid #2a3a5e; border: 1px solid #2a3a5e;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
@@ -57,35 +106,52 @@
border-top-color: #e94560; border-top-color: #e94560;
border-radius: 50%; border-radius: 50%;
animation: spin 0.8s linear infinite; animation: spin 0.8s linear infinite;
flex-shrink: 0;
} }
@keyframes spin { @keyframes spin {
to { transform: rotate(360deg); } to { transform: rotate(360deg); }
} }
h3 { h3 {
margin: 0; margin: 0;
text-transform: capitalize;
font-size: 1.1rem; font-size: 1.1rem;
} }
.bar-track { .steps {
height: 10px; display: flex;
background: #0f3460; flex-direction: column;
border-radius: 5px; gap: 0.4rem;
overflow: hidden; margin-bottom: 1rem;
} }
.bar-fill { .step {
height: 100%; display: flex;
background: linear-gradient(90deg, #e94560, #ff6b81); align-items: center;
transition: width 0.3s; gap: 0.5rem;
border-radius: 5px; font-size: 0.85rem;
color: #555;
}
.step-done {
color: #4ecdc4;
}
.step-active {
color: #e0e0e0;
font-weight: 500;
}
.step-icon {
width: 1.2rem;
text-align: center;
flex-shrink: 0;
}
.step-active .step-icon {
animation: spin 1.5s linear infinite;
display: inline-block;
} }
.status-text { .status-text {
margin: 0.75rem 0 0; margin: 0.75rem 0 0;
font-size: 0.9rem; font-size: 0.85rem;
color: #b0b0b0; color: #b0b0b0;
} }
.hint-text { .hint-text {
margin: 0.5rem 0 0; margin: 0.5rem 0 0;
font-size: 0.75rem; font-size: 0.75rem;
color: #666; color: #555;
} }
</style> </style>

View File

@@ -34,7 +34,11 @@
<div class="speaker-manager"> <div class="speaker-manager">
<h3>Speakers</h3> <h3>Speakers</h3>
{#if $speakers.length === 0} {#if $speakers.length === 0}
<p class="empty-hint">No speakers detected yet</p> <p class="empty-hint">No speakers detected</p>
<p class="setup-hint">
Speaker detection requires a HuggingFace token.
Set the <code>HF_TOKEN</code> environment variable and restart.
</p>
{:else} {:else}
<ul class="speaker-list"> <ul class="speaker-list">
{#each $speakers as speaker (speaker.id)} {#each $speakers as speaker (speaker.id)}
@@ -78,6 +82,19 @@
.empty-hint { .empty-hint {
color: #666; color: #666;
font-size: 0.875rem; font-size: 0.875rem;
margin-bottom: 0.25rem;
}
.setup-hint {
color: #555;
font-size: 0.75rem;
line-height: 1.4;
}
.setup-hint code {
background: rgba(233, 69, 96, 0.15);
color: #e94560;
padding: 0.1rem 0.3rem;
border-radius: 3px;
font-size: 0.7rem;
} }
.speaker-list { .speaker-list {
list-style: none; list-style: none;

View File

@@ -12,6 +12,7 @@
let container: HTMLDivElement; let container: HTMLDivElement;
let wavesurfer: WaveSurfer | null = $state(null); let wavesurfer: WaveSurfer | null = $state(null);
let isReady = $state(false);
let currentTime = $state('0:00'); let currentTime = $state('0:00');
let totalTime = $state('0:00'); let totalTime = $state('0:00');
@@ -39,6 +40,7 @@
}); });
wavesurfer.on('ready', () => { wavesurfer.on('ready', () => {
isReady = true;
const dur = wavesurfer!.getDuration(); const dur = wavesurfer!.getDuration();
durationMs.set(Math.round(dur * 1000)); durationMs.set(Math.round(dur * 1000));
totalTime = formatTime(dur); totalTime = formatTime(dur);
@@ -48,6 +50,10 @@
wavesurfer.on('pause', () => isPlaying.set(false)); wavesurfer.on('pause', () => isPlaying.set(false));
wavesurfer.on('finish', () => isPlaying.set(false)); wavesurfer.on('finish', () => isPlaying.set(false));
wavesurfer.on('loading', () => {
isReady = false;
});
if (audioUrl) { if (audioUrl) {
wavesurfer.load(audioUrl); wavesurfer.load(audioUrl);
} }
@@ -57,20 +63,21 @@
wavesurfer?.destroy(); wavesurfer?.destroy();
}); });
/** Toggle play/pause. Exposed for keyboard shortcuts. */ /** Toggle play/pause from current position. Exposed for keyboard shortcuts. */
export function togglePlayPause() { export function togglePlayPause() {
wavesurfer?.playPause(); if (!wavesurfer || !isReady) return;
wavesurfer.playPause();
} }
function skipBack() { function skipBack() {
if (wavesurfer) { if (wavesurfer && isReady) {
const time = Math.max(0, wavesurfer.getCurrentTime() - 5); const time = Math.max(0, wavesurfer.getCurrentTime() - 5);
wavesurfer.setTime(time); wavesurfer.setTime(time);
} }
} }
function skipForward() { function skipForward() {
if (wavesurfer) { if (wavesurfer && isReady) {
const time = Math.min(wavesurfer.getDuration(), wavesurfer.getCurrentTime() + 5); const time = Math.min(wavesurfer.getDuration(), wavesurfer.getCurrentTime() + 5);
wavesurfer.setTime(time); wavesurfer.setTime(time);
} }
@@ -78,17 +85,20 @@
/** Seek to a specific time in milliseconds. Called from transcript click-to-seek. */ /** Seek to a specific time in milliseconds. Called from transcript click-to-seek. */
export function seekTo(timeMs: number) { export function seekTo(timeMs: number) {
console.log('[voice-to-notes] seekTo called:', timeMs, 'ms, wavesurfer:', !!wavesurfer, 'duration:', wavesurfer?.getDuration()); if (!wavesurfer || !isReady) {
if (wavesurfer) { console.warn('[voice-to-notes] seekTo ignored — audio not ready yet');
wavesurfer.setTime(timeMs / 1000); return;
}
const timeSec = timeMs / 1000;
wavesurfer.setTime(timeSec);
if (!wavesurfer.isPlaying()) { if (!wavesurfer.isPlaying()) {
wavesurfer.play(); wavesurfer.play();
} }
} }
}
/** Load a new audio file. */ /** Load a new audio file. */
export function loadAudio(url: string) { export function loadAudio(url: string) {
isReady = false;
wavesurfer?.load(url); wavesurfer?.load(url);
} }
</script> </script>
@@ -96,11 +106,17 @@
<div class="waveform-player"> <div class="waveform-player">
<div class="waveform-container" bind:this={container}></div> <div class="waveform-container" bind:this={container}></div>
<div class="controls"> <div class="controls">
<button class="control-btn" onclick={skipBack} title="Back 5s"></button> <button class="control-btn" onclick={skipBack} title="Back 5s" disabled={!isReady}>⏪</button>
<button class="control-btn play-btn" onclick={togglePlayPause} title="Play/Pause"> <button class="control-btn play-btn" onclick={togglePlayPause} title="Play/Pause" disabled={!isReady}>
{#if $isPlaying}{:else}{/if} {#if !isReady}
{:else if $isPlaying}
{:else}
{/if}
</button> </button>
<button class="control-btn" onclick={skipForward} title="Forward 5s"></button> <button class="control-btn" onclick={skipForward} title="Forward 5s" disabled={!isReady}>⏩</button>
<span class="time">{currentTime} / {totalTime}</span> <span class="time">{currentTime} / {totalTime}</span>
</div> </div>
</div> </div>
@@ -130,9 +146,13 @@
cursor: pointer; cursor: pointer;
font-size: 1rem; font-size: 1rem;
} }
.control-btn:hover { .control-btn:hover:not(:disabled) {
background: #1a4a7a; background: #1a4a7a;
} }
.control-btn:disabled {
opacity: 0.4;
cursor: not-allowed;
}
.play-btn { .play-btn {
padding: 0.4rem 1rem; padding: 0.4rem 1rem;
font-size: 1.2rem; font-size: 1.2rem;

View File

@@ -102,6 +102,7 @@
stage: string; stage: string;
message: string; message: string;
}>('pipeline-progress', (event) => { }>('pipeline-progress', (event) => {
console.log('[voice-to-notes] Progress event:', event.payload);
const { percent, stage, message } = event.payload; const { percent, stage, message } = event.payload;
if (typeof percent === 'number') transcriptionProgress = percent; if (typeof percent === 'number') transcriptionProgress = percent;
if (typeof stage === 'string') transcriptionStage = stage; if (typeof stage === 'string') transcriptionStage = stage;
@@ -387,7 +388,8 @@
display: flex; display: flex;
gap: 1rem; gap: 1rem;
padding: 1rem; padding: 1rem;
height: calc(100vh - 3.5rem); height: calc(100vh - 3rem);
overflow: hidden;
background: #0a0a23; background: #0a0a23;
} }
.main-content { .main-content {