CodeIssuesPull RequestsActionsSecurityInsights
✨ AI
More
Settings

design(pr-detail): humanize old AI errors, drop dead live chrome, legible diffs, readable prose (#211) #5463

Merged⚡ AI-generatedXSccantynz wants to mergesweep/pr-detailmainopened 24d ago
ccantynzcommented 24d ago

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

  • Before: historical isAiReview comment rows persisted the raw provider envelope verbatim: AI review unavailable … AI call failed: 400 {"type":"error","error":{…},"request_id":"req_…"}.
  • After: new presentAiCommentBody() (exported from src/routes/pulls.tsx, 5 unit tests) rewrites the envelope portion at render time through the existing humanizeAiError() 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

  • Before: a merged PR still showed a frozen "Preview: Building" badge, the "Live: 0 editing" pill, and the "Live reviewers" presence bar (plus their SSE/WebSocket clients kept connecting).
  • After: the live pill + co-edit script, preview status badge, presence bar + presence script, and the presence toast container render only when pr.state === "open". Merged/closed PRs show only truthful, frozen state.

Defect 3 — near-illegible diff tints on the Files tab

  • Before: added/removed rows used fixed dark-theme pastels (rgba(52,211,153,.08) backgrounds, #6ee7b7/#fca5a5 text) that all but vanish on the light theme's warm paper.
  • After: row tints, gutters/markers, split-view cells, +/− stat pills, file-status pills, suggestion blocks and the jump-list counts are mixed from the semantic --green/--red/--yellow/--blue tokens via color-mix at 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

  • Before: the description body (and comment stream) ran the full ~1500px content shell — unreadable line lengths.
  • After: .issue-comment-box, .prs-comment, and .slash-pill cap 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 in src/__tests__/pulls-present-ai-comment.test.ts.
  • No merge/gate/route logic touched — presentation only.

🤖 Generated with Claude Code

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.

Analyze →
⮌ Merged

This pull request was merged into main.

c comment · e edit title · m merge · a approve · r request changes · ? shortcuts