Skip to content

Commit 17fa52c

Browse files
authored
UI fixes 26 (#7894)
* Refactor commit header style prop * typo fix * refactor resizer * rename things semantically Update StackTabs.svelte Update StackTabs.svelte * fix: new branch empty state height * fix: remove extra top border * fix: remove debugging string * fix: commit goes here - overflow hidden - last item too narrow * plus button: remove unused props * more contrast to the new stack button
1 parent 0e606d2 commit 17fa52c

File tree

5 files changed

+32
-26
lines changed

5 files changed

+32
-26
lines changed

apps/desktop/src/components/v3/BranchCard.svelte

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@
177177
{#if isCommitting}
178178
<!-- Only commits to the base can be `last`, see next `CommitGoesHere`. -->
179179
<CommitGoesHere
180-
{commitId}
181180
{selected}
182181
{first}
183182
last={false}
@@ -228,7 +227,6 @@
228227
</Dropzone>
229228
{#if isCommitting && last && lastBranch}
230229
<CommitGoesHere
231-
{commitId}
232230
{first}
233231
{last}
234232
selected={selectedCommitId === baseSha}
@@ -287,7 +285,6 @@
287285
border: 1px solid var(--clr-border-2);
288286
border-radius: var(--radius-ml);
289287
background: var(--clr-bg-1);
290-
overflow: hidden;
291288
}
292289
293290
.branch-header__details {

apps/desktop/src/components/v3/BranchHeader.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
border-top-right-radius: var(--radius-ml);
135135
border-top-left-radius: var(--radius-ml);
136136
border-bottom: 1px solid var(--clr-border-2);
137+
overflow: hidden;
137138
138139
&:before {
139140
content: '';

apps/desktop/src/components/v3/BranchView.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@
130130
131131
/* EMPTY STATE */
132132
.branch-view__empty-state {
133+
flex: 1;
133134
display: flex;
134135
flex-direction: column;
135136
justify-content: center;
136-
height: 100%;
137137
padding: 30px;
138138
max-width: 540px;
139139
margin: 0 auto;

apps/desktop/src/components/v3/CommitGoesHere.svelte

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
import Badge from '@gitbutler/ui/Badge.svelte';
33
44
type Props = {
5-
commitId: string;
65
first: boolean;
76
last: boolean;
87
selected: boolean;
98
onclick: () => void;
109
};
1110
12-
const { commitId, first, last, selected, onclick }: Props = $props();
11+
const { first, last, selected, onclick }: Props = $props();
1312
</script>
1413

1514
{#snippet indicator(args?: { last: boolean; first: boolean })}
@@ -18,15 +17,15 @@
1817
<div class="pin__line"></div>
1918
<div class="pin__circle"></div>
2019
</div>
21-
<div>
22-
<Badge size="tag" style="pop">Your commit goes here {last}</Badge>
23-
</div>
20+
<Badge size="tag" style="pop">Your commit goes here</Badge>
2421
</div>
2522
{/snippet}
26-
{#snippet commitHere(args: { commitId: string; last?: boolean })}
27-
<button class="commit-here" type="button" class:last={args.last} {onclick}>
23+
{#snippet commitHere(args: { last?: boolean })}
24+
{@const last = args?.last}
25+
<button class="commit-here" class:commit-here_last={last} type="button" {onclick}>
2826
<div class="commit-here__circle"></div>
2927
<div class="commit-here__line"></div>
28+
3029
<div class="commit-here__label text-11 text-semibold">Commit here</div>
3130
</button>
3231
{/snippet}
@@ -35,7 +34,7 @@
3534
{@render indicator({ first, last })}
3635
{/if}
3736
{#if !selected}
38-
{@render commitHere({ commitId })}
37+
{@render commitHere({ last })}
3938
{/if}
4039

4140
<style lang="postcss">
@@ -46,9 +45,6 @@
4645
align-items: center;
4746
background-color: var(--clr-bg-1);
4847
border-bottom: 1px solid var(--clr-border-2);
49-
&.first {
50-
border-top: 1px solid var(--clr-border-2);
51-
}
5248
&.last {
5349
border-top: 1px solid var(--clr-border-2);
5450
border-bottom: none;
@@ -86,6 +82,7 @@
8682
align-items: center;
8783
opacity: 0;
8884
z-index: var(--z-lifted);
85+
transition: height var(--transition-fast);
8986
9087
&:hover {
9188
opacity: 1;
@@ -94,6 +91,11 @@
9491
opacity: 1;
9592
transform: translateY(-50%) translateX(0) scale(1);
9693
}
94+
95+
&.commit-here_last {
96+
height: 30px;
97+
margin-bottom: 0;
98+
}
9799
}
98100
}
99101
.commit-here__circle {
@@ -126,4 +128,8 @@
126128
opacity var(--transition-fast),
127129
transform var(--transition-medium);
128130
}
131+
132+
/* .commit-here_last {
133+
margin-bottom: 0;
134+
} */
129135
</style>

apps/desktop/src/components/v3/stackTabs/StackTabNew.svelte

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,24 @@
8484
}
8585
}
8686
87-
let overflowed = $state(false);
88-
8987
// TODO: it would be nice to remember the last selected option for the next time the modal is opened
9088
</script>
9189

9290
<button
9391
aria-label="new stack"
9492
type="button"
9593
class="new-stack-btn"
96-
class:overflow={overflowed}
9794
onclick={() => createRefModal?.show()}
9895
bind:this={el}
9996
onkeydown={handleArrowNavigation}
10097
>
10198
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
102-
<path d="M0 10H20M10 0L10 20" stroke="currentColor" stroke-width="1.5" />
99+
<path
100+
d="M0 10H20M10 0L10 20"
101+
stroke="currentColor"
102+
opacity="var(--plus-icon-opacity)"
103+
stroke-width="1.5"
104+
/>
103105
</svg>
104106
</button>
105107

@@ -198,25 +200,25 @@
198200
height: 100%;
199201
padding: 0 15px;
200202
background: var(--clr-stack-tab-inactive);
201-
color: var(--clr-text-3);
203+
color: var(--clr-text-2);
204+
--plus-icon-opacity: 0.8;
202205
transition:
203206
color var(--transition-fast),
204207
background var(--transition-fast);
205208
209+
&:hover,
210+
&:focus {
211+
--plus-icon-opacity: 1;
212+
}
213+
206214
&:hover {
207-
color: var(--clr-text-2);
208215
background: var(--clr-stack-tab-inactive-hover);
209216
}
210217
211218
&:focus {
212219
outline: none;
213-
color: var(--clr-text-2);
214220
background: var(--clr-stack-tab-active);
215221
}
216-
217-
&.overflow {
218-
background-color: red;
219-
}
220222
}
221223
222224
/* MODAL WINDOW */

0 commit comments

Comments
 (0)