Skip to content

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

Open
kyleseaman wants to merge 1 commit into
mainfrom
fix/pr-tab-merge-conflict-status
Open

fix(changes): show merge conflicts on PR tabs#8295
kyleseaman wants to merge 1 commit into
mainfrom
fix/pr-tab-merge-conflict-status

Conversation

@kyleseaman

@kyleseaman kyleseaman commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

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 now exercises conflict-plus-passing-CI and asserts that the conflicted tab suppresses Checks passed while a clean neighboring tab retains it.

Tests

  • npm exec vitest run src/test/PullRequestPanel.test.tsx — 54 passed
  • npm run typecheck — passed
  • npm run lint -- --quiet — passed
  • npm run lint:i18n — passed
  • Full backend matrix attempted during preflight: 83,917 passed; 72 host-policy/environment failures on the local macOS runner, with none in the changed frontend 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

Contribution License Agreement

The repository template currently carries an OSPO placeholder; no CLA text has been invented.

@kyleseaman
kyleseaman requested a review from a team September 3, 2026 22:40
@kyleseaman
kyleseaman requested a review from a team as a code owner 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 be0a8bbbc8d97d5ccd3dffdd8953ab5b780798d3 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

The screenshot confirms the rendered result: the conflicted tab (PR #6999) shows a red triangle instead of a green check, the clean tab (PR #6998) keeps its check, and both the sidebar session chips and the header conflict banner agree with the tab state. The precedence (failed CI > conflict > running/passed, terminal suppresses all) is byte-for-byte the same rule chipStatusGlyph already applies in ChatSidebar.tsx, and the glyph reuses the same TriangleAlert icon, text-danger token, and the existing translated merge_conflicts label key across all 12 locales. Icon-only with tooltip matches the established CI-glyph pattern on these tabs, and shape (triangle vs. check vs. X) keeps the status legible without color.

UX-Verdict: PASS

Fixes a status glyph that lied — conflicted tabs now match the sidebar chip's exact precedence, icon, and label, verified in the rendered screenshot.

[UX-REVIEWED] be0a8bb

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

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

Design-Verdict: PASS

Real misleading-signal fix, precedence matches the sidebar chip's established rule, terminal-state and failed-CI ordering are consistent and pinned by tests.

Suggestions

  • The failed > conflict > running > passed precedence now exists twice — chipStatusGlyph in ChatSidebar.tsx and the showConflict/shownCi derivation here — held in sync only by cross-referencing comments; chipStatusGlyph's own docstring names drift between these surfaces as the failure mode this rule exists to prevent, so extracting one shared health-glyph resolver both call would make the "must not disagree" invariant structural rather than commentary.

[DESIGN-REVIEWED] be0a8bb

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] be0a8bb

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

False positive or not applicable? A repository writer can comment:
/ai-review override fable be0a8bbbc8d97d5ccd3dffdd8953ab5b780798d3: <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 be0a8bbbc8d97d5ccd3dffdd8953ab5b780798d3 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] be0a8bb

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

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🔴 BLOCK

Premise-level review of be0a8bbbc8d97d5ccd3dffdd8953ab5b780798d3 — 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.

All evidence gathered. The fix itself is well-grounded — the sidebar chip (chipStatusGlyph in ChatSidebar.tsx) already ships this exact precedence, and this PR brings the source tab to parity. Two issues survive: the harness gains an undeclared PLAYWRIGHT_EXECUTABLE_PATH env var that duplicates the shared chromiumExecutable() helper eight sibling scripts already use, and the tab re-implements the precedence inline as a second spelling of chipStatusGlyph.

First-Principles-Verdict: BLOCK

A new PLAYWRIGHT_EXECUTABLE_PATH env var rides along undeclared in a fix, duplicating scripts/lib/chromium-executable.mjs, which exists precisely to end these clones.

What this change ships

Intent: make a conflicted pull request's compact tab stop reading as healthy. This is a FIX.

  1. Conflicted tab shows red "Merge conflicts" triangle instead of green check — justified
  2. Failed CI still outranks the conflict glyph — justified, mirrors chipStatusGlyph
  3. Merged/closed tabs suppress the conflict glyph — justified, declared
  4. Tab precedence re-implemented inline rather than reusing chipStatusGlyph — duplicate of ChatSidebar.tsx:684
  5. Screenshot harness repurposed to conflict-plus-passing-CI with hard DOM assertions — justified, declared
  6. Harness honors new PLAYWRIGHT_EXECUTABLE_PATH env var — undeclared, rides along, duplicate
  7. Evidence PNG committed under temp-screenshots/ — justified, repo convention (814 files, README)

Blockers

Undeclared env-var rider duplicating an existing mechanism. The description ("What changed") covers only tab status; the hunk at capture-selected-pr-status-merge.mjs:129 adds process.env.PLAYWRIGHT_EXECUTABLE_PATH — grep: 1 hit repo-wide, the defining site, zero other consumers. The contract's four-part exception holds by reading: fix framing, rider, the component change plus tests already remove the defect, and the zero option costs nobody — scripts/lib/chromium-executable.mjs (imported by 8 sibling harnesses, doc: "Extracted … so sibling harnesses can share it instead of cloning it") already solves the mismatched-Chromium problem, and this would be a seventh env-var spelling of it (PLAYWRIGHT_CHROMIUM, PLAYWRIGHT_CHROMIUM_EXECUTABLE, PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH, PW_CHROME, PW_CHROMIUM, CHROMIUM_PATH counted). Subtraction: delete lines 129–130 and call chromiumExecutable() like the other eight.

Subtractions

  • Replace the inline conflicting/showConflict/shownCi precedence in PullRequestPanel.tsx::SourceTabState with the exported chipStatusGlyph (ChatSidebar.tsx:684) — 2 spellings of one precedence whose own comments say they "must not disagree"; both read the same four fields.

[FIRST-PRINCIPLES-REVIEWED] be0a8bb

@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
Collaborator

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.

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.
@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
Collaborator

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: action required A blocking check or review needs attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants