Skip to content

fix(sidebar): distinguish passing checks from a mergeable PR - #29

Merged
nplez1 merged 1 commit into
nplez1/mainfrom
nplez1/Mergeable-Indicator
Sep 25, 2026
Merged

nplez1 merged 1 commit into
nplez1/mainfrom
nplez1/Mergeable-Indicator

Conversation

@nplez1

@nplez1 nplez1 commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

ELI5

Every workspace card shows a small icon for its pull request, and that icon turns green when CI passes. The problem is that green does not mean "this can merge". Most repos also want a human to approve, sometimes a thread resolved, sometimes the branch brought up to date. So a green PR could still be one nobody can merge, and the card gave you no hint of that.

Now the icon keeps its CI colour and grows a small dot when something other than CI is still holding the merge up. Amber means a requirement is outstanding, red means a hard blocker, grey means the provider has not worked it out yet. Hovering tells you which one in words — "PR checks: Passing · Approval required".

What Changed

Before

  • The workspace card's PR glyph was painted emerald when the PR was open or when checks had passed — one colour, two meanings. A PR with green checks and a pending approval looked exactly like a fully mergeable one.
  • The glyph's tooltip and screen-reader text said PR checks: Passing, which reads as "this can merge".
  • The card's hover details showed a Checks: Passing badge and nothing about merge readiness.
  • On the Tasks page, the green Passing pill in the Checks column read the same way. The Merge column beside it was already accurate.

After

  • The card glyph keeps reporting CI exactly as before (emerald passing, amber pending, rose failing), and gains a 5px dot at its corner only when the provider is not letting the merge go:
    • amber — a requirement is still outstanding: approval required, unresolved threads, behind base, merge queue;
    • rose — a hard blocker: conflicts, changes requested, blocked;
    • muted grey — the provider has not computed mergeability yet;
    • no dot — the provider positively reported an open merge box.
  • The tooltip and screen-reader label name the specific reason: PR checks: Passing · Approval required, or PR checks: Passing · Ready to merge when it is genuinely mergeable.
  • Hover details gain a merge-readiness badge next to the checks badge, so both facts are readable at once.
  • The Tasks page checks pill gets the same dot, with the blocker named in its tooltip.
  • Works across GitHub, GitLab, Bitbucket, Azure DevOps and Gitea.

Mechanism

  • One new source of truth, src/renderer/src/components/hosted-review-merge-readiness.ts, maps state / mergeable / mergeStateStatus / reviewDecision / mergeQueueRequired / checks status to { readiness, marker, reason }. Three surfaces consume it, so they cannot disagree.
  • Ready requires positive evidence. Emerald-with-no-dot needs mergeStateStatus ∈ {CLEAN, UNSTABLE, HAS_HOOKS}, or a bare mergeable: MERGEABLE from the providers that report no merge state at all. GitHub returns MERGEABLE as soon as there are no conflicts, before it knows whether approvals or required checks are satisfied, so trusting that field alone would assert a mergeability GitHub has not granted.
  • CI cannot raise the dot. A failing or pending roll-up reports readiness but claims no reason, because the glyph's colour already carries it — a dot that fires for CI would say nothing more than the colour underneath it.
  • CI cannot lower an open merge box either. UNSTABLE means non-required checks are failing and the merge is still allowed, so it reports mergeable; only a bare mergeable, which accounts for neither required checks nor approvals, is disqualified by red CI.
  • New --status-warning token family in main.css and three statusSuccess / statusWarning / statusDanger variants in badge.tsx. The changed-lines design-system gate rejects raw palette colours and forbids painting a shadcn primitive's status by hand, so the tone has to live in the primitive.

