Skip to content

fix(changes): show merge conflicts on PR tabs - #8295

Merged
NicholasRBowers merged 1 commit into
mainfrom
fix/pr-tab-merge-conflict-status
Sep 15, 2026
Merged

NicholasRBowers merged 1 commit into
mainfrom
fix/pr-tab-merge-conflict-status

Conversation

@kyleseaman

@kyleseaman kyleseaman commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

A pull request with merge conflicts can still show the green Checks passed glyph in the Changes-panel source tab. The detail pane reports the conflict, but the compact tab incorrectly reads as healthy.

Why it matters

Users scanning several pull requests can miss that a branch is unmergeable and assume it is ready based on the tab status alone.

What changed (motivation → approach → change)

The source-tab status now uses explicit precedence: failed CI remains highest priority; otherwise, a settled merge conflict replaces pending or passing CI with a red Merge conflicts warning. Merged and closed pull requests suppress stale conflict state. The same logic applies to selected and background tabs.

The deterministic screenshot harness exercises conflict-plus-passing-CI and asserts that the conflicted tab suppresses Checks passed while a clean neighboring tab retains it. It resolves its browser through the shared chromium-executable.mjs helper the sibling capture scripts use.

Tests

  • npx vitest run src/test/PullRequestPanel.test.tsx — 61 passed
  • npm run typecheck — passed
  • npm run lint -- --quiet — passed
  • npm run lint:i18n — passed
  • Change-scoped backend cross-surface bucket (scripts/local-gate.py): 36,379 passed; 83 environment failures on the local runner that reproduce identically on pristine main, none in changed paths.

Manual verification

Ran the real-SPA screenshot harness against conflict-plus-passing-CI and clean-plus-passing-CI tabs. Its DOM assertions verified the conflicted tab exposes Merge conflicts, omits Checks passed, and leaves the clean tab unchanged.

Screenshots / video

Conflicted PR tab replaces the misleading passing-check glyph

Related Issues

no linked issue: reported directly from the Changes panel.

Pattern harvest

Rule candidate: review-prompt
Pattern: Compact status summaries must define explicit precedence when independent health signals can disagree.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (N/A — no user-facing documentation surface changed)
  • No secrets, credentials, or internal references in the diff

@kyleseaman
kyleseaman requested review from a team and chenmingwei23 September 3, 2026 22:40
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — ✅ PASS

UX-level review of e154306db63a7dbdfa3aa1e4b2d19841d95e27e6 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: PASS

Nothing to check.

[UX-REVIEWED] e154306

@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of e154306db63a7dbdfa3aa1e4b2d19841d95e27e6 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Precedence now lives as two hand-written copies (panel + sidebar chip) kept equal only by comments and tests — verify no third copy exists.

Suggestions

  • Extract the failed > conflict > running > passed kernel (with terminal suppression) into one shared helper both SourceTabState and chipStatusGlyph consume; this bug existed because the two copies drifted, and the "must not disagree" contract is currently a comment.

[DESIGN-REVIEWED] e154306

@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed e154306db63a7dbdfa3aa1e4b2d19841d95e27e6 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] e154306

Verdict parsed from the review's SHA-scoped output markers for commit e154306db63a7dbdfa3aa1e4b2d19841d95e27e6.

False positive or not applicable? A repository writer can comment:
/ai-review override fable e154306db63a7dbdfa3aa1e4b2d19841d95e27e6: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of e154306db63a7dbdfa3aa1e4b2d19841d95e27e6 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] e154306

False positive or not applicable? A repository writer can comment:
/ai-review override gpt e154306db63a7dbdfa3aa1e4b2d19841d95e27e6: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of e154306db63a7dbdfa3aa1e4b2d19841d95e27e6 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

The conflict-over-CI precedence now lives twice: SourceTabState hand-copies the decision chipStatusGlyph already makes, two spellings whose comments promise to stay in sync.

