design(pr-detail): humanize old AI errors, drop dead live chrome, legible diffs, readable prose (#211) #5463
ccantynzAI Reviewcommented 24d ago
AI Triage
(no summary)
Priority: medium Risk area: mixed
Suggested labels: (no label suggestions) Suggested reviewers: (no reviewer suggestions)
Suggestions only — nothing has been applied. The PR author stays in control.
gluecron[bot]🤖 botAI Reviewcommented 24d ago
AI review unavailable
The platform's AI balance is exhausted, so AI generation is temporarily unavailable. Nothing was lost. You can queue this as a repair for the internal agent from the repository's Health page, or try again once the balance is restored. The PR is otherwise unchanged.
Cross-repo impact
See what breaks downstream if this PR merges.
⮌ Merged
This pull request was merged into main.
c comment · e edit title · m merge · a approve · r request changes · ? shortcuts
Part of the six-agent design sweep for the visual-audit ledger #211 — this PR covers the pull request detail surface (
src/routes/pulls.tsx,src/views/diff-view.tsx).Defect 1 — raw Anthropic error envelopes in old bot comments
isAiReviewcomment rows persisted the raw provider envelope verbatim:AI review unavailable … AI call failed: 400 {"type":"error","error":{…},"request_id":"req_…"}.presentAiCommentBody()(exported fromsrc/routes/pulls.tsx, 5 unit tests) rewrites the envelope portion at render time through the existinghumanizeAiError()translation — e.g. the credit-balance envelope now reads "The platform's AI balance is exhausted, so AI generation is temporarily unavailable…". Applied to both the conversation stream and inline diff comments. DB rows are untouched; prose that merely mentions a 400 status is left alone.Defect 2 — live-state chrome on merged/closed PRs
pr.state === "open". Merged/closed PRs show only truthful, frozen state.Defect 3 — near-illegible diff tints on the Files tab
rgba(52,211,153,.08)backgrounds,#6ee7b7/#fca5a5text) that all but vanish on the light theme's warm paper.--green/--red/--yellow/--bluetokens viacolor-mixat higher percentages (12–26%). Both theme token blocks already define these tokens, so light never falls through to dark values and dark stays complete.Defect 4 — edge-to-edge PR description
.issue-comment-box,.prs-comment, and.slash-pillcap at 900px within the PR detail styles; diffs, tabs, and panels keep the full width.Verification
bunx tsc --noEmit -p .— clean.bun test src/__tests__ --test-name-pattern "pull|pr-"— 56 pass / 0 fail (100 skip), including 5 new tests insrc/__tests__/pulls-present-ai-comment.test.ts.🤖 Generated with Claude Code