From ca3e4c2f72cceaa72ee3864e57c6e075f6bb406c Mon Sep 17 00:00:00 2001 From: Mattias Granlund Date: Wed, 13 Sep 2023 21:22:45 +0200 Subject: [PATCH] Create new utility classes for border color - the colors need a bit of adjusting still, but commit is getting big - doesn't seem like we need 4 border colors, but leaving in for now --- .../src/routes/repo/[projectId]/+page.svelte | 20 ++++----- .../repo/[projectId]/BaseBranchPeek.svelte | 2 +- .../routes/repo/[projectId]/BranchLane.svelte | 34 +++++--------- .../[projectId]/BranchLanePopupMenu.svelte | 2 +- .../routes/repo/[projectId]/CommitCard.svelte | 16 +++---- .../repo/[projectId]/CommitDialog.svelte | 9 ++-- .../routes/repo/[projectId]/FileCard.svelte | 10 ++--- .../routes/repo/[projectId]/FileTree.svelte | 8 ++-- .../repo/[projectId]/NewBranchDropZone.svelte | 8 +--- .../repo/[projectId]/NotesTabPanel.svelte | 2 +- .../routes/repo/[projectId]/PeekTray.svelte | 4 +- .../repo/[projectId]/RemoteBranchPeek.svelte | 2 +- .../repo/[projectId]/RenderedLine.svelte | 4 +- .../src/routes/repo/[projectId]/Tabs.svelte | 4 +- .../src/routes/repo/[projectId]/Tray.svelte | 16 ++++--- packages/ui/src/styles/main.postcss | 44 ++++++++++++++++++- 16 files changed, 102 insertions(+), 83 deletions(-) diff --git a/packages/ui/src/routes/repo/[projectId]/+page.svelte b/packages/ui/src/routes/repo/[projectId]/+page.svelte index a75327199..c25a0108c 100644 --- a/packages/ui/src/routes/repo/[projectId]/+page.svelte +++ b/packages/ui/src/routes/repo/[projectId]/+page.svelte @@ -167,7 +167,7 @@ {:else} -
+
{#if $vbrachesState.error.code === Code.InvalidHead}

@@ -207,13 +207,13 @@ class="bg-color-2 flex h-full flex-col justify-center gap-y-4 self-center p-12 text-lg" >
Set your Base Branch
-

+

You need to set your base branch before you can start working on your project.

{#if remoteBranchNames.length === 0}

You don't have any remote branches.

-

+

Currently, GitButler requires a remote branch to base it's virtual branch work on. To use virtual branches, please push your code to a remote branch to use as a base. -

+

This is the branch that you consider "production", normally something like "origin/master" or "origin/main".

@@ -249,32 +249,32 @@

Getting Started with Virtual Branches

-

+

Virtual branches are just like normal Git branches, except that you can work on several of them at the same time.

Base Branch
-

+

With virtual branches, you are not working off of local main or master branches. Everything that you do is on a virtual branch, automatically.

-

+

This works by specifying a "base branch" that represents the state of production, normally something like "origin/master".

Ownership, Committing and Pushing
-

+

Each virtual branch "owns" parts of the files that are seen as changed. If you commit on that branch, only the parts that are owned by that branch are actually recorded in the commits on that branch.

-

+

When you push a virtual branch, it will create a branch name based on your branch title, push that branch to your remote with just the changes committed to that branch, not everything in your working directory.

Applying and Unapplying
-

+

You can have many virtual branches applied at the same time, but they cannot conflict with each other currently. Unapplying a virtual branch will take all of the changes that it owns and remove them from your working directory. Applying the branch will add those diff --git a/packages/ui/src/routes/repo/[projectId]/BaseBranchPeek.svelte b/packages/ui/src/routes/repo/[projectId]/BaseBranchPeek.svelte index 4d9e32140..7ed8c0fca 100644 --- a/packages/ui/src/routes/repo/[projectId]/BaseBranchPeek.svelte +++ b/packages/ui/src/routes/repo/[projectId]/BaseBranchPeek.svelte @@ -23,7 +23,7 @@

Upstream

diff --git a/packages/ui/src/routes/repo/[projectId]/BranchLane.svelte b/packages/ui/src/routes/repo/[projectId]/BranchLane.svelte index 2ff554274..02a0a0133 100644 --- a/packages/ui/src/routes/repo/[projectId]/BranchLane.svelte +++ b/packages/ui/src/routes/repo/[projectId]/BranchLane.svelte @@ -192,10 +192,10 @@ >
-
+
{#if !branch.mergeable}
@@ -227,7 +227,7 @@ bind:value={branch.name} on:change={handleBranchNameChange} title={branch.name} - class="w-full truncate rounded border border-transparent bg-transparent px-1 font-mono font-bold hover:border-light-400 dark:hover:border-dark-600" + class="text-color-3 hover:text-color-2 focus:text-color-2 hover:border-color-4 w-full truncate rounded border border-transparent bg-transparent px-1 font-mono font-bold" on:dblclick|stopPropagation on:click={(e) => e.currentTarget.select()} /> @@ -373,30 +373,25 @@ {#if branch.files.length == 0} {#if branch.commits.length == 0}

Nothing on this branch yet.

{#if !readonly} - +

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

{/if}
{:else} -
+
No uncommitted changes on this branch
{/if} {/if}
{#if localCommits.length > 0 || remoteCommits.length > 0} -
+
{#if localCommits.length > 0}
@@ -439,9 +434,7 @@ animate:flip >
-
+
0}
@@ -574,10 +566,4 @@ :global(.lane-dz-hover .hover-text) { @apply visible; } - :global(.lane-dz-hover .lane-dz-marker) { - @apply text-light-700 outline-light-600; - } - :global(.dark .lane-dz-hover .lane-dz-marker) { - @apply text-dark-100 outline-dark-200; - } diff --git a/packages/ui/src/routes/repo/[projectId]/BranchLanePopupMenu.svelte b/packages/ui/src/routes/repo/[projectId]/BranchLanePopupMenu.svelte index bbf5aae00..7e2abe4b0 100644 --- a/packages/ui/src/routes/repo/[projectId]/BranchLanePopupMenu.svelte +++ b/packages/ui/src/routes/repo/[projectId]/BranchLanePopupMenu.svelte @@ -38,7 +38,7 @@ >
-
+
branchController.createBranch({ order })}> diff --git a/packages/ui/src/routes/repo/[projectId]/CommitCard.svelte b/packages/ui/src/routes/repo/[projectId]/CommitCard.svelte index c5813c25f..1b00c06da 100644 --- a/packages/ui/src/routes/repo/[projectId]/CommitCard.svelte +++ b/packages/ui/src/routes/repo/[projectId]/CommitCard.svelte @@ -52,9 +52,7 @@ } -
+
{#if url} @@ -123,10 +121,8 @@
{#each sections as section} {#if 'hunk' in section} -
-
+
+
{#each section.subSections as subsection, sidx} {#each subsection.lines.slice(0, subsection.expanded ? subsection.lines.length : 0) as line} 0 && sidx < section.subSections.length - 1)} class:border-b={sidx == 0 || (sidx > 0 && sidx < section.subSections.length - 1)} >
-
+
{/if} {/each} diff --git a/packages/ui/src/routes/repo/[projectId]/CommitDialog.svelte b/packages/ui/src/routes/repo/[projectId]/CommitDialog.svelte index 4b64794fd..7e0c99566 100644 --- a/packages/ui/src/routes/repo/[projectId]/CommitDialog.svelte +++ b/packages/ui/src/routes/repo/[projectId]/CommitDialog.svelte @@ -85,10 +85,7 @@ } -
+
{#if annotateCommits}
GitButler will be the committer of this commit. @@ -104,7 +101,7 @@