Not justified as shipped

  • Item 1 — duplicate of website/src/pages/ChatSidebar.tsx: the new inline precedence (PullRequestPanel.tsx:388-394) re-spells chipStatusGlyph (ChatSidebar.tsx:802-815) — grep mergeable === 'conflicting' || mergeStateStatus === 'dirty' finds exactly these 2 sites, both reading the same four fields (state, ci, mergeable, mergeStateStatus), and the new comment itself pins the coupling: "ChatSidebar.tsx::chipStatusGlyph applies the same precedence".
    Subtraction: replace the inline conflicting/showConflict/shownCi logic in SourceTabState with the existing chipStatusGlyph decision (exported), which returns exactly the failed | conflict | running | passed | null discriminant the tab renders.
    Clears when: SourceTabState consumes chipStatusGlyph, leaving one spelling of the precedence.
  • Item 5 — rides along: shared Chromium-resolver adoption in the harness is not the fix, though the description declares it.
  • Item 6 — undeclared: the committed evidence PNG is never mentioned; 102 tracked siblings under temp-screenshots/ make it established practice, so it carries no premise risk.

What this change ships

Inventory (6 items) — 3 justified

Intent: stop a conflicted pull request's compact tab from reading as healthy ("Checks passed") when the branch cannot merge — a FIX, with provenance in tests this PR adds that fail on base.

  1. A live conflicted PR's tab now shows a red "Merge conflicts" glyph instead of pending/passing CI, on selected and background tabs — duplicate of website/src/pages/ChatSidebar.tsx (second spelling of chipStatusGlyph)
  2. Failed CI still outranks the conflict glyph on the tab — justified
  3. Merged/closed tabs suppress stale conflict state — justified
  4. The screenshot harness now exercises conflict-plus-passing-CI and hard-asserts the tab glyphs instead of logging a count — justified
  5. The harness resolves its browser through the shared chromium-executable.mjs helper — rides along (declared; matches 15 sibling capture scripts)
  6. A new screenshot PNG is committed under temp-screenshots/pr-tab-merge-conflict/ — undeclared (102 tracked siblings; harm-free)

[FIRST-PRINCIPLES-REVIEWED] e154306

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 4, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

Open PR relationship audit

This is a consolidated, point-in-time code-level audit note. It compares complete merge-base diffs and current/merged code; it does not treat a shared topic as duplication or partial coverage as completion.

Relationship findings

  • This PR is PARTIALLY_COVERED with PR #3760. Coverage is explicitly incomplete; this finding is not a completion or closure claim. Recommended action for PR #8295: KEEP. The merged sidebar change covers a different surface; the panel tab strip it left behind is exactly what this PR fixes, so nothing here is already shipped. Files: website/src/pages/ChatSidebar.tsx.

No PR, Issue, label, branch, or review state was changed by the relationship-note portion of this audit.

@kyleseaman
kyleseaman force-pushed the fix/pr-tab-merge-conflict-status branch from 2703c78 to be0a8bb Compare September 4, 2026 12:21
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 4, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

@kyleseaman Thanks for this. We are keeping the PR open: the defect is real and still unfixed on main. Audited at be0a8bb.

What already landed: #3760 shipped exactly this precedence rule (failed CI outranks conflict, conflict outranks running or passed, both suppressed once the pull request is merged or closed, with mergeable === 'conflicting' || mergeStateStatus === 'dirty' as the conflict test), but only for the sidebar session chip via chipStatusGlyph in website/src/pages/ChatSidebar.tsx. Its merged diff touches nothing in website/src/components/PullRequestPanel.tsx.

What is still missing: on main, SourceTabState in website/src/components/PullRequestPanel.tsx still derives CI only and has no conflict branch, and that file has no TriangleAlert glyph at all. The Changes panel tab strip is the genuine remainder, and that is what this PR fills, so please keep the scope exactly there.

