@@ -8,7 +8,7 @@ import type { GitTrackingState } from '../../../../../git/models/branch';
8
8
import { createWebviewCommandLink } from '../../../../../system/webview' ;
9
9
import type { GetOverviewBranch , State } from '../../../../home/protocol' ;
10
10
import { stateContext } from '../../../home/context' ;
11
- import { branchCardStyles , createCommandLink , sectionHeadingStyles } from './branch-section' ;
11
+ import { branchCardStyles , createCommandLink } from './branch-section' ;
12
12
import type { Overview , OverviewState } from './overviewState' ;
13
13
import { overviewStateContext } from './overviewState' ;
14
14
import '../../../shared/components/button' ;
@@ -27,22 +27,16 @@ export const activeWorkTagName = 'gl-active-work';
27
27
export class GlActiveWork extends SignalWatcher ( LitElement ) {
28
28
static override styles = [
29
29
branchCardStyles ,
30
- sectionHeadingStyles ,
31
30
css `
32
31
:host {
33
32
display: block;
34
33
margin-bottom: 2.4rem;
35
- }
36
- .is-end {
37
- margin-block-end: 0;
34
+ color: var(--vscode-foreground);
38
35
}
39
36
.section-heading-action {
40
37
--button-padding: 0.1rem 0.2rem 0;
41
38
margin-block: -1rem;
42
39
}
43
- .heading-icon {
44
- color: var(--color-foreground--50);
45
- }
46
40
` ,
47
41
] ;
48
42
@@ -76,8 +70,10 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
76
70
private renderPending ( ) {
77
71
if ( this . _overviewState . state == null ) {
78
72
return html `
79
- < h3 class ="section-heading "> < skeleton-loader lines ="1 "> </ skeleton-loader > </ h3 >
80
- < skeleton-loader lines ="3 "> </ skeleton-loader >
73
+ < gl-section >
74
+ < skeleton-loader slot ="heading " lines ="1 "> </ skeleton-loader >
75
+ < skeleton-loader lines ="3 "> </ skeleton-loader >
76
+ </ gl-section >
81
77
` ;
82
78
}
83
79
return this . renderComplete ( this . _overviewState . state , true ) ;
@@ -89,12 +85,14 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
89
85
if ( ! activeBranches ) return html `< span > None</ span > ` ;
90
86
91
87
return html `
92
- < h3 class ="section-heading section-heading--actions ">
93
- < span > < code-icon icon ="repo " class ="heading-icon "> </ code-icon > ${ overview ! . repository . name } </ span >
88
+ < gl-section >
89
+ < span slot ="heading "
90
+ > < code-icon icon ="repo " class ="heading-icon "> </ code-icon > ${ overview ! . repository . name } </ span
91
+ >
94
92
${ when (
95
93
this . _homeState . repositories . openCount > 1 ,
96
94
( ) =>
97
- html `< span
95
+ html `< span slot =" heading-actions "
98
96
> < gl-button
99
97
aria-busy ="${ ifDefined ( isFetching ) } "
100
98
?disabled =${ isFetching }
@@ -105,32 +103,38 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
105
103
> < code-icon icon ="chevron-down "> </ code-icon > </ gl-button
106
104
> </ span > ` ,
107
105
) }
108
- </ h3 >
109
- ${ activeBranches . map ( branch => this . renderRepoBranchCard ( branch , repo . path , isFetching ) ) }
106
+ ${ activeBranches . map ( branch => this . renderRepoBranchCard ( branch , repo . path , isFetching ) ) }
107
+ </ gl-section >
110
108
` ;
111
109
}
112
110
113
111
private renderRepoBranchCard ( branch : GetOverviewBranch , repo : string , isFetching : boolean ) {
114
112
const { name, pr, state, workingTreeState, upstream } = branch ;
115
113
return html `
116
114
< gl-card class ="branch-item " active >
117
- < p class ="branch-item__main ">
118
- < span class ="branch-item__icon ">
119
- < code-icon icon =${ branch . worktree ? 'gl-worktrees-view' : 'git-branch' } > </ code-icon >
120
- </ span >
121
- < span class ="branch-item__name "> ${ name } </ span >
122
- </ p >
123
- ${ when ( state , ( ) => this . renderBranchStateActions ( state , upstream , isFetching ) ) }
124
- ${ when ( pr , pr => {
125
- return html ` < p class ="branch-item__main is-end ">
126
- < span class ="branch-item__icon ">
127
- < pr-icon state =${ pr . state } > </ pr-icon >
128
- </ span >
129
- < span class ="branch-item__name "> ${ pr . title } </ span >
130
- < a href =${ pr . url } class ="branch-item__identifier"> #${ pr . id } </ a >
131
- </ p > ` ;
132
- } ) }
133
- ${ when ( workingTreeState , ( ) => this . renderStatus ( workingTreeState , state ) ) }
115
+ < div class ="branch-item__container ">
116
+ < div class ="branch-item__section ">
117
+ < p class ="branch-item__grouping ">
118
+ < span class ="branch-item__icon ">
119
+ < code-icon icon =${ branch . worktree ? 'gl-worktrees-view' : 'git-branch' } > </ code-icon >
120
+ </ span >
121
+ < span class ="branch-item__name "> ${ name } </ span >
122
+ </ p >
123
+ </ div >
124
+ ${ when ( state , ( ) => this . renderBranchStateActions ( state , upstream , isFetching ) ) }
125
+ ${ when ( pr , pr => {
126
+ return html `< div class ="branch-item__section ">
127
+ < p class ="branch-item__grouping ">
128
+ < span class ="branch-item__icon ">
129
+ < pr-icon state =${ pr . state } > </ pr-icon >
130
+ </ span >
131
+ < span class ="branch-item__name "> ${ pr . title } </ span >
132
+ < a href =${ pr . url } class ="branch-item__identifier"> #${ pr . id } </ a >
133
+ </ p >
134
+ </ div > ` ;
135
+ } ) }
136
+ ${ when ( workingTreeState , ( ) => this . renderStatus ( workingTreeState , state ) ) }
137
+ </ div >
134
138
${ this . renderActions ( branch , repo ) }
135
139
</ gl-card >
136
140
` ;
@@ -312,7 +316,7 @@ export class GlActiveWork extends SignalWatcher(LitElement) {
312
316
// }
313
317
314
318
if ( rendered . length ) {
315
- return html `< p class ="branch-item__details "> ${ rendered } </ p > ` ;
319
+ return html `< p class ="branch-item__section branch-item__section--details "> ${ rendered } </ p > ` ;
316
320
}
317
321
318
322
return nothing ;
0 commit comments