From 64cec294cff36a473b62f988d1fe42045650be9f Mon Sep 17 00:00:00 2001 From: Scott Chacon Date: Wed, 2 Aug 2023 13:38:41 +0200 Subject: [PATCH 1/5] =?UTF-8?q?add=20some=20descriptions=20of=20stuff=20wh?= =?UTF-8?q?en=20there=20isn=E2=80=99t=20much=20to=20show?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/repo/[projectId]/+page.svelte | 4 +--- src/routes/repo/[projectId]/Board.svelte | 29 +++++++++++++++++++++++- src/routes/repo/[projectId]/Tray.svelte | 21 +++++++++++++---- 3 files changed, 45 insertions(+), 9 deletions(-) diff --git a/src/routes/repo/[projectId]/+page.svelte b/src/routes/repo/[projectId]/+page.svelte index 980779f8e..d9ef26dbc 100644 --- a/src/routes/repo/[projectId]/+page.svelte +++ b/src/routes/repo/[projectId]/+page.svelte @@ -136,9 +136,7 @@

This works by specifying a "base branch" that represents the state of production, normally - something like "origin/master". All of your virtual branches are based off of this branch - and need to be kept up to date with this branch to ensure they are working with the latest - code. + something like "origin/master".

Ownership, Committing and Pushing

