Fix #561: PR page renders review/decision statuses as display labels #563
No reviewers
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub!563
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/issue-561"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The PR page rendered review/decision statuses as raw wire values (APPROVED, CHANGES_REQUESTED, REVIEW_REQUIRED, ...). This change adds ONE shared display-label helper and applies it at the three user-facing render sites. Display-only: the API wire contract (internal/review/model.go) is unchanged.
Changes
reviewVerdictLabel(state)(the existing home of pullBadgeView/pullListChip — dependency-free, headless-testable, no new deps per law 1):grep -rn "r.state | .decision | rv.state" web/src: no other page renders raw review/decision wire valuesTests
vite buildgreen;esbuildSDK bundle green;go vet ./internal/...clean (no Go change); web/dist/.keep restoredIndependent review — APPROVED (no changes requested)
Reviewed
origin/fix/issue-561(c7ecb53, 4 files +109/-4) against issue #561, verified independently in/tmp/walhub-561. No fix commits — the branch is clean as-is.Acceptance criteria (all met)
reviewVerdictLabel(state)inweb/src/lib/pull-state.js, used at all 3 sites; no ternaries/mapping logic inPull.jsx.Pull.jsx:107rendersreviewVerdictLabel(summary()?.decision ?? "REVIEW_REQUIRED").Pull.jsx:117renders{who} · {reviewVerdictLabel(r.state)}.Pull.jsx:163non-dismissed branch rendersreviewVerdictLabel(rv.state); dismissed branch keeps itsdismissed #Ntext (correct — already human text).COMMENTED/APPROVED/CHANGES_REQUESTED),state: getVerdict()payload, staleShowguard still keyed onr.state === "APPROVED"", all threereviewVerdictChip(...)class mappings still keyed on wire values, reviewer-chiptitle` keeps wire value (explicitly implementer's call per the issue).review-verdict-label-561.test.js: all 5 known values + unknown passthrough + 3 missing shapes (null/undefined/"") — exceeds the 5+unknown bar.web/src: no other raw renders.reviewDecision={() => summary()?.decision}(Pull.jsx:1157) passes wire intoMergeBox, which only compares (=== "CHANGES_REQUESTED") and renders already-human text ("changes requested") — not a raw render, correctly untouched.{who} · requestedis human text. Nothing missed.Checklist items
pullBadgeView/pullListChip), pure, zero imports (dependency-free), JSDoc convention matches siblings.String(state)(debuggable, never blank); null/undefined/"" → "Unknown" (the issue's implementer's-call option, noted in the doc amendment).docs/go/12_web_ui.mdDecisions section in the same change.Verification run
smoke.test.js(needs a live server; no server/static changes in this PR, unrelated).vite buildgreen (chunk-size warning is pre-existing). Note: the build wiped the trackedweb/dist/.keep(emptyOutDir); I restored it — worktree is clean, nothing committed.Verdict: APPROVE — ready to merge.