PR page renders review/decision statuses as raw wire values (REVIEW_REQUIRED etc.) #561
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 project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub#561
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
What's requested
Review and decision statuses on the PR page render as raw SCREAMING_SNAKE wire values instead of human-readable labels. The API's wire contract (internal/review/model.go:91, :163 —
stateisAPPROVED|CHANGES_REQUESTED|COMMENTED;decisionisREVIEW_REQUIREDetc.) is correct and must stay unchanged — this is a display-label mapping at the render sites only.Add ONE shared display-label helper (e.g.
reviewVerdictLabel(state)inweb/src/lib/pull-state.js, the existing home of PR display helpers, dependency-free and headless-testable per the pull-state.js convention) mapping:APPROVED→ApprovedCHANGES_REQUESTED→Changes requestedCOMMENTED→CommentedREVIEW_REQUIRED→Review requiredDISMISSED→Dismissed(rollup-only value, internal/review/model.go:62)Unknown), implementer's call, noted in the PRApply it at every user-facing site; wire values (select option values,
reviewVerdictChipstate comparisons,Showguards, title attributes) stay byte-identical.Evidence (static read, web/src/pages/Pull.jsx)
{summary()?.decision ?? "REVIEW_REQUIRED"}→ users seeREVIEW_REQUIREDas the page's headline status.{who} · {r.state}→alice · APPROVED,bob · CHANGES_REQUESTED.rv.stateraw (APPROVED/CHANGES_REQUESTED/COMMENTED).Not bugs (already human text, leave alone): the FinishReview select option labels (Pull.jsx:699-701, "approve" etc. — the values are wire strings and must stay), MergeBox.jsx text ("changes requested"), and the chip-class mapping
reviewVerdictChip(Pull.jsx:82, keyed on wire values by design).Architecture notes
web/src/lib/pull-state.jsis the established home for exactly this class of pure PR display helpers (pullBadgeView, pullListChip) and is covered bynode --test; the new helper belongs there next to them, with a unit test.reviewVerdictChip(Pull.jsx:82) stays keyed on wire values — only the rendered text changes.titletooltip on reviewer chips (Pull.jsx:116) may keep the wire value if that's useful for debugging, implementer's call — but the visible text gets the label.Acceptance criteria
REVIEW_REQUIRED.alice · Approvedstyle labels.rv.state.node --testcovers the new helper (all five known values + unknown passthrough).grep -rn "r.state\|\.decision\|rv.state" web/src).Fixed by #563 (merged): shared reviewVerdictLabel helper in pull-state.js applied at all three PR-page sites (summary badge, reviewer chips, review-card chips). Wire contract untouched. Verified: full suite green apart from pre-existing live-server smoke failure, vite+esbuild green, independent review APPROVE.