Skip to content

Commit 953dbd4

Browse files
authored
fix: make view header buttons sticky and contain scrollbar to body (#864)
* make views ui more consistent with obsidian ui * run prettier
1 parent 933c7aa commit 953dbd4

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

src/ui/history/historyView.svelte

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101

102102
<!-- svelte-ignore a11y_click_events_have_key_events -->
103103
<!-- svelte-ignore a11y_no_static_element_interactions -->
104-
<main>
104+
<main class="git-view">
105105
<div class="nav-header">
106106
<div class="nav-buttons-container">
107107
<div
@@ -123,7 +123,6 @@
123123
class:loading
124124
data-icon="refresh-cw"
125125
aria-label="Refresh"
126-
style="margin: 1px;"
127126
bind:this={buttons[1]}
128127
onclick={triggerRefresh}
129128
></div>
@@ -138,10 +137,10 @@
138137
{/each}
139138
</div>
140139
{/if}
140+
<div id="sentinel"></div>
141+
<!-- Ensure that the sentinel item is reachable with the overlaying status bar and indicate that the end of the list is reached -->
142+
<div style="margin-bottom:40px"></div>
141143
</div>
142-
<div id="sentinel"></div>
143-
<!-- Ensure that the sentinel item is reachable with the overlaying status bar and indicate that the end of the list is reached -->
144-
<div style="margin-bottom:40px"></div>
145144
</main>
146145

147146
<style lang="scss">

src/ui/sourceControl/sourceControl.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@
224224

225225
<!-- svelte-ignore a11y_click_events_have_key_events -->
226226
<!-- svelte-ignore a11y_no_static_element_interactions -->
227-
<main data-type={SOURCE_CONTROL_VIEW_CONFIG.type}>
227+
<main data-type={SOURCE_CONTROL_VIEW_CONFIG.type} class="git-view">
228228
<div class="nav-header">
229229
<div class="nav-buttons-container">
230230
<div
@@ -294,7 +294,6 @@
294294
class:loading
295295
data-icon="refresh-cw"
296296
aria-label="Refresh"
297-
style="margin: 1px;"
298297
bind:this={buttons[7]}
299298
onclick={triggerRefresh}
300299
></div>

styles.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,3 +574,11 @@
574574
.git-split-diff-view .cm-insertedLine .cm-changedText {
575575
background-color: #22bb2230;
576576
}
577+
578+
/* Limits the scrollbar to the view body */
579+
.git-view {
580+
display: flex;
581+
flex-direction: column;
582+
position: relative;
583+
height: 100%;
584+
}

0 commit comments

Comments
 (0)