Skip to content

Add pin/unpin branch to left in commit graph#5181

Open
sergeibbb wants to merge 4 commits intomainfrom
feature/5139-pin-branch-graph-1
Open

Add pin/unpin branch to left in commit graph#5181
sergeibbb wants to merge 4 commits intomainfrom
feature/5139-pin-branch-graph-1

Conversation

@sergeibbb
Copy link
Copy Markdown
Member

@sergeibbb sergeibbb commented Apr 28, 2026

Solves #5139

Summary

  • Adds gitlens.graph.pinBranchToLeft and gitlens.graph.unpinBranchFromLeft commands with context menu entries on branch ref nodes
  • Implements pin/unpin state management in GraphWebviewProvider with workspace storage persistence
  • Refactors GlGraphHeader to show a notification when the pinned reference changes and adds jump-to-reference support
  • Adds graphRowProcessor changes to prioritize the pinned branch column in the graph layout
  • Includes end-to-end tests for pin and unpin flows

Test plan

  • Right-click a branch in the graph → "Pin to Left" appears; clicking it pins the branch
  • Pinned branch ref badge renders leftmost on its row
  • Right-click the pinned branch → "Unpin from Left" appears; clicking it unpins
  • Pin state persists across reloads (workspace storage)
  • Graph header shows notification on pinned reference change
    • Open the Commit Graph
    • Right-click a branch ref node → "Pin to Left"
    • Observe the graph updates in real-time (pinned branch badge moves leftmost) without a full reload
    • Right-click the same branch → "Unpin from Left"
    • Observe it moves back to its normal position immediately
  • E2E tests pass: tests/e2e/specs/graphPin.test.ts

🤖 Generated with Claude Code

@sergeibbb sergeibbb force-pushed the feature/5139-pin-branch-graph-1 branch 2 times, most recently from 5150465 to 53183c0 Compare April 29, 2026 10:36
@sergeibbb sergeibbb marked this pull request as ready for review April 29, 2026 10:46
@sergeibbb sergeibbb linked an issue Apr 29, 2026 that may be closed by this pull request
6 tasks
sergeibbb added a commit that referenced this pull request Apr 29, 2026
…otification for pinned reference changes in GraphWebviewProvider

(#5139, #5181)
@sergeibbb sergeibbb force-pushed the feature/5139-pin-branch-graph-1 branch from 53183c0 to 3d36c34 Compare April 29, 2026 10:51
@sergeibbb
Copy link
Copy Markdown
Member Author

augment review

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Apr 29, 2026

Sorry, Augment failed to review this pull request.

@sergeibbb sergeibbb added this to the 18.0 milestone Apr 30, 2026
@sergeibbb sergeibbb assigned sergeibbb and unassigned d13 Apr 30, 2026
@sergeibbb
Copy link
Copy Markdown
Member Author

Assigning back to me: I have just remembered that we wanted to move the "navigate to the pinned branch" button from the toolbar to the table headings.

@sergeibbb sergeibbb removed request for d13 and eamodio April 30, 2026 18:47
@sergeibbb sergeibbb force-pushed the feature/5139-pin-branch-graph-1 branch from 3d36c34 to 09c5b32 Compare May 4, 2026 10:11
sergeibbb added a commit that referenced this pull request May 4, 2026
…otification for pinned reference changes in GraphWebviewProvider

(#5139, #5181)
@sergeibbb sergeibbb changed the base branch from feature/graph-next to main May 4, 2026 10:11
@sergeibbb sergeibbb force-pushed the feature/5139-pin-branch-graph-1 branch from 09c5b32 to cbddb21 Compare May 4, 2026 17:31
@sergeibbb sergeibbb force-pushed the feature/5139-pin-branch-graph-1 branch from cbddb21 to 7791770 Compare May 4, 2026 17:32
@gitkraken-services
Copy link
Copy Markdown

gitkraken-services Bot commented May 4, 2026

Rebase Successful

Skipped — PR is mergeable as-is, no push needed

Summary

Metric Value
Status Clean rebase — no conflicts
Target main
Source feature/5139-pin-branch-graph-1

Generated by Merge Mate at 2026-05-06 23:03:26 UTC

sergeibbb added a commit that referenced this pull request May 5, 2026
…otification for pinned reference changes in GraphWebviewProvider

(#5139, #5181)
@sergeibbb sergeibbb force-pushed the feature/5139-pin-branch-graph-1 branch from 7791770 to 14674e6 Compare May 5, 2026 12:48
sergeibbb added a commit that referenced this pull request May 5, 2026
sergeibbb added a commit that referenced this pull request May 5, 2026
…otification for pinned reference changes in GraphWebviewProvider

(#5139, #5181)
@sergeibbb sergeibbb force-pushed the feature/5139-pin-branch-graph-1 branch from 14674e6 to 7e6ec81 Compare May 5, 2026 13:14
sergeibbb added a commit that referenced this pull request May 5, 2026
@sergeibbb
Copy link
Copy Markdown
Member Author

augment review

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented May 5, 2026

🤖 Augment PR Summary

Summary: Adds support for pinning a branch column to the left in the Commit Graph, with UI affordances to pin/unpin and to jump back to the pinned reference.

Changes:

  • Introduces gitlens.graph.pinBranchToLeft / gitlens.graph.unpinBranchFromLeft commands and context-menu entries for branch ref items.
  • Persists pinned-branch state in per-repo graph filters via workspace storage (StoredGraphFilters.pinnedRef).
  • Updates graph row processing to add a +pinned context flag on matching local/remote branch refs (enables pin/unpin menu gating).
  • Adds a “Jump to pinned branch” header action in the graph webview and wiring to select/load the pinned commit.
  • Extends IPC/state plumbing with UpdatePinnedRef command + DidChangePinnedRef notification and state provider support.
  • Adds unit tests for row processor pin-context behavior and Playwright E2E coverage for pin/unpin flows.

Technical Notes: Pinned state is stored by ref id and is resolved to a SHA from the current graph’s branch set when available, then pushed to the webview state for jump behavior.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread src/webviews/apps/plus/graph/graph-wrapper/gl-graph.react.tsx
Comment thread src/webviews/plus/graph/graphWebview.ts Outdated
@sergeibbb sergeibbb force-pushed the feature/5139-pin-branch-graph-1 branch from 7e6ec81 to afccf24 Compare May 5, 2026 15:39
@sergeibbb sergeibbb requested a review from d13 May 5, 2026 16:02
@sergeibbb sergeibbb removed their assignment May 5, 2026
@d13 d13 requested review from ianhattendorf and removed request for d13 May 6, 2026 21:59
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.

Add UI for pinning branch to the left in the Commit Graph

2 participants