Why

  • Why a marker instead of recolouring the glyph. Recolouring means a PR with green CI and a pending approval turns amber, which reads as failing CI and just moves the confusion. Two separate facts belong in two separate channels.
  • Why a new module rather than reusing presentGitHubPRMergeState. That function answers "may I offer the merge button", not "is this mergeable": it returns a success tone for Checks passed precisely when merge metadata is absent, and directMergeAvailable: true when GitHub reports UNKNOWN. Reusing its tone as proof of readiness would recreate the original bug. It stays where it is, as the merge button's presentation.
  • Why "not computed yet" earns its own marker. GitHub recomputes mergeStateStatus after every push, and during that window even an approval-blocked PR is genuinely unknown. Leaving green dotless there would silently assert mergeable — the exact conflation this change exists to remove. A muted dot says "not decided" without crying wolf about a blocker that may not exist, and unlike amber it is not a false alarm.
  • Why the provider-neutral fallback exists. GitLab reports a detailed merge status and a conflict flag; Bitbucket, Azure DevOps and Gitea report only mergeable. Those three are the one place where a bare MERGEABLE is the whole signal, so it is trusted — but weighed against CI, because it says nothing about required checks.

Linked Issue

N/A — no tracking issue, and none is possible: GitHub issues are disabled on this fork (nplez1/orca).

Visual Proof

N/A — deliberately no capture, at the author's request. Stated plainly rather than implied: this is a visible change, and nothing was rendered. The $electron skill that AGENTS.md names for rendered-UI checks is not installed in this worktree (available skills are computer-use, find-skills, orca-cli, orchestration), no app was launched, and no screenshot was taken.

So the surface left unverified by eye is exactly this: how a 5px dot reads against a 13px glyph in light and dark mode, and whether the amber dot stays distinguishable from the amber pending-checks glyph colour at that size. Everything else about the change is asserted as markup — the existing suite already pins the glyph tones, and the new tests pin the marker's presence, data attribute and tone class for each state.

Testing

