Skip to content

fix: contract deep links on direct load, persistent highlight, permalink icons (#611)#614

Merged
rdmueller merged 1 commit into
LLM-Coding:mainfrom
raifdmueller:fix/611-deep-link-polling
Jun 12, 2026
Merged

fix: contract deep links on direct load, persistent highlight, permalink icons (#611)#614
rdmueller merged 1 commit into
LLM-Coding:mainfrom
raifdmueller:fix/611-deep-link-polling

Conversation

@raifdmueller

Copy link
Copy Markdown
Contributor

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 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 (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

  • Playwright against the built preview on the exact failing case: direct load of /contract/explaining-teaching/ titles the tab, scrolls to the card, highlights it persistently; 19/19 cards carry the permalink icon
  • 111/111 unit tests pass on this branch (3 new: late-render polling, persistent highlight + clearing, icon presence)
  • Lint + Prettier clean

Refs #611

🤖 Generated with Claude Code

…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>
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@raifdmueller, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 3aea5fe0-5a79-4c68-9606-4ed6cb999dd6

📥 Commits

Reviewing files that changed from the base of the PR and between 386e555 and 189f3fd.

📒 Files selected for processing (5)
  • scripts/render-contracts.js
  • website/src/components/contracts-page.js
  • website/src/components/contracts-page.test.js
  • website/src/utils/router.js
  • website/src/utils/router.test.js
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@rdmueller rdmueller merged commit 964cb7c into LLM-Coding:main Jun 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants