From f32772ebf11e2ced3e0570735f0df4e6b5781e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C5=ABdolfs=20O=C5=A1i=C5=86=C5=A1?= Date: Tue, 6 May 2025 15:12:45 +0200 Subject: [PATCH] Add New Patch button --- src/components/Command.svelte | 5 +- src/components/NewPatchButton.svelte | 73 ++++++++++++++++++++++++++++ src/views/repo/Issues.svelte | 26 +++++----- src/views/repo/Patch.svelte | 6 ++- src/views/repo/Patches.svelte | 11 +++-- 5 files changed, 100 insertions(+), 21 deletions(-) create mode 100644 src/components/NewPatchButton.svelte diff --git a/src/components/Command.svelte b/src/components/Command.svelte index 472dc5bdb..a58455c95 100644 --- a/src/components/Command.svelte +++ b/src/components/Command.svelte @@ -25,13 +25,16 @@ clipboard.copy()} + styleOverflow="hidden" styleBackgroundColor="var(--color-background-float)" styleCursor="pointer" styleJustifyContent="space-between" stylePadding="0.25rem 0.5rem" {styleWidth} variant="ghost"> - $ {command} + + $ {command} + diff --git a/src/components/NewPatchButton.svelte b/src/components/NewPatchButton.svelte new file mode 100644 index 000000000..c6629840e --- /dev/null +++ b/src/components/NewPatchButton.svelte @@ -0,0 +1,73 @@ + + + + {#snippet toggle(onclick)} + {#if outline} + + New patch + + {:else} + + {/if} + {/snippet} + + {#snippet popover()} +
+ +
+
+ Create a new patch +
+
+ Create a new branch in your working copy, commit your changes, and + run: + +
+
+ +
+
+ Don't have a working copy yet? +
+
+ To checkout a working copy of this repo, run: + +
+
+
+
+ {/snippet} +
diff --git a/src/views/repo/Issues.svelte b/src/views/repo/Issues.svelte index 8b2206968..ec9d994d7 100644 --- a/src/views/repo/Issues.svelte +++ b/src/views/repo/Issues.svelte @@ -126,20 +126,18 @@ {/snippet} {/if} -
- -
+ diff --git a/src/views/repo/Patch.svelte b/src/views/repo/Patch.svelte index 01c9c857e..97b21c11a 100644 --- a/src/views/repo/Patch.svelte +++ b/src/views/repo/Patch.svelte @@ -33,11 +33,13 @@ import CopyableId from "@app/components/CopyableId.svelte"; import DropdownList from "@app/components/DropdownList.svelte"; import DropdownListItem from "@app/components/DropdownListItem.svelte"; + import EditableTitle from "@app/components/EditableTitle.svelte"; import Icon from "@app/components/Icon.svelte"; import LabelInput from "@app/components/LabelInput.svelte"; import Layout from "./Layout.svelte"; import Link from "@app/components/Link.svelte"; import NakedButton from "@app/components/NakedButton.svelte"; + import NewPatchButton from "@app/components/NewPatchButton.svelte"; import OutlineButton from "@app/components/OutlineButton.svelte"; import PatchStateButton from "@app/components/PatchStateButton.svelte"; import PatchTeaser from "@app/components/PatchTeaser.svelte"; @@ -50,7 +52,6 @@ import Sidebar from "@app/components/Sidebar.svelte"; import Tab from "@app/components/Tab.svelte"; import TextInput from "@app/components/TextInput.svelte"; - import EditableTitle from "@app/components/EditableTitle.svelte"; interface Props { repo: RepoInfo; @@ -389,7 +390,7 @@ Patches -
+
+
{#if showFilters} diff --git a/src/views/repo/Patches.svelte b/src/views/repo/Patches.svelte index 61dd05979..dd3e5b182 100644 --- a/src/views/repo/Patches.svelte +++ b/src/views/repo/Patches.svelte @@ -16,6 +16,7 @@ import CopyableId from "@app/components/CopyableId.svelte"; import Icon from "@app/components/Icon.svelte"; import Layout from "./Layout.svelte"; + import NewPatchButton from "@app/components/NewPatchButton.svelte"; import PatchTeaser from "@app/components/PatchTeaser.svelte"; import PatchesSecondColumn from "@app/components/PatchesSecondColumn.svelte"; import TextInput from "@app/components/TextInput.svelte"; @@ -112,6 +113,7 @@ align-items: center; min-height: 2.5rem; margin-bottom: 1rem; + gap: 0.75rem; } @@ -132,8 +134,8 @@
Patches - {#if items.length > 0} -
+
+ {#if items.length > 0} { try { @@ -171,8 +173,9 @@
{/snippet} -
- {/if} + {/if} + +