Verified on macOS on the branch as pushed:

  • pnpm tc — clean.

  • pnpm lint — passes (exit 0), the whole chain: oxlint, anti-slop, code-quality native and type-aware, reliability gates, dead-classes, max-lines ratchet, ts-nocheck ratchet, runtime-electron ratchet, README links, RPC-params catalog, bundled skill guides, skill bundle manifest, and all four localization verifications.

  • 3122 passed across 369 test files in the affected areas: components/sidebar, components/task-page, github-pr-merge-state, right-sidebar/gitlab-mr-merge-state, task-page-checks-pill, and the new module.

  • New tests: hosted-review-merge-readiness.test.ts (14 — the verdict table per provider, and the invariant that no input without positive provider evidence reports mergeable), WorktreeCardMetadataStatusBadges.test.tsx (7), and 6 added to WorktreeCardStatusSlot.test.tsx covering the marker, the named blocker, and silence when the provider reports nothing.

  • pnpm run check:code-quality:changed — 0 new findings across 10 changed files (code quality, casting, focused plugins, type-aware, React Doctor, design system, casting-SAFETY).

  • verify:localization-catalog, verify:localization-extraction, verify:localization-runtime-catalog, verify:localization-coverage — all pass; the 10 new keys are registered in locales/en.json via sync:localization-catalog, and en-runtime-required.json is unchanged from the base.

  • CI outcome: all 30 checks pass — 8/8 unit shards, static analysis, typecheck, package, package (windows), and verify. One shard failed on the first run and passed unchanged on re-run, so it is recorded here rather than left for a reviewer to wonder about. That job reported zero test failures (1159 passed | 11 skipped files, 10989 passed | 59 skipped tests) and failed only on an unhandled Vitest worker-teardown error — EnvironmentTeardownError: [vitest-worker]: Closing rpc while "onUserConsoleLog" was pending — attributed to src/main/ipc/worktrees-detected-scan-cache.test.ts. That file is main-process and imports nothing this branch touches, and the identical error appears on run 35963603717 (nplez1/Copilot-Issues), which does not contain this change, so it is a pre-existing teardown race rather than a defect in this diff.

    • Deliberately not "fixed": Vitest attributes that error to whichever file was last running in the worker it is tearing down, and the worktrees handler path contains no console call at all, so there is no targeted cause to correct. The only in-repo ways to silence it are suite-wide (dangerouslyIgnoreUnhandledErrors), which would mask genuine unhandled errors — not something to slip into a UI change. Flagging it as a follow-up instead.
    • Possibly relevant to why it surfaced here: this branch adds three test files, and CI balances shards by recorded timing (ORCA_BALANCE_UNIT_SHARDS=1), so it can change which file a worker ends on. That would make a latent race likelier to show without being caused by this diff.
  • Not run: pnpm build. On the full suite, be aware: it also reports failures in unrelated main-process suites, and those are not from this branch. I stashed this work and re-ran two of them (main/opencode/hook-plugin-module-contract, main/browser/browser-manager-viewport-ownership) — both fail identically on the clean base — and the failing-file count differed between two runs of identical code (4, then 24), which points at environment/flakiness rather than this diff. This branch changes only renderer presentation.

  • No manual app run. The steps a reviewer should follow: open a workspace whose PR has green CI and a required approval outstanding — the glyph should stay emerald and grow an amber dot, and the hover tooltip should read PR checks: Passing · Approval required. A conflicting PR should give a rose dot and Conflicts. A PR with no reviews required and CI green should give no dot and Ready to merge. On GitHub, immediately after pushing to the PR branch, the dot should be muted grey for a moment while the merge box is recomputed.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Code authored with an AI coding agent (pi, model deepseek-flash) under human direction, including the design decisions recorded in the Why section. Verification and the description above come from the same session against real gate output, not from the agent's summary of itself.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

  • Security: no new surface. No credentials, no network call, no new IPC or RPC. Mergeability is read from HostedReviewInfo, which the execution host already fetches and already publishes over the existing wire.
  • Cross-platform (Linux / Windows / Mac): no OS-specific code, no new shortcuts, no path handling. It is a pure derivation from data plus React markup. One components/ui/ primitive is touched, badge.tsx, and only additively — three new variants, no existing variant altered, so no current caller changes appearance.
  • Remote SSH: works unchanged, because the merge fields are already on the payload a remote host ships. No new field, no new method, no capability negotiation needed — and the feature degrades to "no marker" if a host predates those fields in its responses, which is also what happens today.
  • Mobile: untouched, deliberately. The mobile PR sidebar has its own checks section and can adopt the same module later; the module is in shared renderer code, not sidebar-local, specifically so it can.
  • Backwards compatibility: presentation only. No store shape, persisted setting, wire format or public type changed. A provider or older runtime that omits merge metadata yields no marker and no claim.
  • Folder workspaces: covered. Folder-backed cards render the same status lane and hover details, and a linked-review row whose details have not loaded claims nothing rather than flashing a marker.
  • Performance: one pure function per card render, over data already in the store. No added fetch, no added subscription, and it runs once per row rather than per frame.
  • Known limitation, deliberate: checks-only blockers raise no dot and add no reason text, so a PR stuck only on CI shows its CI state and says nothing extra about merging. That is the design: CI already owns the glyph colour, and dotting every in-flight PR would make the marker mean nothing.
  • Audited, deliberately out of scope: two other places still paint green from check status — the right-sidebar activity bar (activity-bar-buttons.tsx, whose dot sits on the Checks tab button, so it is unambiguously about checks) and parent-pr-checks-row-status.ts (the parent-PR checks row, which already routes conflicts to needs-attention). Neither presents itself as a mergeability claim, so neither was changed.

Checklist

  • This PR is small and focused — 10 files: one new module, its tests, three consumers, a token family and a primitive variant
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason — no capture taken; see Visual Proof for what that leaves unverified
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred) — pnpm lint, pnpm tc, the affected suites, the changed-code quality gate and all four localization verifications pass locally; CI is fully green (all 30 checks) including the full pnpm test across all 8 shards, static analysis and both package jobs. Only pnpm build is unverified locally, and CI covers it.

