Skip to content

Commit 2b50038

Browse files
fix: button overflow inside branch scrolling container (#5742)
* fix: button overflow inside branch scrolling container * fix: remove typo
1 parent 3e44a82 commit 2b50038

File tree

1 file changed

+43
-42
lines changed

1 file changed

+43
-42
lines changed

apps/desktop/src/lib/stack/Stack.svelte

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -152,49 +152,51 @@
152152
</Dropzones>
153153
{/if}
154154
<Spacer dotted />
155-
<div class="lane-branches">
156-
<SeriesList {branch} {lastPush} />
155+
<div style:position="relative">
156+
<div class="lane-branches">
157+
<SeriesList {branch} {lastPush} />
158+
</div>
159+
{#if canPush}
160+
<div
161+
class="lane-branches__action"
162+
class:scroll-end-visible={scrollEndVisible}
163+
use:intersectionObserver={{
164+
callback: (entry) => {
165+
if (entry?.isIntersecting) {
166+
scrollEndVisible = false;
167+
} else {
168+
scrollEndVisible = true;
169+
}
170+
},
171+
options: {
172+
root: null,
173+
rootMargin: `-100% 0px 0px 0px`,
174+
threshold: 0
175+
}
176+
}}
177+
>
178+
<Button
179+
style="neutral"
180+
kind="solid"
181+
wide
182+
loading={isPushingCommits}
183+
disabled={hasConflicts}
184+
tooltip={hasConflicts
185+
? 'In order to push, please resolve any conflicted commits.'
186+
: undefined}
187+
onclick={push}
188+
>
189+
{branch.requiresForce
190+
? 'Force push'
191+
: branch.validSeries.length > 1
192+
? 'Push All'
193+
: 'Push'}
194+
</Button>
195+
</div>
196+
{/if}
157197
</div>
158198
</div>
159199
</div>
160-
{#if canPush}
161-
<div
162-
class="lane-branches__action"
163-
class:scroll-end-visible={scrollEndVisible}
164-
use:intersectionObserver={{
165-
callback: (entry) => {
166-
if (entry?.isIntersecting) {
167-
scrollEndVisible = false;
168-
} else {
169-
scrollEndVisible = true;
170-
}
171-
},
172-
options: {
173-
root: null,
174-
rootMargin: `-100% 0px 0px 0px`,
175-
threshold: 0
176-
}
177-
}}
178-
>
179-
<Button
180-
style="neutral"
181-
kind="solid"
182-
wide
183-
loading={isPushingCommits}
184-
disabled={hasConflicts}
185-
tooltip={hasConflicts
186-
? 'In order to push, please resolve any conflicted commits.'
187-
: undefined}
188-
onclick={push}
189-
>
190-
{branch.requiresForce
191-
? 'Force push'
192-
: branch.validSeries.length > 1
193-
? 'Push All'
194-
: 'Push'}
195-
</Button>
196-
</div>
197-
{/if}
198200
</ScrollableContainer>
199201
<div class="divider-line">
200202
{#if rsViewport}
@@ -237,11 +239,10 @@
237239
}
238240
239241
.lane-branches__action {
240-
position: relative;
241242
z-index: var(--z-lifted);
242243
position: sticky;
243244
padding: 0 12px 12px;
244-
margin-bottom: 1px;
245+
margin: 0 -12px 1px -12px;
245246
bottom: 0;
246247
transition: background-color var(--transition-fast);
247248

0 commit comments

Comments
 (0)