Two things before we can merge:

  1. Drop the undeclared PLAYWRIGHT_EXECUTABLE_PATH handling in website/scripts/capture-selected-pr-status-merge.mjs and call the existing website/scripts/lib/chromium-executable.mjs helper instead. Nine sibling harnesses already import it, and this rider is what the First Principles block is holding on.

  2. Rebase onto main. The branch is 475 commits behind, and fix(dashboard): stop the PR panel re-reading unchanged pull requests #8356 moved both website/src/components/PullRequestPanel.tsx and website/src/test/PullRequestPanel.test.tsx around your hunks. GitHub still reports the PR mergeable, so this is hygiene rather than conflict resolution.

Optional, and worth considering: export chipStatusGlyph from ChatSidebar.tsx and reuse it here, so this precedence rule lives in one place instead of two.

Posted from the 2026-09-08 open-PR relationship audit (read-only, one auditor per PR); reply here if any of this is wrong.

@dwu96 dwu96 added the needs-pr-triage PR scanner: awaiting automated triage label Sep 15, 2026
@NicholasRBowers NicholasRBowers added drive-to-green PR claimed by drive-to-green pipeline and removed needs-pr-triage PR scanner: awaiting automated triage labels Sep 15, 2026
@NicholasRBowers

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]: This PR has been inactive for 7+ days with failing CI. I've assessed the blockers and they appear resolvable — I'll push fixes directly to this branch as a co-author.

Assessment: The full CI matrix, GPT, Opus, Design and UX are all green on the current head. The single blocker is the First Principles BLOCK on website/scripts/capture-selected-pr-status-merge.mjs:129-130, which adds an undeclared PLAYWRIGHT_EXECUTABLE_PATH env var instead of calling the existing website/scripts/lib/chromium-executable.mjs::chromiumExecutable() helper the other eight capture harnesses use — the same change the maintainer asked for on 2026-09-08. Plan: rebase onto current main (~1170 behind; SourceTabState only moved lines), replace the two lines with the shared helper import, keep the single commit, re-pin the screenshot URL, drop the CLA placeholder from the body, and post the First Principles / Design dispositions. The optional chipStatusGlyph extraction stays out of scope so the panel-only diff does not widen into ChatSidebar.tsx.

If you'd prefer I don't touch this PR, add the pr-no-autofix label.

Replace misleading pending or passing CI glyphs with a conflict warning while preserving failed CI precedence. Cover selected and background tabs and update the deterministic screenshot harness.

The capture harness resolves its browser through the shared
chromium-executable helper used by sibling harnesses instead of a
one-off environment variable. Original change by Kyle Seaman.

Co-authored-by: Kiro Crew <noreply@kirodotdev.github.io>
@NicholasRBowers
NicholasRBowers force-pushed the fix/pr-tab-merge-conflict-status branch from be0a8bb to e154306 Compare September 15, 2026 11:47
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 15, 2026
@NicholasRBowers

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]

  • Undeclared env-var rider duplicating an existing mechanism span=e6a44a2d21a1 — fixed
    self-added: no

Fixed in e154306: capture-selected-pr-status-merge.mjs now imports chromiumExecutable() from ./lib/chromium-executable.mjs and calls chromium.launch({ executablePath }), matching the eight sibling harnesses. The PLAYWRIGHT_EXECUTABLE_PATH rider is deleted; no new env-var spelling exists in the diff.
The harness was re-run after the change: its DOM assertions pass (selected:conflict clean:passed) resolving the browser through the shared helper.

@NicholasRBowers

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]

  • Replace the inline precedence in SourceTabState with chipStatusGlyph span=d3dfe967d157 — rebutted
    self-added: no

chipStatusGlyph is module-private in ChatSidebar.tsx on main (not exported), so taking this subtraction means editing ChatSidebar.tsx — widening an otherwise-settled diff and re-arming every review lane on a PR whose panel change is maintainer-endorsed. The maintainer explicitly marked the helper reuse optional in the 2026-09-08 review comment; this PR's scope is the panel tab strip.
This ruling covers findings that require unifying the tab-strip precedence with the sidebar chip helper inside this PR, wherever they land. Unification is proportionate only as its own change once the helper is exported.

@NicholasRBowers

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]

  • The failed > conflict > running > passed precedence now exists twice span=7eb56ea3c6fc — rebutted
    self-added: no