A workspace card's PR glyph was painted emerald when the PR was open *or* when
checks had passed, so one colour carried two meanings and a PR with green CI
and a pending approval looked exactly like a fully mergeable one. Its tooltip
said "PR checks: Passing", which reads the same way.

The glyph now keeps reporting CI and gains a corner dot when the provider is
not letting the merge go: amber for a requirement still outstanding, rose for a
hard blocker, muted while the provider is still computing. The tooltip and
screen-reader label name the reason, and the card's hover details and the Tasks
page checks pill show the same verdict.

hosted-review-merge-readiness.ts is the one source of truth for it, mapping
state/mergeable/mergeStateStatus/reviewDecision/mergeQueueRequired onto
{readiness, marker, reason} for every provider. Readiness needs positive
evidence — GitHub returns mergeable=MERGEABLE as soon as there are no
conflicts, before it knows about approvals, so trusting that field alone would
assert a mergeability GitHub has not granted.

Checks neither raise the dot nor lower an open merge box: the glyph colour
already carries CI, and UNSTABLE means only non-required checks are failing.

The status tones live in new --status-warning tokens and three badge variants,
because the changed-lines design-system gate rejects raw palette colours.
@nplez1
nplez1 merged commit 3c56fba into nplez1/main Sep 25, 2026
56 of 58 checks passed
nplez1 added a commit that referenced this pull request Sep 25, 2026
A workspace card's PR glyph was painted emerald when the PR was open *or* when
checks had passed, so one colour carried two meanings and a PR with green CI
and a pending approval looked exactly like a fully mergeable one. Its tooltip
said "PR checks: Passing", which reads the same way.

The glyph now keeps reporting CI and gains a corner dot when the provider is
not letting the merge go: amber for a requirement still outstanding, rose for a
hard blocker, muted while the provider is still computing. The tooltip and
screen-reader label name the reason, and the card's hover details and the Tasks
page checks pill show the same verdict.

hosted-review-merge-readiness.ts is the one source of truth for it, mapping
state/mergeable/mergeStateStatus/reviewDecision/mergeQueueRequired onto
{readiness, marker, reason} for every provider. Readiness needs positive
evidence — GitHub returns mergeable=MERGEABLE as soon as there are no
conflicts, before it knows about approvals, so trusting that field alone would
assert a mergeability GitHub has not granted.

Checks neither raise the dot nor lower an open merge box: the glyph colour
already carries CI, and UNSTABLE means only non-required checks are failing.

The status tones live in new --status-warning tokens and three badge variants,
because the changed-lines design-system gate rejects raw palette colours.
nplez1 added a commit that referenced this pull request Sep 27, 2026
A workspace card's PR glyph was painted emerald when the PR was open *or* when
checks had passed, so one colour carried two meanings and a PR with green CI
and a pending approval looked exactly like a fully mergeable one. Its tooltip
said "PR checks: Passing", which reads the same way.

The glyph now keeps reporting CI and gains a corner dot when the provider is
not letting the merge go: amber for a requirement still outstanding, rose for a
hard blocker, muted while the provider is still computing. The tooltip and
screen-reader label name the reason, and the card's hover details and the Tasks
page checks pill show the same verdict.

hosted-review-merge-readiness.ts is the one source of truth for it, mapping
state/mergeable/mergeStateStatus/reviewDecision/mergeQueueRequired onto
{readiness, marker, reason} for every provider. Readiness needs positive
evidence — GitHub returns mergeable=MERGEABLE as soon as there are no
conflicts, before it knows about approvals, so trusting that field alone would
assert a mergeability GitHub has not granted.

Checks neither raise the dot nor lower an open merge box: the glyph colour
already carries CI, and UNSTABLE means only non-required checks are failing.

