fix: contract deep links on direct load, persistent highlight, permalink icons (#611)#614
Conversation
…ink icons Three findings from user testing of the contract links: 1. Direct page loads of /contract/<id> did nothing: the contracts page fetches contracts.json before rendering, so the card appears well after the route handler returns — the single next-tick check missed it. The router now polls for the card (100ms steps, up to ~3s). SPA-internal navigation was unaffected because the data was already loaded, which is why the bug only showed on direct URLs. 2. The highlight was a 2.5s flash. It is now persistent — the ring stays on the card until the next route change (cleared centrally, including when switching from one contract to another). 3. Linking only the title was too discoverable-by-accident: every card now carries an explicit permalink chain icon (SPA cards next to the copy button, static no-JS cards next to the title), localized tooltip/aria-label. Verified via Playwright against the built preview on the exact failing case: direct load of /contract/explaining-teaching/ now titles the tab, scrolls to the card, and highlights it persistently; 19/19 cards carry the permalink icon. 111/111 unit tests pass (3 new: late-render polling, persistent highlight + clear, icon presence). Refs LLM-Coding#611 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 7 minutes and 5 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Addresses the three findings from testing the deployed contract links (#612/#613). Note: this commit was originally pushed to the #613 branch after that PR had already been merged — the changes never landed; this PR carries them properly (cherry-picked onto current main, full test suite re-run).
1. Direct URL loads did nothing (the bug)
/contract/<id>worked when navigating inside the SPA but not on a direct page load: the contracts page fetchescontracts.jsonbefore rendering, so the card appears well after the route handler returns — the single next-tick check missed it. The router now polls for the card (100 ms steps, up to ~3 s). SPA navigation was unaffected because the data was already in memory, which is exactly why the bug only showed on direct URLs.2. Persistent highlight
The 2.5 s highlight flash is now a persistent ring that stays on the card until the next route change (cleared centrally, including contract→contract switches).
3. Explicit permalink icons
Every card carries a chain icon linking to its detail page — SPA cards next to the copy button, static no-JS cards next to the title; title links remain. Localized tooltip/aria-label (EN + DE).
Verification
/contract/explaining-teaching/titles the tab, scrolls to the card, highlights it persistently; 19/19 cards carry the permalink iconRefs #611
🤖 Generated with Claude Code