From 105a5b28fdd911a45144de84fa849f26d3158e05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrew=20Beveridge=20=E2=98=84=EF=B8=8F?= Date: Fri, 3 Apr 2026 11:41:48 -0400 Subject: [PATCH] fix: default dashboard to all jobs, fix E2E completion detection (#655) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - Default the dashboard status filter from "active" to "all" so completed jobs remain visible (existing localStorage preferences preserved) - Add recovery logic to E2E happy path test: after 10 consecutive "card unavailable" polls, automatically switch the filter dropdown to "All statuses" - Bump version to 0.157.4 **Root cause:** The daily E2E test (run #126) timed out at Step 9 because the "active" filter uses `hide_completed: true` at the API level — when the job completed, the card vanished from the DOM and the test retried for ~25 min until timeout. The generator itself was working fine. ## Test plan - [x] All 707 tests pass (`make test`) - [x] CodeRabbit review clean (1 finding fixed) - [ ] Next scheduled E2E run should pass with these changes @coderabbitai ignore 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 --- frontend/app/app/page.tsx | 8 ++--- .../production/happy-path-real-user.spec.ts | 29 ++++++++++++++++++- pyproject.toml | 2 +- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/frontend/app/app/page.tsx b/frontend/app/app/page.tsx index 1e252413..32fbcd35 100644 --- a/frontend/app/app/page.tsx +++ b/frontend/app/app/page.tsx @@ -64,8 +64,8 @@ function AppPageContent() { return saved ? Number(saved) : 10 }) const [statusFilter, setStatusFilter] = useState(() => { - if (typeof window === "undefined") return "active" - return localStorage.getItem("nomad-karaoke-status-filter") || "active" + if (typeof window === "undefined") return "all" + return localStorage.getItem("nomad-karaoke-status-filter") || "all" }) const [searchInput, setSearchInput] = useState("") const [searchQuery, setSearchQuery] = useState("") @@ -453,7 +453,7 @@ function AppPageContent() { {!hasFetchedSuccessfully ? 'Loading...' - : searchQuery || statusFilter !== 'active' + : searchQuery || (statusFilter !== 'all' && statusFilter !== 'active') ? `${jobs.length} job${jobs.length !== 1 ? 's' : ''} matching filters` : `${jobs.length} job${jobs.length !== 1 ? 's' : ''}`} @@ -466,7 +466,7 @@ function AppPageContent() {

Loading jobs...

- ) : searchQuery || statusFilter !== 'active' ? ( + ) : searchQuery || (statusFilter !== 'all' && statusFilter !== 'active') ? ( <>

No jobs match your filters.

diff --git a/frontend/e2e/production/happy-path-real-user.spec.ts b/frontend/e2e/production/happy-path-real-user.spec.ts index d99f6761..69b310c3 100644 --- a/frontend/e2e/production/happy-path-real-user.spec.ts +++ b/frontend/e2e/production/happy-path-real-user.spec.ts @@ -833,6 +833,9 @@ test.describe('E2E Happy Path - Real User with Full UI Interactions', () => { // Add extra buffer for variable processing times const completionTimeout = TIMEOUTS.videoRendering + TIMEOUTS.finalEncoding + 600_000; // 35 minutes total + let consecutiveUnavailable = 0; + const maxConsecutiveUnavailable = 10; // ~2 minutes of retries before trying recovery + while (Date.now() - encodeStartTime < completionTimeout) { if (await refreshBtn.isVisible().catch(() => false)) { await refreshBtn.click(); @@ -844,8 +847,32 @@ test.describe('E2E Happy Path - Real User with Full UI Interactions', () => { let statusText: string; try { statusText = await jobCard.textContent({ timeout: 15000 }) || ''; + consecutiveUnavailable = 0; // Reset counter on success } catch { - console.log(' Job card temporarily unavailable, retrying...'); + consecutiveUnavailable++; + console.log(` Job card temporarily unavailable (${consecutiveUnavailable}/${maxConsecutiveUnavailable}), retrying...`); + + if (consecutiveUnavailable >= maxConsecutiveUnavailable) { + // Card has been gone too long — the job likely completed and the status filter + // is hiding it. Switch filter to "All statuses" to make it visible again. + console.log(' Card missing too long — switching status filter to "All statuses"...'); + const filterSelect = page.getByRole('combobox', { name: /filter by status/i }); + if (await filterSelect.isVisible().catch(() => false)) { + await filterSelect.click(); + await page.waitForTimeout(500); + const listbox = page.getByRole('listbox'); + const allOption = listbox.getByRole('option', { name: /all statuses/i }); + if (await allOption.isVisible().catch(() => false)) { + await allOption.click(); + await page.waitForTimeout(3000); + consecutiveUnavailable = 0; // Reset and try again with new filter + continue; + } + } + // If we couldn't change the filter, throw a descriptive error + throw new Error('Job card disappeared for too long — job may have completed but status filter is hiding it'); + } + await page.waitForTimeout(5000); continue; } diff --git a/pyproject.toml b/pyproject.toml index f65fd8fc..2626eb5a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "karaoke-gen" -version = "0.157.3" +version = "0.157.4" description = "Generate karaoke videos with synchronized lyrics. Handles the entire process from downloading audio and lyrics to creating the final video with title screens." authors = ["Andrew Beveridge "] license = "MIT"