From 6fb83315a6e7fcb1c82633f39f0a7bb74ac63af6 Mon Sep 17 00:00:00 2001 From: Mattias Granlund Date: Fri, 17 Nov 2023 15:09:37 +0100 Subject: [PATCH] Moving a bit towards Pavel's unfinished nav design --- packages/ui/src/lib/components/Button.svelte | 4 +- packages/ui/src/lib/components/Tooltip.svelte | 2 +- .../navigation/BaseBranchCard.svelte | 125 +++++++++--------- .../navigation/DomainButton.svelte | 3 +- .../[projectId]/navigation/Navigation.svelte | 8 +- .../navigation/ProjectSelector.svelte | 34 +++++ packages/ui/src/routes/user/+page.svelte | 2 +- packages/ui/src/styles/main.postcss | 4 +- packages/ui/tailwind.config.cjs | 2 +- 9 files changed, 111 insertions(+), 73 deletions(-) create mode 100644 packages/ui/src/routes/[projectId]/navigation/ProjectSelector.svelte diff --git a/packages/ui/src/lib/components/Button.svelte b/packages/ui/src/lib/components/Button.svelte index b4160b1f5..995f2e0d0 100644 --- a/packages/ui/src/lib/components/Button.svelte +++ b/packages/ui/src/lib/components/Button.svelte @@ -27,7 +27,7 @@ + {/if} + { + fetching = true; + await branchController.fetchFromTarget().finally(() => (fetching = false)); + prService.reload(); + }} + > +
+
- -
-
- {#if $base$?.remoteUrl.includes('github.com')} - - {:else} - - {/if} - {$base$?.branchName} -
-
- - {#if $base$?.fetchedAt} - - {/if} - -
-
+
+ +
+ + {#if $base$?.fetchedAt} + + {/if} +
- diff --git a/packages/ui/src/routes/[projectId]/navigation/DomainButton.svelte b/packages/ui/src/routes/[projectId]/navigation/DomainButton.svelte index f885a4dda..759e460ee 100644 --- a/packages/ui/src/routes/[projectId]/navigation/DomainButton.svelte +++ b/packages/ui/src/routes/[projectId]/navigation/DomainButton.svelte @@ -8,9 +8,8 @@ diff --git a/packages/ui/src/routes/[projectId]/navigation/Navigation.svelte b/packages/ui/src/routes/[projectId]/navigation/Navigation.svelte index f63e9e927..b4c8f95dd 100644 --- a/packages/ui/src/routes/[projectId]/navigation/Navigation.svelte +++ b/packages/ui/src/routes/[projectId]/navigation/Navigation.svelte @@ -19,6 +19,7 @@ import type { PrService } from '$lib/github/pullrequest'; import type { BaseBranchService, VirtualBranchService } from '$lib/vbranches/branchStoresCache'; import type { RemoteBranchService } from '$lib/stores/remoteBranches'; + import ProjectSelector from './ProjectSelector.svelte'; export let vbranchService: VirtualBranchService; export let remoteBranchService: RemoteBranchService; @@ -42,11 +43,14 @@ role="menu" tabindex="0" > -
+
- + +
+
+
Active branches diff --git a/packages/ui/src/routes/[projectId]/navigation/ProjectSelector.svelte b/packages/ui/src/routes/[projectId]/navigation/ProjectSelector.svelte new file mode 100644 index 000000000..4f29656e3 --- /dev/null +++ b/packages/ui/src/routes/[projectId]/navigation/ProjectSelector.svelte @@ -0,0 +1,34 @@ + + +
+
+ {project.title} +
+
+ { + popup.show(); + e.preventDefault(); + }} + /> +
+
+ diff --git a/packages/ui/src/routes/user/+page.svelte b/packages/ui/src/routes/user/+page.svelte index 5868a1476..0e30c8d84 100644 --- a/packages/ui/src/routes/user/+page.svelte +++ b/packages/ui/src/routes/user/+page.svelte @@ -167,7 +167,7 @@ class="flex h-full flex-shrink flex-grow flex-col pb-4" style:background-color="var(--bg-surface)" > -
+