Deduplicating requires exporting the module-private chipStatusGlyph from ChatSidebar.tsx, which widens the diff beyond this PR's scope (the panel tab strip) and re-arms every lane on a maintainer-endorsed change. The maintainer marked the reuse optional in the 2026-09-08 review comment.
This ruling covers findings asking this PR to unify tab-strip and sidebar-chip status precedence; the two-site duplication is bounded and pinned by tests on both sides, and unification stands alone as a follow-up once the helper is exported.

@NicholasRBowers

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]

Drive-to-green update — pushed be0a8bbb → e154306db (single commit, Kyle Seaman remains author, Co-authored-by: Kiro Crew).

What changed and why:

  • Rebased onto current main (maintainer item 2). Clean apply, no conflicts; the diff is unchanged apart from the fix below.
  • website/scripts/capture-selected-pr-status-merge.mjs: replaced the PLAYWRIGHT_EXECUTABLE_PATH env-var rider with the shared chromiumExecutable() helper from ./lib/chromium-executable.mjs (maintainer item 1; First Principles blocker). The launch call now matches the eight sibling harnesses.
  • PR body: the screenshot is now a permanent GitHub attachment (the previous raw/<sha> URL would have broken when the rebase changed the head SHA); removed the stray Contribution License Agreement placeholder; refreshed the gate numbers. Pixels are unchanged — no new capture.
  • Not taken: the optional chipStatusGlyph reuse — it is module-private in ChatSidebar.tsx, and unifying would widen the diff beyond this PR's scope. Dispositions posted separately.

Verification: npm run typecheck, npm run lint -- --quiet, npm run lint:i18n and npx vitest run src/test/PullRequestPanel.test.tsx (61/61) all green; the capture harness re-run passes its DOM assertions with the shared helper. The change-scoped backend bucket reported 83 failures that reproduce identically on pristine main (local-environment noise, none in changed paths).

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Sep 15, 2026
@NicholasRBowers
NicholasRBowers enabled auto-merge (squash) September 15, 2026 12:35

@chenmingwei23 chenmingwei23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tier 1 auto-approve: fix (4 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: fix - render a merge-conflict glyph on PR source tabs so an unmergeable branch never reads as ready (frontend display precedence only, plus screenshot harness and unit tests).

@NicholasRBowers
NicholasRBowers merged commit fdf0ca9 into main Sep 15, 2026
108 of 109 checks passed
@NicholasRBowers
NicholasRBowers deleted the fix/pr-tab-merge-conflict-status branch September 15, 2026 13:05
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 15, 2026

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tier 1 auto-approve: fix (4 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: PullRequestPanel now renders a TriangleAlert conflict glyph on a pull-request tab whose merge state is dirty instead of leaving the passing-CI check in place, with the screenshot harness retargeted to that case and a unit test added -- narrow render fix with a clear root cause, no data or API changes.

@dwu96 dwu96 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tier 1 auto-approve: fix (4 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, SAST annotations clean, security checklist all-NO, AI reviewers green. Category: clear root cause in SourceTabState - it computed the tab glyph from status.ci alone, so a branch with a settled conflict but passing checks rendered a green check and read as ready; the fix layers a conflict glyph with failed-CI still winning, mirroring the precedence ChatSidebar.tsx::chipStatusGlyph already applies, and both directions are pinned by new tests.

@chenmingwei23 chenmingwei23 removed the drive-to-green PR claimed by drive-to-green pipeline label Sep 15, 2026
amadsalmon pushed a commit to amadsalmon/KiroCrew that referenced this pull request Sep 22, 2026
Replace misleading pending or passing CI glyphs with a conflict warning while preserving failed CI precedence. Cover selected and background tabs and update the deterministic screenshot harness.

The capture harness resolves its browser through the shared
chromium-executable helper used by sibling harnesses instead of a
one-off environment variable. Original change by Kyle Seaman.

Co-authored-by: Kiro Crew <noreply@kirodotdev.github.io>
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.

6 participants