Skip to content

Commit 09a1712

Browse files
committed
Closes #4497 adds favorited branches to the graph
1 parent 4ada774 commit 09a1712

File tree

7 files changed

+96
-171
lines changed

7 files changed

+96
-171
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
66

77
## [Unreleased]
88

9+
### Added
10+
11+
- Adds expanded and improved branch favoriting ([#4497](https://github.com/gitkraken/vscode-gitlens/issues/4497))
12+
- Adds a new "Favorited Branches" option to the branches visibility dropdown on the _Commit Graph_
13+
- Adds _Add to Favorites_ or _Remove from Favorites_ context menu items to branches in the _Commit Graph_
14+
- Adds _Add to Favorites_ or _Remove from Favorites_ context menu items to worktrees in the views
15+
16+
### Changed
17+
18+
- Changes branch favoriting to apply to both local and remote branch pairs ([#4497](https://github.com/gitkraken/vscode-gitlens/issues/4497))
19+
920
## [17.3.1] - 2025-07-15
1021

1122
### Changed

docs/telemetry-events.md

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,12 +1076,14 @@
10761076
"enum": [
10771077
"all",
10781078
"smart",
1079-
"current"
1079+
"current",
1080+
"favorited"
10801081
],
10811082
"enumDescriptions": [
10821083
"Shows all branches",
10831084
"Shows only relevant branches",
1084-
"Shows only the current branch"
1085+
"Shows only the current branch",
1086+
"Shows only favorited branches"
10851087
],
10861088
"default": "all",
10871089
"markdownDescription": "Specifies the visibility of branches on the _Commit Graph_",

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export type DateSource = 'authored' | 'committed';
107107
export type DateStyle = 'absolute' | 'relative';
108108
export type FileAnnotationType = 'blame' | 'changes' | 'heatmap';
109109
export type GitCommandSorting = 'name' | 'usage';
110-
export type GraphBranchesVisibility = 'all' | 'smart' | 'current';
110+
export type GraphBranchesVisibility = 'all' | 'smart' | 'current' | 'favorited';
111111
export type GraphMultiSelectionMode = boolean | 'topological';
112112
export type GraphScrollMarkersAdditionalTypes =
113113
| 'localBranches'

src/git/utils/-webview/branch.utils.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,10 @@ export function isBranchStarred(container: Container, branchId: string): boolean
193193
const starred = container.storage.getWorkspace('starred:branches');
194194
return starred?.[branchId] === true;
195195
}
196+
197+
export function getStarredBranchIds(container: Container): Set<string> {
198+
const starred = container.storage.getWorkspace('starred:branches');
199+
if (starred == null) return new Set();
200+
201+
return new Set(Object.keys(starred).filter(branchId => starred[branchId] === true));
202+
}

src/webviews/apps/plus/graph/graph-header.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -846,16 +846,28 @@ export class GlGraphHeader extends SignalWatcher(LitElement) {
846846
Shows only relevant branches
847847
<br />
848848
<br />
849-
<i>
850-
Includes the current branch, its upstream, and its base
851-
or target branch
852-
</i>
849+
<i
850+
>Includes the current branch, its upstream, and its base
851+
or target branch</i
852+
>
853853
</span>
854854
</gl-tooltip>
855855
`,
856856
() => html` <code-icon icon="info" slot="suffix"></code-icon> `,
857857
)}
858858
</sl-option>
859+
<sl-option value="favorited" ?disabled=${repo?.virtual}>
860+
Favorited Branches
861+
<gl-tooltip placement="right" slot="suffix">
862+
<code-icon icon="info"></code-icon>
863+
<span slot="content">
864+
Shows only branches that have been starred as favorites
865+
<br />
866+
<br />
867+
<i>Also includes the current branch</i>
868+
</span>
869+
</gl-tooltip>
870+
</sl-option>
859871
<sl-option value="current">Current Branch</sl-option>
860872
</sl-select>
861873
</gl-tooltip>

0 commit comments

Comments
 (0)