@@ -15,8 +15,10 @@ import type {
1515 OpenInTimelineParams ,
1616 State ,
1717} from '../../../../home/protocol' ;
18+ import { ExecuteCommand } from '../../../../protocol' ;
1819import { stateContext } from '../../../home/context' ;
1920import type { RepoButtonGroupClickEvent } from '../../../shared/components/repo-button-group' ;
21+ import { ipcContext } from '../../../shared/contexts/ipc' ;
2022import { linkStyles , ruleStyles } from '../../shared/components/vscode.css' ;
2123import { branchCardStyles , GlBranchCardBase } from './branch-card' ;
2224import type { ActiveOverviewState } from './overviewState' ;
@@ -31,6 +33,7 @@ import '../../../shared/components/menu/menu-item';
3133import '../../../shared/components/menu/menu-label' ;
3234import '../../../shared/components/overlays/popover' ;
3335import '../../../shared/components/pills/tracking' ;
36+ import '../../../shared/components/ref-button' ;
3437import '../../../shared/components/repo-button-group' ;
3538import '../../../shared/components/rich/issue-icon' ;
3639import '../../../shared/components/rich/pr-icon' ;
@@ -104,6 +107,9 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
104107 @consume ( { context : activeOverviewStateContext } )
105108 private _activeOverviewState ! : ActiveOverviewState ;
106109
110+ @consume ( { context : ipcContext } )
111+ private _ipc ! : typeof ipcContext . __context__ ;
112+
107113 @state ( )
108114 private repoCollapsed = true ;
109115
@@ -119,6 +125,13 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
119125 }
120126 }
121127
128+ private onBranchSelectorClicked ( ) {
129+ this . _ipc . sendCommand ( ExecuteCommand , {
130+ command : 'gitlens.home.switchToBranch' ,
131+ args : [ { repoPath : this . _activeOverviewState . state ?. active . repoPath } ] ,
132+ } ) ;
133+ }
134+
122135 override render ( ) : unknown {
123136 if ( this . _homeState . discovering ) {
124137 return this . renderLoader ( ) ;
@@ -176,7 +189,9 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
176189 > </ gl-breadcrumb-item
177190 >
178191 < 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
180195 >
181196 </ gl-breadcrumbs >
182197 < span class ="section-heading-actions " slot ="heading-actions ">
@@ -546,18 +561,19 @@ export class GlActiveBranchCard extends GlBranchCardBase {
546561
547562 return html `< div class ="branch-item__row " full >
548563 < 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 >
561577 </ div > ` ;
562578 }
563579 return super . renderIssuesItem ( ) ;
0 commit comments