Skip to content

fix(sidebar): dot the blocked-merge marker on both card styles - #37

Merged
nplez1 merged 2 commits into
nplez1/mainfrom
nplez1/PR-Icon
Sep 27, 2026
Merged

nplez1 merged 2 commits into
nplez1/mainfrom
nplez1/PR-Icon

Conversation

@nplez1

@nplez1 nplez1 commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​501 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​501
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​241 $\color{#cf222e}{\Huge{\mathbf{−}}}$​8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​233

ELI5

A workspace card's PR icon is supposed to get a small dot when the git provider is holding the merge up (conflicts, a missing approval, unresolved threads). That dot was only ever drawn on the card style behind the "experimental new worktree card style" setting. With that setting off — the default — the icon stayed plain green, so a blocked PR looked exactly like a mergeable one unless you hovered the card.

This branch carries a second, unrelated commit: the unit-test shard that gates PRs has been
failing about half of all runs with every test passing, for every branch, because of a known Vitest
bug — so that shard now gets its verdict from the test report instead of Vitest's exit code.

What Changed

Before: on the default card style, a workspace whose PR had green CI and a blocked merge showed a plain green PR glyph in the card's metadata row. The verdict was only in the hover panel.

After: that glyph carries the same corner dot the experimental status lane already draws — rose for a hard blocker, amber for an outstanding requirement, muted while the provider is still computing — and its screen-reader label names the reason (Linked PR #456 · Blocked).

Mechanism: WorktreeCardMetaBadges.tsx rendered a bare <ReviewIcon> for the review glyph. It now renders ReviewIconWithMergeMarker, the helper the status lane already uses, so hosted-review-merge-readiness.ts stays the one place that decides when the dot is raised. Two details had to be pinned while doing that:

  • variant="provider" — ReviewIconWithMergeMarker defaults to generic, while the old ReviewIcon defaulted to provider, so GitLab MRs would have silently swapped the merge glyph for a generic PR icon. A test caught it.
  • className="size-3.5" — MetaIconBadge sizes its glyph with [&>svg]:size-3.5, which stops matching once the marker's wrapper span is the direct child.

The metadata row's badge has no tooltip (the card's hover panel is the tooltip), so the verdict now rides in its label; otherwise the dot would be the only carrier of "why", which is the conflation this feature exists to remove.

Why

The marker (#29) was wired into the status lane only, and the default card style paints its review glyph somewhere else entirely — so half the card styles never showed it. Reusing the existing helper and readiness module, rather than re-deriving "is it blocked" in the metadata row, keeps one rule for every surface and keeps the original split honest: the glyph colour reports CI, the dot reports mergeability.

Linked Issue

No tracking issue to link: Issues are disabled on this repository, and the bug was reported directly by the maintainer. Happy to re-point this at a number if one should exist.

Visual Proof

Before / after of the same card's metadata row with a blocked PR, rendered from this change's own component tree (light and dark):

workspace card PR glyph, before and after

Second commit: a fork-only guard for the red unit shard

This PR's first CI run came back red on test / tests node 24 8/8 (and therefore on the aggregate verify) with all 1192 test files passing. The single error is Vitest's own:

EnvironmentTeardownError: [vitest-worker]: Closing rpc while "onUserConsoleLog" was pending

That is upstream vitest-dev/vitest#11153: Vitest 4 and 5 fail a run when a worker's onUserConsoleLog RPC is still in flight as that worker closes. It names whichever worker was closing rather than the file that logged late, no released version fixes it (the one linked pull request only improves the message), and it does not reproduce off CI.

It is not this change. It fails roughly half of shard-8 runs across this fork since at least 06:15 today (5 fail / 5 pass across recent PRs, including commits from before this branch), an unrelated branch fails it identically naming the same file, and it failed 3/3 attempts on this PR before the guard.

The commit adds local/check-unit-shard-verdict.mjs, which reads the shard's Vitest JSON report (what the tests did) and the tee'd run log (which unhandled errors were raised), and tolerates exactly that one headline. Everything that should fail still does — a test failure, any other unhandled error, an unreadable or missing report, a shard that ran no tests, a failed shard with nothing to explain it, and a log whose unhandled-error count does not match the headlines read from it. Upstream keeps Vitest's exit code: the continue-on-error, the report arguments and the verdict step are all guarded on github.repository, exactly as the E2E verdict in .github/workflows/e2e.yml is. config/scripts/unit-shard-verdict-contract.test.mjs pins that wiring, and LOCAL-PATCHES.md records it for removal once Vitest closes the issue.

One thing for the reviewer to rule on: LOCAL-PATCHES.md asks fork-only divergence to live on nplez1/main under a local(...) commit, and .husky/commit-msg refuses that prefix on a PR branch. By the maintainer's call this landed as ci(unit-shard) inside this PR instead — happy to move it to its own branch if you would rather keep this PR product-only.

Testing

  • pnpm test src/renderer/src/components/sidebar — 321 files / 2711 tests pass.

  • New tests: WorktreeCardMetaBadges.test.tsx (dot tone, spoken verdict, silence when mergeable, GitLab glyph and glyph size) and WorktreeCard.merge-marker.test.tsx (the full card emits data-review-merge-marker="blocked" in both card styles; a CLEAN merge box drops the dot while keeping green checks).

  • pnpm tc, oxlint and oxfmt --check on the changed files, and pnpm run check:code-quality:changed (0 findings, includes the design-system gate).

  • Paint check: rendered the real card markup against this repo's own Tailwind output in headless Chromium at 3×. Every marker tone is 5×5, opaque, topmost at the glyph's bottom-right corner and un-clipped, in light and dark, at both the 14px metadata-row and 13px status-lane glyph sizes.

  • Platforms: macOS only locally. The change is React/CSS with no platform branches, no path handling, no shortcuts and no keyboard behaviour.

  • The guard's own tests: tests/tools/unit-shard-verdict.test.mjs (tolerated race, a second unhandled error, count mismatch, failed test alongside the race, unreadable/empty report, unexplained failure, CLI exit codes) and config/scripts/unit-shard-verdict-contract.test.mjs (the wiring stays fork-only and reads the report, not Vitest's exit code). I also replayed the parser over a real failing CI log fetched from this fork's run, and over a real red Vitest run, not just fixtures.

  • I did not launch the app end to end — reproducing a blocked merge needs live provider data — so the verification above is render-level, not click-through. Full pnpm lint, pnpm test and pnpm build are left to CI.

  • I manually tested these changes locally

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

AI Disclosure

Written by the pi coding agent (deepseek/deepseek-flash) under maintainer review.

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

  • Left alone on purpose: the marker's cutout ring uses ring-sidebar while cards sit on --worktree-sidebar, so in dark mode the dot gets a faint darker halo (visible in the screenshot above). That is pre-existing, shared with the unread-alert dot in the same status lane, and deserves its own change with visual proof.
  • Known separate gap, not fixed here: folder-workspace cards can never raise the dot, because folder-workspace-card-pr-display.ts drops the merge fields and ParentPrChecksRow does not carry them. Those cards also show no review section on hover, so they fail differently.
  • Security: no new input, no IPC, no persisted state. SSH/remote: unaffected, the data already reaches the renderer. Mobile: unaffected.

Checklist

  • This PR is small and focused
  • 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
  • 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)

