From f777284af2c4b99490c37065bb2a5eec5087671e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Wed, 2 Apr 2025 18:15:23 +0200 Subject: [PATCH] Make all elements of title row same height This is so that text areas and buttons align perfectly. --- src/components/Button.svelte | 4 +++- src/components/CommentToggleInput.svelte | 2 +- src/components/DropdownListItem.svelte | 11 +++++++---- src/components/HomeSidebar.svelte | 2 +- src/components/IssueSecondColumn.svelte | 16 +++++++++------- src/components/IssueStateButton.svelte | 7 +++++-- src/components/IssuesSecondColumn.svelte | 2 +- src/components/NakedButton.svelte | 2 +- src/components/PatchStateButton.svelte | 7 +++++-- src/components/PatchesSecondColumn.svelte | 2 +- src/components/RepoTeaser.svelte | 2 +- src/components/Review.svelte | 12 ++++++------ src/components/Settings.svelte | 4 ++-- src/components/Sidebar.svelte | 16 ++++++++-------- src/views/home/Inbox.svelte | 2 +- src/views/home/Repos.svelte | 4 ++-- src/views/repo/CreateIssue.svelte | 6 +++++- src/views/repo/Issue.svelte | 8 ++++---- src/views/repo/Issues.svelte | 7 ++++--- src/views/repo/Patch.svelte | 21 +++++++++++---------- src/views/repo/Patches.svelte | 4 ++-- 21 files changed, 80 insertions(+), 61 deletions(-) diff --git a/src/components/Button.svelte b/src/components/Button.svelte index 64e3e0862..9c863fee6 100644 --- a/src/components/Button.svelte +++ b/src/components/Button.svelte @@ -10,6 +10,7 @@ flatLeft?: boolean; flatRight?: boolean; title?: string; + styleHeight?: "2rem" | "2.5rem"; } const { @@ -21,6 +22,7 @@ flatLeft = false, flatRight = false, title, + styleHeight = "2rem", }: Props = $props(); const style = $derived( @@ -43,7 +45,6 @@ color: var(--text-color); - height: 2rem; column-gap: 0; row-gap: 0; display: grid; @@ -371,6 +372,7 @@
{ e.preventDefault(); diff --git a/src/components/DropdownListItem.svelte b/src/components/DropdownListItem.svelte index 039a7da1e..8fe6fcb35 100644 --- a/src/components/DropdownListItem.svelte +++ b/src/components/DropdownListItem.svelte @@ -7,7 +7,8 @@ onclick: () => void; disabled?: boolean; title?: string; - style?: string; + styleGap?: string; + styleMinHeight?: string; } const { @@ -16,7 +17,8 @@ selected, disabled = false, title, - style, + styleGap, + styleMinHeight, }: Props = $props(); @@ -27,7 +29,7 @@ align-items: center; flex-direction: row; min-height: 2rem; - padding: 0 0.5rem; + padding: 0 0.75rem; white-space: nowrap; font-size: var(--font-size-small); font-weight: var(--font-weight-regular); @@ -65,7 +67,8 @@ class="item" class:selected class:disabled - {style} + style:gap={styleGap} + style:min-height={styleMinHeight} {title} onclick={() => { if (disabled) { diff --git a/src/components/HomeSidebar.svelte b/src/components/HomeSidebar.svelte index d5025e473..f9028ebf5 100644 --- a/src/components/HomeSidebar.svelte +++ b/src/components/HomeSidebar.svelte @@ -57,7 +57,7 @@
-
+
{#if activeTab.type === "inbox"}
{title} @@ -119,9 +120,9 @@
{ if (showFilters) { @@ -156,9 +157,9 @@ {#if showFilters}
- + {#snippet toggle(onclick)} - + {@render icons(status)} {capitalize(status)} {@render counters(status)} @@ -171,7 +172,8 @@ {#snippet item(state)} { changeFilter(state); diff --git a/src/components/IssueStateButton.svelte b/src/components/IssueStateButton.svelte index 62354226e..77970c33e 100644 --- a/src/components/IssueStateButton.svelte +++ b/src/components/IssueStateButton.svelte @@ -49,6 +49,7 @@
{/snippet} @@ -70,6 +71,8 @@ items={actions.filter(a => !isEqual(a.state, issueState))}> {#snippet item(action)} { selectedAction = action; diff --git a/src/components/IssuesSecondColumn.svelte b/src/components/IssuesSecondColumn.svelte index 5b9072aaa..a76bf63d5 100644 --- a/src/components/IssuesSecondColumn.svelte +++ b/src/components/IssuesSecondColumn.svelte @@ -58,7 +58,7 @@
-
+
diff --git a/src/components/NakedButton.svelte b/src/components/NakedButton.svelte index 4dc73438a..75da0a0e9 100644 --- a/src/components/NakedButton.svelte +++ b/src/components/NakedButton.svelte @@ -7,7 +7,7 @@ disabled?: boolean; variant: "primary" | "secondary" | "ghost"; onclick?: (e: MouseEvent) => void; - styleHeight?: string; + styleHeight?: "2rem" | "2.5rem"; stylePadding?: string; active?: boolean; keyShortcuts?: string; diff --git a/src/components/PatchStateButton.svelte b/src/components/PatchStateButton.svelte index 91b64f1bb..2b5126f37 100644 --- a/src/components/PatchStateButton.svelte +++ b/src/components/PatchStateButton.svelte @@ -49,6 +49,7 @@
{/snippet} @@ -71,6 +72,8 @@ items={actions.filter(a => !isEqual(a.state, patchState))}> {#snippet item(action)} { selectedAction = action; diff --git a/src/components/PatchesSecondColumn.svelte b/src/components/PatchesSecondColumn.svelte index 303b220fd..56910aa91 100644 --- a/src/components/PatchesSecondColumn.svelte +++ b/src/components/PatchesSecondColumn.svelte @@ -63,7 +63,7 @@
-
+
diff --git a/src/components/RepoTeaser.svelte b/src/components/RepoTeaser.svelte index 0d7043d50..d25b584d6 100644 --- a/src/components/RepoTeaser.svelte +++ b/src/components/RepoTeaser.svelte @@ -12,7 +12,7 @@
-
+
+ onclick={onNavigateBack}> diff --git a/src/components/Settings.svelte b/src/components/Settings.svelte index 4a0a07c53..6edc88a97 100644 --- a/src/components/Settings.svelte +++ b/src/components/Settings.svelte @@ -10,13 +10,13 @@ interface Props { compact?: boolean; - styleHeight?: string; + styleHeight?: ComponentProps["styleHeight"]; popoverProps: Partial>; } const { compact = true, - styleHeight = "40px", + styleHeight = "2.5rem", popoverProps, }: Props = $props(); diff --git a/src/components/Sidebar.svelte b/src/components/Sidebar.svelte index c8bc87b1b..79f193ea9 100644 --- a/src/components/Sidebar.svelte +++ b/src/components/Sidebar.svelte @@ -21,8 +21,8 @@ cursor: pointer; border: 0; background: none; - height: 40px; - width: 40px; + height: 2.5rem; + width: 2.5rem; clip-path: var(--2px-corner-fill); margin: 0; display: flex; @@ -38,7 +38,7 @@
-
+
{#if activeTab === "issues"} @@ -52,8 +52,8 @@ }); }} variant="ghost" - styleWidth="40px" - styleHeight="40px" + styleWidth="2.5rem" + styleHeight="2.5rem" styleJustifyContent="center"> @@ -82,8 +82,8 @@ }); }} variant="ghost" - styleWidth="40px" - styleHeight="40px" + styleWidth="2.5rem" + styleHeight="2.5rem" styleJustifyContent="center"> @@ -104,7 +104,7 @@
{ if (getLayout()) { diff --git a/src/views/home/Inbox.svelte b/src/views/home/Inbox.svelte index 2a164d3b4..f3d8a896d 100644 --- a/src/views/home/Inbox.svelte +++ b/src/views/home/Inbox.svelte @@ -158,7 +158,7 @@ justify-content: space-between; padding-right: 1.5rem; align-items: center; - min-height: 40px; + min-height: 2.5rem; } diff --git a/src/views/home/Repos.svelte b/src/views/home/Repos.svelte index 8ebe53182..be8c10eac 100644 --- a/src/views/home/Repos.svelte +++ b/src/views/home/Repos.svelte @@ -102,7 +102,7 @@ justify-content: space-between; padding-right: 1.5rem; align-items: center; - min-height: 40px; + min-height: 2.5rem; } @@ -120,7 +120,7 @@ {notificationCount} /> {/snippet}
-
+
Repositories
{#if repos.length > 0}
diff --git a/src/views/repo/CreateIssue.svelte b/src/views/repo/CreateIssue.svelte index 98a76f1a2..fc2ea23e7 100644 --- a/src/views/repo/CreateIssue.svelte +++ b/src/views/repo/CreateIssue.svelte @@ -85,7 +85,11 @@ font-weight: var(--font-weight-medium); -webkit-user-select: text; user-select: text; - margin-top: 0.35rem; + display: flex; + align-items: center; + justify-content: space-between; + word-break: break-word; + min-height: 2.5rem; margin-bottom: 1rem; } .content { diff --git a/src/views/repo/Issue.svelte b/src/views/repo/Issue.svelte index 28776e0b0..e153280a1 100644 --- a/src/views/repo/Issue.svelte +++ b/src/views/repo/Issue.svelte @@ -292,13 +292,13 @@ align-items: center; justify-content: space-between; word-break: break-word; - min-height: 40px; + min-height: 2.5rem; } .status { padding: 0; margin-right: 0.75rem; - height: 2rem; - width: 2rem; + height: 2.5rem; + width: 2.5rem; } .issue-body { margin: 1rem 0; @@ -368,7 +368,7 @@ {/snippet}
-
+
{#if editingTitle}
@@ -96,7 +96,7 @@
Issues
-
+
{#if issues.length > 0} { @@ -126,6 +126,7 @@ {/if}