From ed44bb8ff80d2d149c4d1b03e0b5242a60a1147b Mon Sep 17 00:00:00 2001 From: Kiril Videlov Date: Thu, 20 Jul 2023 19:42:05 +0200 Subject: [PATCH] commit list cleanup --- src/lib/components/Link/Link.svelte | 22 +++- src/routes/+layout.svelte | 2 +- src/routes/repo/[projectId]/+page.svelte | 6 +- src/routes/repo/[projectId]/Board.svelte | 6 +- .../repo/[projectId]/BottomPanel.svelte | 41 ++++++ src/routes/repo/[projectId]/BranchLane.svelte | 121 +++++++++--------- 6 files changed, 131 insertions(+), 67 deletions(-) create mode 100644 src/routes/repo/[projectId]/BottomPanel.svelte diff --git a/src/lib/components/Link/Link.svelte b/src/lib/components/Link/Link.svelte index 524c25408..bd054921c 100644 --- a/src/lib/components/Link/Link.svelte +++ b/src/lib/components/Link/Link.svelte @@ -17,9 +17,21 @@ $: isExternal = href?.startsWith('http'); - - - {#if isExternal} - - {/if} + +
+ +
+
+ {#if isExternal} + + {/if} +
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 78bd0d881..ccf02f54e 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -129,7 +129,7 @@ border-light-300 bg-white text-light-900 dark:border-dark-500 dark:bg-dark-900 d {:else}
- Offline + Offline {/if} {/if} diff --git a/src/routes/repo/[projectId]/+page.svelte b/src/routes/repo/[projectId]/+page.svelte index 8800a06e6..35f36e60d 100644 --- a/src/routes/repo/[projectId]/+page.svelte +++ b/src/routes/repo/[projectId]/+page.svelte @@ -8,6 +8,7 @@ import { getContext, setContext } from 'svelte'; import { BRANCH_CONTROLLER_KEY } from '$lib/vbranches/branchController'; import { SETTINGS_CONTEXT, type SettingsStore } from '$lib/userSettings'; + import BottomPanel from './BottomPanel.svelte'; export let data: PageData; let { @@ -57,7 +58,10 @@ })); }} /> - +
+ + +
{:else}
diff --git a/src/routes/repo/[projectId]/Board.svelte b/src/routes/repo/[projectId]/Board.svelte index cbd3826c5..1dd4da8ab 100644 --- a/src/routes/repo/[projectId]/Board.svelte +++ b/src/routes/repo/[projectId]/Board.svelte @@ -1,7 +1,7 @@ + +
+
+
(shown = !shown)} + on:keypress={() => (shown = !shown)} + > + {#if shown} + + {:else} + + {/if} + Common base +
+ {#if shown} +
+
+
We're no strangers to love You know the rules and so do I
+
+ A full commitment's what I'm thinking of You wouldn't get this from any other guy +
+
I just wanna tell you how I'm feeling Gotta make you understand
+
Never gonna give you up
+
Never gonna let you down
+
Never gonna run around and desert you
+
Never gonna make you cry
+
Never gonna say goodbye
+
Never gonna tell a lie and hurt you
+
+
+ {/if} +
+
diff --git a/src/routes/repo/[projectId]/BranchLane.svelte b/src/routes/repo/[projectId]/BranchLane.svelte index 248b152af..bc1e7a5bd 100644 --- a/src/routes/repo/[projectId]/BranchLane.svelte +++ b/src/routes/repo/[projectId]/BranchLane.svelte @@ -3,7 +3,7 @@ import { getContext, onMount } from 'svelte'; import FileCard from './FileCard.svelte'; import { IconBranch } from '$lib/icons'; - import { Button } from '$lib/components'; + import { Button, Link } from '$lib/components'; import IconMeatballMenu from '$lib/icons/IconMeatballMenu.svelte'; import CommitCard from './CommitCard.svelte'; import IconGithub from '$lib/icons/IconGithub.svelte'; @@ -11,7 +11,7 @@ import PopupMenu from '../../../lib/components/PopupMenu/PopupMenu.svelte'; import PopupMenuItem from '../../../lib/components/PopupMenu/PopupMenuItem.svelte'; import { dzHighlight } from './dropZone'; - import type { BranchController } from '$lib/vbranches'; + import type { BranchController, Target } from '$lib/vbranches'; import { BRANCH_CONTROLLER_KEY } from '$lib/vbranches/branchController'; import FileCardNext from './FileCardNext.svelte'; @@ -25,6 +25,7 @@ export let projectId: string; export let order: number; export let conflicted: boolean; + export let target: Target; const branchController = getContext(BRANCH_CONTROLLER_KEY); @@ -90,13 +91,30 @@ console.log('branch name change:', name); branchController.updateBranchName(branchId, name); } + + function nameToBranch(name: string): string { + const isAsciiAlphanumeric = (c: string): boolean => /^[A-Za-z0-9]$/.test(c); + return name + .split('') + .map((c) => (isAsciiAlphanumeric(c) ? c : '-')) + .join(''); + } + + function url(target: Target, branchName: string) { + const baseBranchName = target.branchName.split('/')[1]; + const repoBaseUrl = target.remoteUrl + .replace(':', '/') + .replace('git@', 'https://') + .replace('.git', ''); + return `${repoBaseUrl}/compare/${baseBranchName}...${branchName}`; + }
+ {#if localCommits.length > 0} + + {/if}
- {#if localCommits.length > 0} -
- +
+
-
-
-
- {#if localCommits.length > 0} - - {/if} -
-
- - {#each localCommits as commit (commit.id)} -
-
- +
+
+ {#each commits.filter((c) => !c.isRemote) as commit (commit.id)} +
+
+
+
+ +
+
+ {/each} + {#if remoteCommits.length > 0} +
+ + + {target.remoteName}/{nameToBranch(name)} + + +
+ {/if} + {#each commits.filter((c) => c.isRemote) as commit (commit.id)} +
+
+
@@ -271,34 +305,5 @@
{/each}
- {/if} - {#if remoteCommits.length > 0} -
- -
- -
-
-
- - -
-
-
Pushed to {upstream}
-
- {#each remoteCommits as commit (commit.id)} -
-
- -
-
- -
- {/each} -
- {/if} +