Mergeability wording: "Able to be Merged" in green; simplified soft-red phrases for every blocked state #588
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#588
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?
Mergeability wording: "Able to be Merged" in green, simplified soft-red phrases for every blocked state
What's requested
The PR page's mergeability surfaces currently print the internal state machine's raw words in plain text. Simplify the user-visible wording following the #561 pattern: one shared display helper maps internal/merge state to human phrases plus a tone, with green for mergeable and soft red for every blocked state.
Proposed phrase set (tone noted):
Green (mergeable):
Soft red (blocked):
CHANGES_REQUESTED→ Changes requesteddirty→ Merge conflicts (keep the conflicting-file detail as secondary text or tooltip, not in the headline phrase)web/src/lib/checks-empty.js— treat per its existing semantics; implementer's call whether it's neutral or red, noted in the PR)Neutral (not blocked, not mergeable):
up_to_date) → Already merged"Soft red" = the muted red the app already uses for warnings on this page (
text-red-600 dark:text-red-400or thechip-closedred); green = the emerald family (chip-open/text-emerald-600 dark:text-emerald-400). Tailwind utilities only, no ad-hoc CSS.Evidence (static read)
web/src/components/MergeBox.jsx:164—<p class="text-sm">{state()}</p>renders the raw internal state word (draft|blocked|mergeable|ready|merging|failed) with no color and no phrase mapping. Users see "blocked" with nothing else on that line; the reasons live in a separate amber line (lines 194-197, "blocking merge: …").web/src/components/MergeBox.jsx:36-44—mergeState()is the internal machine (08 §2); its return values are implementation vocabulary, not UI copy.web/src/pages/Pull.jsx:59-73—mergeableText()prints "mergeable", "mergeable (behind)", "conflicts: file, file", "already merged", "checking…" as plain unstyled text in the sidebar.web/src/pages/Pull.jsx:1384— that sidebar value line:<p class="text-sm">{mergeableText(mergeable())}</p>.Two render sites, two inconsistent vocabularies ("mergeable" vs "mergeable" as a machine state, "conflicts: …" vs "blocked"), neither colored, neither phrased for humans.
Architecture notes
web/src/lib/pull-state.jsis the established home for pure PR display helpers (reviewVerdictLabelat line 112, headless-testable via node --test). Add one helper, e.g.mergeabilityDisplay(state, detail)→{ text, tone }or{ text, cls }, covering every internal mergeState value AND everymergeable.statevalue.mergeStatereturns,mergeable.statewire values from the API) stay byte-identical — this is display mapping only, mirroring how #561 kept review wire values untouched.MergeBox's chip-free design means the helper likely returns Tailwind text classes rather than chip classes.mergeableText). Keep the existing amber "blocking merge: …" reasons line (MergeBox.jsx:194-197) — it carries the detail; the headline phrase carries the state.tooltip(MergeBox.jsx:77-85) may keep machine wording for debugging, implementer's call.Acceptance criteria
web/src/lib/pull-state.jsmaps every state above to {phrase, tone}; no per-callsite ternaries at either render site.mergeableText's raw vocabulary.mergeStatereturns,mergeable.stateAPI values, state comparisons, and the merge button's enable logic (enabled(), MergeBox.jsx:76) untouched.Fixed by #591 (merged): shared mergeabilityDisplay helper in pull-state.js ({text, cls, sub}) applied at both MergeBox state line and sidebar — Able to be Merged in green, soft-red blocked phrases, neutral otherwise; zero-checks reads No checks required in neutral zinc; wire/machine values and enable logic untouched. Verified: 1481 unit tests green (smoke excluded, pre-existing), vite/esbuild green, independent review APPROVE with both state sets enumerated gap-free.