diff --git a/src/routes/repo/[projectId]/Board.svelte b/src/routes/repo/[projectId]/Board.svelte index d5509295b..715a2531e 100644 --- a/src/routes/repo/[projectId]/Board.svelte +++ b/src/routes/repo/[projectId]/Board.svelte @@ -7,6 +7,7 @@ import { getContext } from 'svelte'; import { BRANCH_CONTROLLER_KEY } from '$lib/vbranches/branchController'; import type { CloudApi } from '$lib/api'; + import { Link } from '$lib/components'; export let projectId: string; export let projectPath: string; @@ -93,5 +94,31 @@ {upstream} /> {/each} - + + {#if branches.length == 0} +

+
+

You are up to date

+

+ This means that your working directory looks exactly like your base branch. There isn't + anything locally that is not in your production code. +

+

+ If you start editing files in your working directory, a new virtual branch will + automatically be created and you can manage it here. +

+ + Learn more + +
+
+ {:else} + + {/if} diff --git a/src/routes/repo/[projectId]/Tray.svelte b/src/routes/repo/[projectId]/Tray.svelte index ad8a4fd84..7924f9cc9 100644 --- a/src/routes/repo/[projectId]/Tray.svelte +++ b/src/routes/repo/[projectId]/Tray.svelte @@ -1,5 +1,5 @@ + + + + + + + + + + + + + + + + diff --git a/src/lib/icons/IconNewBadge.svelte b/src/lib/icons/IconNewBadge.svelte new file mode 100644 index 000000000..31d48aac2 --- /dev/null +++ b/src/lib/icons/IconNewBadge.svelte @@ -0,0 +1,86 @@ + + + + + + + + + + + + diff --git a/src/routes/repo/[projectId]/BranchLane.svelte b/src/routes/repo/[projectId]/BranchLane.svelte index b1beab20b..c101e4ca4 100644 --- a/src/routes/repo/[projectId]/BranchLane.svelte +++ b/src/routes/repo/[projectId]/BranchLane.svelte @@ -20,6 +20,7 @@ import { invoke } from '@tauri-apps/api/tauri'; import type { CloudApi } from '$lib/api'; import Scrollbar from '$lib/components/Scrollbar.svelte'; + import IconNewBadge from '$lib/icons/IconNewBadge.svelte'; const [send, receive] = crossfade({ duration: (d) => Math.sqrt(d * 200), @@ -378,13 +379,26 @@ {/if} {#if files.length == 0} - -
- No uncomitted changes -
+ {#if commits.length == 0} +
+

Nothing on this branch yet.

+ +

+ Get some work done, then throw some files my way! +

+
+ {:else} + +
+ No uncommitted changes +
+ {/if} {/if} {#if localCommits.length > 0 || remoteCommits.length > 0} diff --git a/src/routes/repo/[projectId]/Tray.svelte b/src/routes/repo/[projectId]/Tray.svelte index 7924f9cc9..703b1c59e 100644 --- a/src/routes/repo/[projectId]/Tray.svelte +++ b/src/routes/repo/[projectId]/Tray.svelte @@ -13,6 +13,7 @@ import { BRANCH_CONTROLLER_KEY } from '$lib/vbranches/branchController'; import Tooltip from '$lib/components/Tooltip/Tooltip.svelte'; import Scrollbar from '$lib/components/Scrollbar.svelte'; + import IconMeatballMenu from '$lib/icons/IconMeatballMenu.svelte'; export let branches: Branch[]; export let remoteBranches: BranchData[]; @@ -117,34 +118,43 @@ class="border-b border-light-400 p-2 dark:border-dark-600" >
-
+
toggleBranch(branch)} bind:checked={branch.active} disabled={!(branch.mergeable || !branch.baseCurrent) || branch.conflicted} /> + {#if !branch.active} +
+ {#if !branch.baseCurrent} + + +
+
+ {:else if branch.mergeable} + +
+
+ {:else} + +
+
+ {/if} +
+ {/if}
{branch.name}
- {#if !branch.active} - {#if !branch.baseCurrent} - - -
-
- {:else if branch.mergeable} - -
-
- {:else} - -
-
- {/if} - {/if} +
diff --git a/src/routes/repo/[projectId]/UpstreamBranchLane.svelte b/src/routes/repo/[projectId]/UpstreamBranchLane.svelte index e3538d40d..87536efeb 100644 --- a/src/routes/repo/[projectId]/UpstreamBranchLane.svelte +++ b/src/routes/repo/[projectId]/UpstreamBranchLane.svelte @@ -20,6 +20,7 @@ const branchController = getContext(BRANCH_CONTROLLER_KEY); $: expanded = base.behind > 0; + $: multiple = base.upstreamCommits.length > 1;
-
+
- +
-
-
{formatDistanceToNow(branch.lastCommitTs * 1000)}
+
+
+ {formatDistanceToNow(branch.lastCommitTs * 1000)} +
+
+ +
{branch.ahead}/{branch.behind}
+
+ {#if !branch.mergeable} +
!
+ {/if} +
{#each branch.authors as author} - Update target -

You are about to update the base branch.

+ Merge Upstream Work +
+

You are about to merge upstream work from your base branch.

+

What will this do?

+

+ We will try to merge the work that is upstream into each of your virtual branches, so that + they are all up to date. +

+

+ Any virtual branches that we can't merge cleanly, we will unapply and mark with a blue dot. + You can merge these manually later. +

+

Any virtual branches that are fully integrated upstream will be automatically removed.

+
diff --git a/tailwind.config.cjs b/tailwind.config.cjs index 5df72764e..f42f3798a 100644 --- a/tailwind.config.cjs +++ b/tailwind.config.cjs @@ -102,9 +102,16 @@ const config = { 900: '#1e3a8a' }, yellow: { - 400: '#facc15', - 500: '#eab308', - 900: '#713f12' + 50: '#FFFBE6', + 100: '#FFF7CC', + 200: '#FEF0A2', + 300: '#FDE978', + 400: '#FACC15', + 500: '#EAB308', + 600: '#C19206', + 700: '#987105', + 800: '#6F5004', + 900: '#713F12', }, red: { 400: '#F87171', From 43a44dbfa6c326616beffc0bee9267df7711298e Mon Sep 17 00:00:00 2001 From: Scott Chacon Date: Thu, 3 Aug 2023 08:24:20 +0200 Subject: [PATCH 4/5] cheating --- src/routes/repo/[projectId]/Tray.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/repo/[projectId]/Tray.svelte b/src/routes/repo/[projectId]/Tray.svelte index 67327cac9..8ee2a1e8b 100644 --- a/src/routes/repo/[projectId]/Tray.svelte +++ b/src/routes/repo/[projectId]/Tray.svelte @@ -119,13 +119,13 @@ class="border-b border-light-400 p-2 dark:border-dark-600" >
-
+
toggleBranch(branch)} bind:checked={branch.active} disabled={!(branch.mergeable || !branch.baseCurrent) || branch.conflicted} /> -
+
{branch.name}
From 0078eeac5d9324f187ac4fdce622f27e041d18b4 Mon Sep 17 00:00:00 2001 From: Scott Chacon Date: Thu, 3 Aug 2023 08:40:06 +0200 Subject: [PATCH 5/5] take out the keydown events --- src/routes/repo/[projectId]/Tray.svelte | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/routes/repo/[projectId]/Tray.svelte b/src/routes/repo/[projectId]/Tray.svelte index b0fc3efa3..9a3f5ba07 100644 --- a/src/routes/repo/[projectId]/Tray.svelte +++ b/src/routes/repo/[projectId]/Tray.svelte @@ -9,7 +9,8 @@ import PopupMenuItem from '$lib/components/PopupMenu/PopupMenuItem.svelte'; import { SETTINGS_CONTEXT, type SettingsStore } from '$lib/userSettings'; import { getContext } from 'svelte'; - import { BRANCH_CONTROLLER_KEY, BranchController } from '$lib/vbranches/branchController'; + import type { BranchController } from '$lib/vbranches/branchController'; + import { BRANCH_CONTROLLER_KEY } from '$lib/vbranches/branchController'; import Tooltip from '$lib/components/Tooltip/Tooltip.svelte'; import Scrollbar from '$lib/components/Scrollbar.svelte'; import IconMeatballMenu from '$lib/icons/IconMeatballMenu.svelte'; @@ -130,7 +131,6 @@