Fix broken notification and CLI review URLs (#507)

## Summary
- Push notifications were sending users to `/review/{id}` and
`/instrumental/{id}` which 404 on Cloudflare Pages static hosting
- Remote CLI was opening browser to path-based URLs missing the `#/`
hash fragment
- Documentation referenced incorrect URL formats

All URLs now correctly use hash-based routing: `/app/jobs#/{id}/review`
and `/app/jobs#/{id}/instrumental`

## Changes
- **backend/services/push_notification_service.py** — Fixed notification
click URLs
- **backend/api/routes/jobs.py** — Fixed edit track response
`review_url`
- **karaoke_gen/utils/remote_cli.py** — Fixed CLI browser open URLs
- **karaoke_gen/utils/cli_args.py** — Fixed help text
- **Tests** — Updated assertions in push notification and remote CLI
tests
- **Docs** — Fixed URL examples in API.md, README.md, TESTING.md
- **pyproject.toml** — Bump version 0.137.0 → 0.137.1

## Test plan
- [x] Backend push notification tests pass (35 tests)
- [x] Remote CLI tests pass (174 tests)
- [x] Full backend test suite passes (103 tests)
- [x] Frontend unit tests pass (581 tests)

<!-- @coderabbitai ignore -->

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Andrew Beveridge ☄️andClaude Opus 4.6 authored and GitHub committed 2026-03-07 21:22:28 -05:00
1 parent 3f568373fd
commit e04337fa5d
10 files changed
+13 -13

No files matched your search

+1 -1
View File
@@ -471,7 +471,7 @@ async def edit_completed_track(
status="success",
job_id=job_id,
message="Track reopened for editing. Previous outputs have been removed.",
review_url=f"/app/jobs#{job_id}/review",
review_url=f"/app/jobs#/{job_id}/review",
review_token=review_token,
metadata_updated=metadata_updated,
cleanup_results=cleanup_results,
@@ -243,12 +243,12 @@ class PushNotificationService:
if action_type == "lyrics":
notif_title = "Review Lyrics"
notif_body = f'"{title}" by {artist} needs lyrics review'
url = f"/review/{job_id}"
url = f"/app/jobs#/{job_id}/review"
tag = f"lyrics-{job_id}"
else: # instrumental
notif_title = "Select Instrumental"
notif_body = f'"{title}" by {artist} needs instrumental selection'
url = f"/instrumental/{job_id}"
url = f"/app/jobs#/{job_id}/instrumental"
tag = f"instrumental-{job_id}"
return await self.send_push(
@@ -772,7 +772,7 @@ class TestNotificationFormatting:
assert payload["title"] == "Review Lyrics"
assert "Test Song" in payload["body"]
assert "Test Artist" in payload["body"]
assert "/review/test-job-123" in payload["url"]
assert "/app/jobs#/test-job-123/review" in payload["url"]
@pytest.mark.asyncio
async def test_send_blocking_notification_instrumental(self, push_service):
@@ -802,7 +802,7 @@ class TestNotificationFormatting:
import json
payload = json.loads(call_args[1]["data"])
assert payload["title"] == "Select Instrumental"
assert "/instrumental/test-job-123" in payload["url"]
assert "/app/jobs#/test-job-123/instrumental" in payload["url"]
@pytest.mark.asyncio
async def test_send_completion_notification(self, push_service):
+1 -1
View File
@@ -317,7 +317,7 @@ Response:
"status": "success",
"job_id": "abc123",
"message": "Track reopened for editing. Previous outputs have been removed.",
"review_url": "/app/jobs#abc123/review",
"review_url": "/app/jobs#/abc123/review",
"review_token": "...",
"metadata_updated": true,
"cleanup_results": {
+1 -1
View File
@@ -126,7 +126,7 @@
- **Fast Preview Video Option** (2026-01-10): Added toggle in lyrics review UI to render preview videos with black background (~10s) instead of theme background image (~30-60s). Default is now black background for faster iteration during review. Users can enable theme background via checkbox when they want to verify the final look. See [API.md](API.md#generate-preview).
- **Frontend Consolidation** (2026-01-09): Consolidated three separate frontends into a single Next.js application. Previously: (1) Main frontend (Next.js + Tailwind), (2) Lyrics Review (React + Vite + MUI, ~14k lines), and (3) Instrumental Review (vanilla HTML/JS, ~1.7k lines) were deployed separately. Now all UIs are unified in the main frontend at `/app/jobs/{id}/review` and `/app/jobs/{id}/instrumental`. Benefits: single deployment to Cloudflare Pages, no external redirects during user workflows, unified design system (Radix/Tailwind), simpler authentication via job ownership model. See [archive/2026-01-09-frontend-consolidation-plan.md](archive/2026-01-09-frontend-consolidation-plan.md) and [tasks/](tasks/).
- **Frontend Consolidation** (2026-01-09): Consolidated three separate frontends into a single Next.js application. Previously: (1) Main frontend (Next.js + Tailwind), (2) Lyrics Review (React + Vite + MUI, ~14k lines), and (3) Instrumental Review (vanilla HTML/JS, ~1.7k lines) were deployed separately. Now all UIs are unified in the main frontend at `/app/jobs#/{id}/review` and `/app/jobs#/{id}/instrumental`. Benefits: single deployment to Cloudflare Pages, no external redirects during user workflows, unified design system (Radix/Tailwind), simpler authentication via job ownership model. See [archive/2026-01-09-frontend-consolidation-plan.md](archive/2026-01-09-frontend-consolidation-plan.md) and [tasks/](tasks/).
- **Admin Login Token for Made-For-You Orders** (2026-01-10): Added one-click admin login via email. When a made-for-you order is placed, the admin notification email now includes a direct link with an embedded login token (`?admin_token=TOKEN`). Clicking this link auto-authenticates the admin and opens the job directly - no manual login required. Tokens expire after 24 hours. Also added: BCC to `done@nomadkaraoke.com` on all job completion emails, fixed timezone display (EST→ET for DST correctness). See [API.md](API.md#verify-magic-link).
+1 -1
View File
@@ -495,7 +495,7 @@ async function debug() {
const page = await browser.newContext().then(c => c.newPage());
await page.addInitScript(t => localStorage.setItem('karaoke_access_token', t), TOKEN);
await page.goto(`https://gen.nomadkaraoke.com/app/jobs/${JOB_ID}/review/`);
await page.goto(`https://gen.nomadkaraoke.com/app/jobs#/${JOB_ID}/review`);
// Debug interactively - the browser stays open
await page.pause(); // Opens Playwright inspector
+1 -1
View File
@@ -378,7 +378,7 @@ def create_parser(prog: str = "karaoke-gen") -> argparse.ArgumentParser:
"--review-ui-url",
default=os.environ.get('REVIEW_UI_URL', os.environ.get('LYRICS_REVIEW_UI_URL', 'https://gen.nomadkaraoke.com')),
help="Frontend base URL for remote mode. Defaults to 'https://gen.nomadkaraoke.com'. "
"Review UIs are at /app/jobs/{id}/review and /app/jobs/{id}/instrumental. "
"Review UIs are at /app/jobs#/{id}/review and /app/jobs#/{id}/instrumental. "
"For local mode: defaults to bundled frontend (from lyrics_transcriber/frontend/). "
"(env: REVIEW_UI_URL or LYRICS_REVIEW_UI_URL)",
)
+2 -2
View File
@@ -1508,7 +1508,7 @@ class JobMonitor:
"""Open the lyrics review UI in browser."""
# Build the review URL using the consolidated frontend route
frontend_base = self.config.review_ui_url.rstrip('/')
url = f"{frontend_base}/app/jobs/{job_id}/review"
url = f"{frontend_base}/app/jobs#/{job_id}/review"
self.logger.info(f"Opening lyrics review UI: {url}")
self.open_browser(url)
@@ -1900,7 +1900,7 @@ class JobMonitor:
"""Open browser to instrumental review UI and wait for selection."""
# Build the review URL using the consolidated frontend route
frontend_base = self.config.review_ui_url.rstrip('/')
review_url = f"{frontend_base}/app/jobs/{job_id}/instrumental"
review_url = f"{frontend_base}/app/jobs#/{job_id}/instrumental"
self.logger.info("")
self.logger.info("=" * 60)
+1 -1
View File
@@ -1,6 +1,6 @@
[tool.poetry]
name = "karaoke-gen"
version = "0.137.0"
version = "0.137.1"
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 <andrew@beveridge.uk>"]
license = "MIT"
+1 -1
View File
@@ -921,7 +921,7 @@ class TestJobMonitor:
mock_open_browser.assert_called_once()
call_url = mock_open_browser.call_args[0][0]
# New consolidated frontend URL format
assert call_url == "https://review.example.com/app/jobs/job-123/review"
assert call_url == "https://review.example.com/app/jobs#/job-123/review"
def test_log_timeline_updates(self, monitor):
"""Test logging timeline events."""