Files
karaoke-gen/frontend/jest.setup.d.ts
T
Andrew Beveridge ☄️andClaude Opus 4.5 b16bdb024b Fix: hash-based navigation from job list (#312)
## Summary
- Fix bug where clicking "Review Lyrics" or "Select Instrumental" from
the job list showed "Page not found" but reloading worked
- Changed from Next.js `Link` to regular `<a>` tags for hash-based URLs

## Root Cause
Next.js `Link` uses `history.pushState` for client-side navigation,
which doesn't trigger the `hashchange` event. The client.tsx component's
hash state wasn't updating when navigating.

## Solution
Use regular `<a>` tags for hash URLs (`/app/jobs#/{jobId}/review`). When
clicking an `<a>` tag with a hash URL on the same page, the browser:
1. Updates the hash without reloading
2. Fires the `hashchange` event
3. Our listener updates state
4. Component re-renders with correct route

## Test plan
- [x] Unit tests pass
- [ ] Manual test: Click "Review Lyrics" from job list - should navigate
correctly

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

@coderabbitai ignore

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 01:14:45 +00:00

2 lines
52 B
TypeScript

/// <reference types="@testing-library/jest-dom" />