A workspace card's PR glyph only carried the blocked-merge dot in the
experimental card style, where the glyph sits in the left status lane. The
default card style paints its PR glyph in the metadata row instead, drawn by
WorktreeCardMetaBadges with a bare ReviewIcon, so that glyph never got a dot —
even though the hover card read the verdict correctly from the same review
data. On default settings a blocked PR still showed a plain green icon.

The metadata-row glyph now goes through ReviewIconWithMergeMarker, the same
helper the status lane uses, so one source of truth decides the dot. Its
screen-reader label carries the verdict too ("Linked PR #456 · Blocked"),
because this badge has no tooltip and the dot would otherwise be the only
carrier of that meaning. variant="provider" is pinned so GitLab MRs keep the
merge glyph, and size-3.5 replaces the badge's [&>svg] rule, which no longer
reaches the svg now that the marker's wrapper span is the direct child.
…est race

Shard 8 of the unit tests has been failing roughly half of all runs with every
test passing, on every branch, long before this change: Vitest 4/5 fails a run
when a worker's `onUserConsoleLog` RPC is still in flight as that worker closes
(vitest-dev/vitest#11153), and the error names whichever worker was closing
rather than the file that logged late. No released version fixes it — the linked
pull request only improves the message — and it does not reproduce off CI.

local/check-unit-shard-verdict.mjs reads the shard's Vitest JSON report and the
tee'd run log and tolerates exactly that one headline. Everything that should
fail still does: a test failure, any other unhandled error, an unreadable or
missing report, a shard that ran no tests, a failed shard with nothing to explain
it, and a log whose unhandled-error count does not match the headlines read out
of it. Upstream keeps Vitest's exit code — the guard, the report arguments and
the verdict step are all fork-only — and the wiring is pinned by
config/scripts/unit-shard-verdict-contract.test.mjs. Documented in
LOCAL-PATCHES.md, to be removed once Vitest closes stablyai#11153.
@nplez1
nplez1 merged this pull request into nplez1/main Sep 27, 2026
29 checks passed
nplez1 added a commit that referenced this pull request Sep 27, 2026
* fix(sidebar): dot the blocked-merge marker on both card styles

A workspace card's PR glyph only carried the blocked-merge dot in the
experimental card style, where the glyph sits in the left status lane. The
default card style paints its PR glyph in the metadata row instead, drawn by
WorktreeCardMetaBadges with a bare ReviewIcon, so that glyph never got a dot —
even though the hover card read the verdict correctly from the same review
data. On default settings a blocked PR still showed a plain green icon.

The metadata-row glyph now goes through ReviewIconWithMergeMarker, the same
helper the status lane uses, so one source of truth decides the dot. Its
screen-reader label carries the verdict too ("Linked PR #456 · Blocked"),
because this badge has no tooltip and the dot would otherwise be the only
carrier of that meaning. variant="provider" is pinned so GitLab MRs keep the
merge glyph, and size-3.5 replaces the badge's [&>svg] rule, which no longer
reaches the svg now that the marker's wrapper span is the direct child.

* ci(unit-shard): hand a fork shard to a verdict that tolerates one Vitest race

Shard 8 of the unit tests has been failing roughly half of all runs with every
test passing, on every branch, long before this change: Vitest 4/5 fails a run
when a worker's `onUserConsoleLog` RPC is still in flight as that worker closes
(vitest-dev/vitest#11153), and the error names whichever worker was closing
rather than the file that logged late. No released version fixes it — the linked
pull request only improves the message — and it does not reproduce off CI.

local/check-unit-shard-verdict.mjs reads the shard's Vitest JSON report and the
tee'd run log and tolerates exactly that one headline. Everything that should
fail still does: a test failure, any other unhandled error, an unreadable or
missing report, a shard that ran no tests, a failed shard with nothing to explain
it, and a log whose unhandled-error count does not match the headlines read out
of it. Upstream keeps Vitest's exit code — the guard, the report arguments and
the verdict step are all fork-only — and the wiring is pinned by
config/scripts/unit-shard-verdict-contract.test.mjs. Documented in
LOCAL-PATCHES.md, to be removed once Vitest closes stablyai#11153.
nplez1 added a commit that referenced this pull request Sep 29, 2026
* fix(sidebar): dot the blocked-merge marker on both card styles

A workspace card's PR glyph only carried the blocked-merge dot in the
experimental card style, where the glyph sits in the left status lane. The
default card style paints its PR glyph in the metadata row instead, drawn by
WorktreeCardMetaBadges with a bare ReviewIcon, so that glyph never got a dot —
even though the hover card read the verdict correctly from the same review
data. On default settings a blocked PR still showed a plain green icon.

The metadata-row glyph now goes through ReviewIconWithMergeMarker, the same
helper the status lane uses, so one source of truth decides the dot. Its
screen-reader label carries the verdict too ("Linked PR #456 · Blocked"),
because this badge has no tooltip and the dot would otherwise be the only
carrier of that meaning. variant="provider" is pinned so GitLab MRs keep the
merge glyph, and size-3.5 replaces the badge's [&>svg] rule, which no longer
reaches the svg now that the marker's wrapper span is the direct child.

* ci(unit-shard): hand a fork shard to a verdict that tolerates one Vitest race

Shard 8 of the unit tests has been failing roughly half of all runs with every
test passing, on every branch, long before this change: Vitest 4/5 fails a run
when a worker's `onUserConsoleLog` RPC is still in flight as that worker closes
(vitest-dev/vitest#11153), and the error names whichever worker was closing
rather than the file that logged late. No released version fixes it — the linked
pull request only improves the message — and it does not reproduce off CI.

local/check-unit-shard-verdict.mjs reads the shard's Vitest JSON report and the
tee'd run log and tolerates exactly that one headline. Everything that should
fail still does: a test failure, any other unhandled error, an unreadable or
missing report, a shard that ran no tests, a failed shard with nothing to explain
it, and a log whose unhandled-error count does not match the headlines read out
of it. Upstream keeps Vitest's exit code — the guard, the report arguments and
the verdict step are all fork-only — and the wiring is pinned by
config/scripts/unit-shard-verdict-contract.test.mjs. Documented in
LOCAL-PATCHES.md, to be removed once Vitest closes stablyai#11153.
nplez1 added a commit that referenced this pull request Oct 1, 2026
* fix(sidebar): dot the blocked-merge marker on both card styles

A workspace card's PR glyph only carried the blocked-merge dot in the
experimental card style, where the glyph sits in the left status lane. The
default card style paints its PR glyph in the metadata row instead, drawn by
WorktreeCardMetaBadges with a bare ReviewIcon, so that glyph never got a dot —
even though the hover card read the verdict correctly from the same review
data. On default settings a blocked PR still showed a plain green icon.

The metadata-row glyph now goes through ReviewIconWithMergeMarker, the same
helper the status lane uses, so one source of truth decides the dot. Its
screen-reader label carries the verdict too ("Linked PR #456 · Blocked"),
because this badge has no tooltip and the dot would otherwise be the only
carrier of that meaning. variant="provider" is pinned so GitLab MRs keep the
merge glyph, and size-3.5 replaces the badge's [&>svg] rule, which no longer
reaches the svg now that the marker's wrapper span is the direct child.

* ci(unit-shard): hand a fork shard to a verdict that tolerates one Vitest race

Shard 8 of the unit tests has been failing roughly half of all runs with every
test passing, on every branch, long before this change: Vitest 4/5 fails a run
when a worker's `onUserConsoleLog` RPC is still in flight as that worker closes
(vitest-dev/vitest#11153), and the error names whichever worker was closing
rather than the file that logged late. No released version fixes it — the linked
pull request only improves the message — and it does not reproduce off CI.

local/check-unit-shard-verdict.mjs reads the shard's Vitest JSON report and the
tee'd run log and tolerates exactly that one headline. Everything that should
fail still does: a test failure, any other unhandled error, an unreadable or
missing report, a shard that ran no tests, a failed shard with nothing to explain
it, and a log whose unhandled-error count does not match the headlines read out
of it. Upstream keeps Vitest's exit code — the guard, the report arguments and
the verdict step are all fork-only — and the wiring is pinned by
config/scripts/unit-shard-verdict-contract.test.mjs. Documented in
LOCAL-PATCHES.md, to be removed once Vitest closes stablyai#11153.
nplez1 added a commit that referenced this pull request Oct 6, 2026
* fix(sidebar): dot the blocked-merge marker on both card styles

A workspace card's PR glyph only carried the blocked-merge dot in the
experimental card style, where the glyph sits in the left status lane. The
default card style paints its PR glyph in the metadata row instead, drawn by
WorktreeCardMetaBadges with a bare ReviewIcon, so that glyph never got a dot —
even though the hover card read the verdict correctly from the same review
data. On default settings a blocked PR still showed a plain green icon.

The metadata-row glyph now goes through ReviewIconWithMergeMarker, the same
helper the status lane uses, so one source of truth decides the dot. Its
screen-reader label carries the verdict too ("Linked PR #456 · Blocked"),
because this badge has no tooltip and the dot would otherwise be the only
carrier of that meaning. variant="provider" is pinned so GitLab MRs keep the
merge glyph, and size-3.5 replaces the badge's [&>svg] rule, which no longer
reaches the svg now that the marker's wrapper span is the direct child.

* ci(unit-shard): hand a fork shard to a verdict that tolerates one Vitest race

Shard 8 of the unit tests has been failing roughly half of all runs with every
test passing, on every branch, long before this change: Vitest 4/5 fails a run
when a worker's `onUserConsoleLog` RPC is still in flight as that worker closes
(vitest-dev/vitest#11153), and the error names whichever worker was closing
rather than the file that logged late. No released version fixes it — the linked
pull request only improves the message — and it does not reproduce off CI.

local/check-unit-shard-verdict.mjs reads the shard's Vitest JSON report and the
tee'd run log and tolerates exactly that one headline. Everything that should
fail still does: a test failure, any other unhandled error, an unreadable or
missing report, a shard that ran no tests, a failed shard with nothing to explain
it, and a log whose unhandled-error count does not match the headlines read out
of it. Upstream keeps Vitest's exit code — the guard, the report arguments and
the verdict step are all fork-only — and the wiring is pinned by
config/scripts/unit-shard-verdict-contract.test.mjs. Documented in
LOCAL-PATCHES.md, to be removed once Vitest closes stablyai#11153.
@nplez1
nplez1 deleted the nplez1/PR-Icon 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