Skip to content

Commit 8d7f8c2

Browse files
authored
some-ui-improvements (#11413)
* refactor(ui): remove unused yOffsetPx prop * feat(ui): change dropzone copy and add inline create-branch button * fix(drawers): bottom border conditions * feat(ui): prevent drawers from shrinking to keep full header visible
1 parent 6328fb9 commit 8d7f8c2

File tree

10 files changed

+23
-28
lines changed

10 files changed

+23
-28
lines changed

apps/desktop/src/components/BranchView.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@
9898
{grow}
9999
{onclose}
100100
{ontoggle}
101-
bottomBorder
102101
noshrink
103102
>
104103
{#snippet header()}

apps/desktop/src/components/ChangedFiles.svelte

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
draggableFiles?: boolean;
2525
grow?: boolean;
2626
noshrink?: boolean;
27-
bottomBorder?: boolean;
2827
resizer?: Partial<ComponentProps<typeof Resizer>>;
2928
autoselect?: boolean;
3029
ancestorMostConflictedCommitId?: string;
@@ -44,7 +43,6 @@
4443
draggableFiles,
4544
grow,
4645
noshrink,
47-
bottomBorder,
4846
resizer,
4947
autoselect,
5048
ancestorMostConflictedCommitId,
@@ -75,7 +73,6 @@
7573
{ontoggle}
7674
{resizer}
7775
{noshrink}
78-
bottomBorder={changes.length > 0}
7976
persistId={`changed-files-drawer-${projectId}-${stackId || 'default'}`}
8077
childrenWrapHeight={changes.length > 0 ? 'auto' : '100%'}
8178
childrenWrapDisplay={changes.length > 0 ? 'block' : 'flex'}
@@ -93,7 +90,7 @@
9390
<FileListMode bind:mode={listMode} persistId={`changed-files-${persistId}`} />
9491
{/snippet}
9592

96-
<div class="filelist-wrapper" class:bottom-border={bottomBorder}>
93+
<div class="filelist-wrapper">
9794
{#if changes.length > 0 || Object.entries(conflictEntries?.entries ?? {}).length > 0}
9895
<FileList
9996
{selectionId}
@@ -129,9 +126,5 @@
129126
height: 100%;
130127
margin-bottom: 16px;
131128
background-color: var(--clr-bg-1);
132-
133-
&.bottom-border {
134-
border-bottom: 1px solid var(--clr-border-2);
135-
}
136129
}
137130
</style>

apps/desktop/src/components/CommitLineOverlay.svelte

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
<script lang="ts">
22
import { portal } from '@gitbutler/ui/utils/portal';
3-
import { pxToRem } from '@gitbutler/ui/utils/pxToRem';
43
54
interface Props {
65
hovered: boolean;
76
activated: boolean;
87
advertize?: boolean;
9-
yOffsetPx?: number;
108
}
119
12-
const { hovered, activated, advertize, yOffsetPx = 0 }: Props = $props();
10+
const { hovered, activated, advertize }: Props = $props();
1311
1412
let containerElement = $state<HTMLDivElement>();
1513
let indicatorElement = $state<HTMLDivElement>();
@@ -50,7 +48,6 @@
5048
class:activated
5149
class:advertize
5250
class:hovered
53-
style:--y-offset="{pxToRem(yOffsetPx)}rem"
5451
>
5552
<div bind:this={indicatorElement} class="indicator-placeholder"></div>
5653
</div>

apps/desktop/src/components/CommitView.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@
159159
cancelEdit();
160160
onclose?.();
161161
}}
162-
bottomBorder
163162
noshrink
164163
>
165164
{#snippet header()}

apps/desktop/src/components/Drawer.svelte

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
children,
3737
testId,
3838
persistId,
39-
bottomBorder,
39+
bottomBorder = true,
4040
grow,
4141
noshrink,
4242
resizer,
@@ -68,7 +68,7 @@
6868
bind:this={containerDiv}
6969
bind:clientHeight
7070
class:collapsed={$collapsed}
71-
class:bottom-border={bottomBorder && !resizer}
71+
class:bottom-border={bottomBorder && !$collapsed}
7272
class:grow
7373
class:noshrink
7474
>
@@ -126,7 +126,6 @@
126126
passive={resizer.passive}
127127
disabled={$collapsed}
128128
direction="down"
129-
showBorder
130129
{...resizer}
131130
{maxHeight}
132131
/>
@@ -154,7 +153,6 @@
154153
}
155154
&.collapsed {
156155
max-height: none;
157-
margin-bottom: -1px;
158156
}
159157
}
160158

apps/desktop/src/components/MultiStackView.svelte

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,14 @@
275275
onclick={() => createBranchModal?.show()}>create a new branch</button
276276
> +
277277
{:else}
278-
Drag changes here to
278+
Drop files to start a branch,
279279
<br />
280-
branch off your changes
280+
or
281+
<button
282+
type="button"
283+
class="underline-dotted pointer-events clr-text-2 link-hover-2"
284+
onclick={() => createBranchModal?.show()}>create a new branch</button
285+
> +
281286
{/if}
282287
{/snippet}
283288
</MultiStackOfflaneDropzone>

apps/desktop/src/components/PRBranchView.svelte

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@
2121

2222
<ReduxResult result={prQuery?.result} {projectId} {onerror}>
2323
{#snippet children(pr)}
24-
<Drawer
25-
testId={TestId.PRBranchDrawer}
26-
persistId="pr-branch-drawer-{projectId}-{pr.number}"
27-
bottomBorder
28-
>
24+
<Drawer testId={TestId.PRBranchDrawer} persistId="pr-branch-drawer-{projectId}-{pr.number}">
2925
{#snippet header()}
3026
<h3 class="text-14 text-semibold truncate">
3127
<span class="clr-text-2">PR {unitSymbol}{pr.number}:</span>

apps/desktop/src/components/StackView.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,10 @@
717717
{@render assignedChangePreview(assignedStackId)}
718718
</ConfigurableScrollableContainer>
719719
{:else if selectedFile}
720-
<Drawer persistId="file-preview-drawer-{stableStackId}">
720+
<Drawer
721+
persistId="file-preview-drawer-{stableStackId}"
722+
bottomBorder={false}
723+
>
721724
{#snippet header()}
722725
<FileViewHeader
723726
noPaddings

apps/desktop/src/components/UnappliedBranchView.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
testId={TestId.UnappliedBranchDrawer}
4848
persistId="unapplied-branch-drawer-{projectId}-{branch.name}"
4949
{onclose}
50-
bottomBorder
50+
noshrink
5151
>
5252
{#snippet header()}
5353
<div class="branch__header">

apps/desktop/src/components/UnappliedCommitView.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@
2424

2525
<ReduxResult {projectId} result={commitQuery.result}>
2626
{#snippet children(commit)}
27-
<Drawer {onclose} bottomBorder persistId="unapplied-commit-drawer-{projectId}-{commitId}">
27+
<Drawer
28+
{onclose}
29+
bottomBorder
30+
noshrink
31+
persistId="unapplied-commit-drawer-{projectId}-{commitId}"
32+
>
2833
{#snippet header()}
2934
<CommitTitle
3035
truncate

0 commit comments

Comments
 (0)