stream auto review progress over SSE so large inboxes don't feel frozen
Build and Push Docker Image / build (push) Successful in 1m18s
Build and Push Docker Image / build (push) Successful in 1m18s
sortInbox is now async, yields every 10 items, and emits inbox_sort_start + inbox_sort_progress via optional hooks. the pipeline route handler wires those hooks to the existing job events stream and guards against a second concurrent sort with a 409. the inbox column swaps its Auto Review button for a live "Sorting N/T" counter and progress bar while the sort is in flight; the auto-process toggle hides to give the progress the full subtitle line. the previous behaviour was a frozen button for the entire duration of the sort. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -144,6 +144,16 @@ export function emitInboxSorted(result: { moved_to_queue: number; moved_to_revie
|
||||
for (const l of jobListeners) l(line);
|
||||
}
|
||||
|
||||
export function emitInboxSortStart(total: number): void {
|
||||
const line = `event: inbox_sort_start\ndata: ${JSON.stringify({ total })}\n\n`;
|
||||
for (const l of jobListeners) l(line);
|
||||
}
|
||||
|
||||
export function emitInboxSortProgress(processed: number, total: number): void {
|
||||
const line = `event: inbox_sort_progress\ndata: ${JSON.stringify({ processed, total })}\n\n`;
|
||||
for (const l of jobListeners) l(line);
|
||||
}
|
||||
|
||||
/** Parse "Duration: HH:MM:SS.MS" from ffmpeg startup output. */
|
||||
function parseFFmpegDuration(line: string): number | null {
|
||||
const match = line.match(/Duration:\s*(\d+):(\d+):(\d+)\.(\d+)/);
|
||||
|
||||
Reference in New Issue
Block a user