Skip to content

Commit a9adfff

Browse files
committed
fix: ui alignment
1 parent f07304a commit a9adfff

File tree

6 files changed

+23
-16
lines changed

6 files changed

+23
-16
lines changed

src/ui/history/components/logFileComponent.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
>
4646
<div
4747
class="tree-item-self is-clickable nav-file-title"
48+
data-path={diff.vault_path}
4849
aria-label-position={side}
4950
aria-label={diff.vault_path}
5051
>
@@ -71,8 +72,7 @@
7172

7273
<style lang="scss">
7374
main {
74-
.nav-file-title-content {
75-
display: flex;
75+
.nav-file-title {
7676
align-items: center;
7777
}
7878
}

src/ui/sourceControl/components/fileComponent.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
>
8585
<div
8686
class="tree-item-self is-clickable nav-file-title"
87+
data-path={change.vault_path}
8788
aria-label-position={side}
8889
aria-label={change.vault_path}
8990
>
@@ -131,8 +132,7 @@
131132

132133
<style lang="scss">
133134
main {
134-
.nav-file-title-content {
135-
display: flex;
135+
.nav-file-title {
136136
align-items: center;
137137
}
138138
}

src/ui/sourceControl/components/pulledFileComponent.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<!-- svelte-ignore a11y-unknown-aria-attribute -->
3636
<div
3737
class="tree-item-self is-clickable nav-file-title"
38+
data-path={change.vault_path}
3839
aria-label-position={side}
3940
aria-label={change.vault_path}
4041
>
@@ -51,8 +52,7 @@
5152

5253
<style lang="scss">
5354
main {
54-
.nav-file-title-content {
55-
display: flex;
55+
.nav-file-title {
5656
align-items: center;
5757
}
5858
}

src/ui/sourceControl/components/stagedFileComponent.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
>
6161
<div
6262
class="tree-item-self is-clickable nav-file-title"
63+
data-path={change.vault_path}
6364
aria-label-position={side}
6465
aria-label={change.vault_path}
6566
>
@@ -92,8 +93,7 @@
9293

9394
<style lang="scss">
9495
main {
95-
.nav-file-title-content {
96-
display: flex;
96+
.nav-file-title {
9797
align-items: center;
9898
}
9999
}

src/ui/sourceControl/components/treeComponent.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,7 @@
211211

212212
<style lang="scss">
213213
main {
214-
.nav-folder-title-content {
215-
display: flex;
214+
.nav-folder-title {
216215
align-items: center;
217216
}
218217
}

src/ui/sourceControl/sourceControl.svelte

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<script lang="ts">
22
import { Platform, setIcon } from "obsidian";
3+
import { SOURCE_CONTROL_VIEW_CONFIG } from "src/constants";
34
import ObsidianGit from "src/main";
45
import {
56
FileStatusResult,
@@ -98,15 +99,18 @@
9899
const unPushedCommits = await plugin.gitManager.getUnpushedCommits();
99100
100101
buttons.forEach((btn) => {
101-
if(Platform.isMobile){
102+
if (Platform.isMobile) {
102103
btn.removeClass("button-border");
103104
if (btn.id == "push" && unPushedCommits > 0) {
104105
btn.addClass("button-border");
105106
}
106-
}else{
107-
btn.firstElementChild?.removeAttribute("color")
107+
} else {
108+
btn.firstElementChild?.removeAttribute("color");
108109
if (btn.id == "push" && unPushedCommits > 0) {
109-
btn.firstElementChild?.setAttr("color","var(--text-accent)")
110+
btn.firstElementChild?.setAttr(
111+
"color",
112+
"var(--text-accent)"
113+
);
110114
}
111115
}
112116
});
@@ -217,7 +221,7 @@
217221
$: rows = (commitMessage.match(/\n/g) || []).length + 1 || 1;
218222
</script>
219223

220-
<main>
224+
<main data-type={SOURCE_CONTROL_VIEW_CONFIG.type}>
221225
<div class="nav-header">
222226
<div class="nav-buttons-container">
223227
<div
@@ -403,7 +407,7 @@
403407
{/if}
404408
</div>
405409
<div
406-
class="changes nav-folder"
410+
class="changes tree-item nav-folder"
407411
class:is-collapsed={!changesOpen}
408412
>
409413
<div
@@ -619,6 +623,10 @@
619623
}
620624
}
621625
626+
.nav-folder-title {
627+
align-items: center;
628+
}
629+
622630
.git-commit-msg-clear-button {
623631
position: absolute;
624632
background: transparent;

0 commit comments

Comments
 (0)