Skip to content

Fix SCM history graph merge commit lines using wrong branch color#298590

Open
barruka wants to merge 1 commit intomicrosoft:mainfrom
barruka:fix/298588
Open

Fix SCM history graph merge commit lines using wrong branch color#298590
barruka wants to merge 1 commit intomicrosoft:mainfrom
barruka:fix/298588

Conversation

@barruka
Copy link

@barruka barruka commented Mar 1, 2026

Fixes #298588

Problem

In the Source Control history graph, when a merge commit has more than one parent, the lines connecting the merge node to its additional parents are drawn using \circleColor\ (the merge commit's own color) instead of the color of the target parent's swimlane.

This makes it impossible to visually trace branch colors through merge commits.

Root Cause

In renderSCMHistoryItemGraph (scmHistory.ts), the // Add remaining parent(s) loop uses circleColor for all paths:

const path = createPath(circleColor);

Fix

Use the color from the target parent's output swimlane entry instead:

const parentColor = outputSwimlanes[parentOutputIndex].color;
const path = createPath(parentColor);

outputSwimlanes[parentOutputIndex].color holds the color that was already assigned to that specific parent branch when building the view model, so this single change is sufficient to propagate the correct color for each merged-in line.

Copilot AI review requested due to automatic review settings March 1, 2026 17:56
@vs-code-engineering
Copy link

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@lszomoru

Matched files:

  • src/vs/workbench/contrib/scm/browser/scmHistory.ts

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR targets the SCM History graph rendering in VS Code’s Source Control workbench, aiming to address incorrect branch coloring for merge-commit connection lines.

Changes:

  • Refactors the merge-parent path creation to introduce a parentColor local variable before calling createPath(...).

Comment on lines +211 to +212
const parentColor = outputSwimlanes[parentOutputIndex].color;
const path = createPath(parentColor);
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

This change is a no-op for behavior: parentColor is just an alias for outputSwimlanes[parentOutputIndex].color, so the merge-parent path color selection is unchanged. Given the PR title about fixing wrong branch colors for merge commit lines, this likely doesn’t address the reported issue—please update the logic here to select the intended swimlane/color (or adjust the PR title/description if this was meant to be a refactor only).

Copilot uses AI. Check for mistakes.
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.

SCM History Graph: Merge commit lines to additional parents use wrong branch color

3 participants