The status tones live in new --status-warning tokens and three badge variants,
because the changed-lines design-system gate rejects raw palette colours.
nplez1 added a commit that referenced this pull request Sep 29, 2026
A workspace card's PR glyph was painted emerald when the PR was open *or* when
checks had passed, so one colour carried two meanings and a PR with green CI
and a pending approval looked exactly like a fully mergeable one. Its tooltip
said "PR checks: Passing", which reads the same way.

The glyph now keeps reporting CI and gains a corner dot when the provider is
not letting the merge go: amber for a requirement still outstanding, rose for a
hard blocker, muted while the provider is still computing. The tooltip and
screen-reader label name the reason, and the card's hover details and the Tasks
page checks pill show the same verdict.

hosted-review-merge-readiness.ts is the one source of truth for it, mapping
state/mergeable/mergeStateStatus/reviewDecision/mergeQueueRequired onto
{readiness, marker, reason} for every provider. Readiness needs positive
evidence — GitHub returns mergeable=MERGEABLE as soon as there are no
conflicts, before it knows about approvals, so trusting that field alone would
assert a mergeability GitHub has not granted.

Checks neither raise the dot nor lower an open merge box: the glyph colour
already carries CI, and UNSTABLE means only non-required checks are failing.

The status tones live in new --status-warning tokens and three badge variants,
because the changed-lines design-system gate rejects raw palette colours.
nplez1 added a commit that referenced this pull request Oct 1, 2026
A workspace card's PR glyph was painted emerald when the PR was open *or* when
checks had passed, so one colour carried two meanings and a PR with green CI
and a pending approval looked exactly like a fully mergeable one. Its tooltip
said "PR checks: Passing", which reads the same way.

The glyph now keeps reporting CI and gains a corner dot when the provider is
not letting the merge go: amber for a requirement still outstanding, rose for a
hard blocker, muted while the provider is still computing. The tooltip and
screen-reader label name the reason, and the card's hover details and the Tasks
page checks pill show the same verdict.

hosted-review-merge-readiness.ts is the one source of truth for it, mapping
state/mergeable/mergeStateStatus/reviewDecision/mergeQueueRequired onto
{readiness, marker, reason} for every provider. Readiness needs positive
evidence — GitHub returns mergeable=MERGEABLE as soon as there are no
conflicts, before it knows about approvals, so trusting that field alone would
assert a mergeability GitHub has not granted.

Checks neither raise the dot nor lower an open merge box: the glyph colour
already carries CI, and UNSTABLE means only non-required checks are failing.

The status tones live in new --status-warning tokens and three badge variants,
because the changed-lines design-system gate rejects raw palette colours.
nplez1 added a commit that referenced this pull request Oct 6, 2026
A workspace card's PR glyph was painted emerald when the PR was open *or* when
checks had passed, so one colour carried two meanings and a PR with green CI
and a pending approval looked exactly like a fully mergeable one. Its tooltip
said "PR checks: Passing", which reads the same way.

The glyph now keeps reporting CI and gains a corner dot when the provider is
not letting the merge go: amber for a requirement still outstanding, rose for a
hard blocker, muted while the provider is still computing. The tooltip and
screen-reader label name the reason, and the card's hover details and the Tasks
page checks pill show the same verdict.

hosted-review-merge-readiness.ts is the one source of truth for it, mapping
state/mergeable/mergeStateStatus/reviewDecision/mergeQueueRequired onto
{readiness, marker, reason} for every provider. Readiness needs positive
evidence — GitHub returns mergeable=MERGEABLE as soon as there are no
conflicts, before it knows about approvals, so trusting that field alone would
assert a mergeability GitHub has not granted.

Checks neither raise the dot nor lower an open merge box: the glyph colour
already carries CI, and UNSTABLE means only non-required checks are failing.

The status tones live in new --status-warning tokens and three badge variants,
because the changed-lines design-system gate rejects raw palette colours.
@nplez1
nplez1 deleted the nplez1/Mergeable-Indicator branch October 24, 2026 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant