File tree Expand file tree Collapse file tree 5 files changed +42
-40
lines changed
apps/desktop/src/components/v3 Expand file tree Collapse file tree 5 files changed +42
-40
lines changed Original file line number Diff line number Diff line change 7
7
import { TestId } from ' $lib/testing/testIds' ;
8
8
import { inject } from ' @gitbutler/shared/context' ;
9
9
import Icon from ' @gitbutler/ui/Icon.svelte' ;
10
+ import { slide } from ' svelte/transition' ;
10
11
import type iconsJson from ' @gitbutler/ui/data/icons.json' ;
11
12
import type { Snippet } from ' svelte' ;
12
13
94
95
tabindex =" 0"
95
96
class:activated ={args .isMenuOpenByMouse || args .isMenuOpenByBtn }
96
97
>
98
+ {#if args .selected }
99
+ <div class ="branch-header__select-indicator" in:slide ={{ axis : ' x' , duration : 150 }}></div >
100
+ {/if }
101
+
97
102
<BranchHeaderIcon
98
103
{lineColor }
99
104
{iconName }
188
193
border-bottom : 1 px solid var (--clr-border-2 );
189
194
overflow : hidden;
190
195
191
- &:before {
192
- content : '' ;
193
- position : absolute;
194
- top : 14 px ;
195
- left : 0 ;
196
- width : 4 px ;
197
- height : 20 px ;
198
- transform : translateX (-100 % );
199
- border-radius : 0 var (--radius-ml ) var (--radius-ml ) 0 ;
200
- background-color : var (--clr-selected-in-focus-element );
201
- transition : transform var (--transition-fast );
202
- }
203
-
204
196
&:hover ,
205
197
& .activated {
206
198
background-color : var (--clr-bg-1-muted );
217
209
& .branch-menu-btn {
218
210
display : flex;
219
211
}
220
-
221
- &:before {
222
- transform : translateX (0 % );
223
- }
224
212
}
225
213
226
214
&:focus-within .selected {
236
224
}
237
225
}
238
226
227
+ .branch-header__select-indicator {
228
+ position : absolute;
229
+ top : 14 px ;
230
+ left : 0 ;
231
+ width : 4 px ;
232
+ height : 20 px ;
233
+ border-radius : 0 var (--radius-ml ) var (--radius-ml ) 0 ;
234
+ background-color : var (--clr-selected-in-focus-element );
235
+ transition : transform var (--transition-fast );
236
+ }
237
+
239
238
.name-line {
240
239
display : flex;
241
240
align-items : center;
Original file line number Diff line number Diff line change 30
30
31
31
<style >
32
32
.stack__status {
33
+ flex : 0 0 auto ;
33
34
align-self : stretch ;
34
35
display : flex ;
35
36
flex-direction : column ;
36
37
justify-content : center ;
37
38
gap : 3px ;
39
+ width : 42px ;
38
40
--clr-transparent : transparent ;
39
41
40
42
& .stack __status--icon {
46
48
border-radius : var (--radius-m );
47
49
background-color : var (--bg-color );
48
50
color : #fff ;
49
- margin-left : 10 px ;
51
+ margin : 0 auto ;
50
52
}
51
53
52
54
& .stack__status--bar {
53
55
width : 2px ;
54
56
height : 8px ;
55
- margin : 0 22 px 0 20 px ;
57
+ margin : 0 auto ;
56
58
background : var (--bg-color );
57
59
58
60
&.dashed {
Original file line number Diff line number Diff line change 115
115
{branchName }
116
116
{projectId }
117
117
{first }
118
- lastCommit ={lastCommit && ! commit }
118
+ lastCommit ={lastCommit && localAndRemoteCommits . length === 0 }
119
119
{commit }
120
120
{selected }
121
121
onclick ={() => {
Original file line number Diff line number Diff line change 12
12
width? : number ;
13
13
}
14
14
15
- const { commit, lastCommit, lastBranch, width = 48 }: Props = $props ();
15
+ const { commit, lastCommit, lastBranch, width = 42 }: Props = $props ();
16
16
17
17
const color = $derived (
18
18
isLocalAndRemoteCommit (commit )
64
64
65
65
<style lang =" postcss" >
66
66
.commit-lines {
67
+ flex : 0 0 auto;
67
68
display : flex;
68
69
flex-direction : column;
69
70
align-items : center;
Original file line number Diff line number Diff line change 16
16
import ContextMenu from ' @gitbutler/ui/ContextMenu.svelte' ;
17
17
import Icon from ' @gitbutler/ui/Icon.svelte' ;
18
18
import { getTimeAgo } from ' @gitbutler/ui/utils/timeAgo' ;
19
+ import { slide } from ' svelte/transition' ;
19
20
20
21
type Props = {
21
22
projectId: string ;
107
108
role =" button"
108
109
tabindex =" 0"
109
110
aria-label =" Commit row"
110
- class =" commit-row__main "
111
+ class =" commit-row "
111
112
class:menu-shown ={isOpenedByKebabButton || isOpenedByMouse }
112
113
class:first
113
114
class:selected
157
158
}
158
159
: NON_DRAGGABLE }
159
160
>
161
+ {#if selected }
162
+ <div class ="commit-row__select-indicator" in:slide ={{ axis : ' x' , duration : 150 }}></div >
163
+ {/if }
164
+
160
165
<CommitLine {commit } {lastCommit } {lastBranch } />
161
166
162
167
<div class =" commit-content" >
219
224
/>
220
225
221
226
<style lang =" postcss" >
222
- .commit-row__main {
227
+ .commit-row {
223
228
position : relative;
224
229
display : flex;
225
230
width : 100 % ;
226
231
overflow : hidden;
227
232
transition : background-color var (--transition-fast );
228
233
229
- &::before {
230
- content : '' ;
231
- position : absolute;
232
- top : 50 % ;
233
- left : 0 ;
234
- width : 4 px ;
235
- height : 45 % ;
236
- transform : translateX (-100 % ) translateY (-50 % );
237
- border-radius : 0 var (--radius-ml ) var (--radius-ml ) 0 ;
238
- background-color : var (--clr-selected-in-focus-element );
239
- transition : transform var (--transition-fast );
240
- }
241
-
242
234
&:hover ,
243
235
& .menu-shown {
244
236
background-color : var (--clr-bg-1-muted );
263
255
& .commit-menu-btn {
264
256
display : flex;
265
257
}
266
-
267
- &:before {
268
- transform : translateX (0 % ) translateY (-50 % );
269
- }
270
258
}
271
259
272
260
&:focus-within .selected {
273
261
background-color : var (--clr-selected-in-focus-bg );
274
262
}
275
263
}
276
264
265
+ .commit-row__select-indicator {
266
+ position : absolute;
267
+ top : 50 % ;
268
+ left : 0 ;
269
+ width : 4 px ;
270
+ height : 45 % ;
271
+ transform : translateY (-50 % );
272
+ border-radius : 0 var (--radius-ml ) var (--radius-ml ) 0 ;
273
+ background-color : var (--clr-selected-in-focus-element );
274
+ transition : transform var (--transition-fast );
275
+ }
276
+
277
277
.commit-content {
278
278
display : flex;
279
279
align-items : center;
You can’t perform that action at this time.
0 commit comments