feat(web): issue badge route + share/OG card on issue permalinks (#54 PR2b)#63
feat(web): issue badge route + share/OG card on issue permalinks (#54 PR2b)#63lukaso-bot wants to merge 1 commit into
Conversation
…PR2b) PR2 (#62) shipped the issue permalink but deferred its badge and the in-page share actions, because the embedded badge needs its own route: the PR badge route keys off `:number` and would mis-resolve an issue as a PR. - New `/i/:owner/:repo/:number/badge.svg` + federated `/h/:host/i/:projectPath/:number/badge.svg`. badgeRoute disambiguates issue-vs-PR on the path (both carry `:number`) and reuses the exact `issue#N` cache key the permalink page warms. States: released → tag, fix-merged-not-shipped → "not yet" (gold), still-open → "not yet" (gold, so it flips once fixed+shipped, mirroring an open PR), closed-without-fix → "unknown" (never flips). - Resolved + not-yet issue pages now carry the same share actions + dynamic per-commit OG card as PR/commit pages (drop the deferral). - Remove the now-unused `hideShare` prop from ResultCard (its only purpose was this deferral). Tests-first: issue badge calm-states (open/closed-without-fix/invalid), federated route registration, and a fully-resolved issue page asserting the share actions + per-commit og:image. Full validate.sh green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
In-house adversarial review (Copilot quota-blocked here → no automated review will land)Per Correctness — issue-vs-PR disambiguation on the shared
|
What
Completes the deferred share story of PR2 (#62) for issue permalinks — the third slice of #54.
/i/:owner/:repo/:number/badge.svgroute + federated/h/:host/i/:path/:number/badge.svg.badgeRoutedisambiguates issue-vs-PR on the path (both carry:number) and reuses theissue#Ncache key the permalink already warms.hideSharedeferral from PR2 and removed the now-dead prop fromResultCard.Why
PR2 (#62) shipped issue permalinks but deferred the badge + share/OG because the PR badge route keys off
:numberand would mis-read an issue as a PR. This adds the dedicated issue routes so issue permalinks reach parity with PR permalinks.Tests
Tests-first: 5 new integration tests (calm-state badges, federated registration, fully-resolved issue page asserting share actions +
og:image= per-commit card). Fullvalidate.shgreen locally (build / typecheck / 207✓ web tests / a11y / lint / shellcheck / actionlint / gitleaks / publint / osv). Pre-push gate green.After merge + deploy
Verify a resolved issue permalink shows the "as Badge" action and
/i/<o>/<r>/<n>/badge.svgreturns the version SVG.Follow-ups (not in this PR)
git-released <issue-url>).