@@ -15,8 +15,10 @@ import type {
15
15
OpenInTimelineParams ,
16
16
State ,
17
17
} from '../../../../home/protocol' ;
18
+ import { ExecuteCommand } from '../../../../protocol' ;
18
19
import { stateContext } from '../../../home/context' ;
19
20
import type { RepoButtonGroupClickEvent } from '../../../shared/components/repo-button-group' ;
21
+ import { ipcContext } from '../../../shared/contexts/ipc' ;
20
22
import { linkStyles , ruleStyles } from '../../shared/components/vscode.css' ;
21
23
import { branchCardStyles , GlBranchCardBase } from './branch-card' ;
22
24
import type { ActiveOverviewState } from './overviewState' ;
@@ -31,6 +33,7 @@ import '../../../shared/components/menu/menu-item';
31
33
import '../../../shared/components/menu/menu-label' ;
32
34
import '../../../shared/components/overlays/popover' ;
33
35
import '../../../shared/components/pills/tracking' ;
36
+ import '../../../shared/components/ref-button' ;
34
37
import '../../../shared/components/repo-button-group' ;
35
38
import '../../../shared/components/rich/issue-icon' ;
36
39
import '../../../shared/components/rich/pr-icon' ;
@@ -104,6 +107,9 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
104
107
@consume ( { context : activeOverviewStateContext } )
105
108
private _activeOverviewState ! : ActiveOverviewState ;
106
109
110
+ @consume ( { context : ipcContext } )
111
+ private _ipc ! : typeof ipcContext . __context__ ;
112
+
107
113
@state ( )
108
114
private repoCollapsed = true ;
109
115
@@ -119,6 +125,13 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
119
125
}
120
126
}
121
127
128
+ private onBranchSelectorClicked ( ) {
129
+ this . _ipc . sendCommand ( ExecuteCommand , {
130
+ command : 'gitlens.home.switchToBranch' ,
131
+ args : [ { repoPath : this . _activeOverviewState . state ?. active . repoPath } ] ,
132
+ } ) ;
133
+ }
134
+
122
135
override render ( ) : unknown {
123
136
if ( this . _homeState . discovering ) {
124
137
return this . renderLoader ( ) ;
@@ -176,7 +189,9 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
176
189
> </ gl-breadcrumb-item
177
190
>
178
191
< gl-breadcrumb-item collapsibleState ="none " icon ="git-branch " class ="heading-branch-breadcrumb "
179
- > ${ activeBranch . name } </ gl-breadcrumb-item
192
+ > < gl-ref-button .ref =${ activeBranch . reference } @click =${ this . onBranchSelectorClicked }
193
+ > < span slot ="tooltip "> Switch to Another Branch... </ span > </ gl-ref-button
194
+ > </ gl-breadcrumb-item
180
195
>
181
196
</ gl-breadcrumbs >
182
197
< span class ="section-heading-actions " slot ="heading-actions ">
@@ -546,18 +561,19 @@ export class GlActiveBranchCard extends GlBranchCardBase {
546
561
547
562
return html `< div class ="branch-item__row " full >
548
563
< span class ="branch-item__missing " full > Current work item</ span >
549
- < gl-tooltip hoist content ="Associate an issue ">
550
- < a
551
- href =${ this . createCommandLink < AssociateIssueWithBranchCommandArgs > (
552
- 'gitlens.associateIssueWithBranch' ,
553
- {
554
- branch : this . branch . reference ,
555
- source : 'home' ,
556
- } ,
557
- ) }
558
- > < span class ="branch-item__icon "> < issue-icon > </ issue-icon > </ span
559
- > </ a >
560
- </ gl-tooltip >
564
+ < gl-button
565
+ appearance ="toolbar "
566
+ href =${ this . createCommandLink < AssociateIssueWithBranchCommandArgs > (
567
+ 'gitlens.associateIssueWithBranch' ,
568
+ {
569
+ branch : this . branch . reference ,
570
+ source : 'home' ,
571
+ } ,
572
+ ) }
573
+ tooltip ="Associate Issue with Branch"
574
+ aria-label="Associate Issue with Branch"
575
+ > < issue-icon > </ issue-icon >
576
+ </ gl-button >
561
577
</ div > ` ;
562
578
}
563
579
return super . renderIssuesItem ( ) ;
0 commit comments