From fe2c7be05501062c4e673a8bd3f05428b84fb4c7 Mon Sep 17 00:00:00 2001 From: Caleb Owens Date: Tue, 19 Nov 2024 21:37:35 +0100 Subject: [PATCH] Update upstream integration UI component --- .../ui/src/lib/IntegrationSeriesRow.svelte | 119 ++++++++++++------ 1 file changed, 81 insertions(+), 38 deletions(-) diff --git a/packages/ui/src/lib/IntegrationSeriesRow.svelte b/packages/ui/src/lib/IntegrationSeriesRow.svelte index 6a61f216ca..3ce96b7606 100644 --- a/packages/ui/src/lib/IntegrationSeriesRow.svelte +++ b/packages/ui/src/lib/IntegrationSeriesRow.svelte @@ -18,6 +18,8 @@ import Icon from './Icon.svelte'; import SeriesIcon from './SeriesIcon.svelte'; let { series, select }: Props = $props(); + + const allIntegrated = $derived(series.every((branch) => branch.status === 'integrated')); {#snippet stackBranch({ name, status }: Branch, isLast: boolean)} @@ -47,32 +49,58 @@ {/snippet}
-
-
- + {#if series.length > 1} +
+
+ - {#if series.length > 1} Stack branches - {:else} - - {series[0].name} - +
+ + {#if select && !allIntegrated} +
+ {@render select()} +
{/if}
- {#if select} -
- {@render select()} -
- {/if} -
- - {#if series.length > 1}
{#each series as seriesItem, idx} {@render stackBranch(seriesItem, idx === series.length - 1)} {/each}
+ {:else if series.length === 1} + {@const branch = series[0]} +
+
+ + + + {branch.name} + + {#if branch.status} + + {#if branch.status === 'conflicted'} + Conflicted + {:else if branch.status === 'integrated'} + Integrated + {/if} + + {/if} +
+ + {#if select && branch.status !== 'integrated'} +
+ {@render select()} +
+ {/if} + {#if branch.status === 'integrated'} +
+ + Part of the new base +
+ {/if} +
{/if}
@@ -92,6 +120,22 @@ gap: 12px; padding: 12px 12px 12px 14px; min-height: 56px; + + &.conflicted { + .status-badge { + background-color: var(--clr-theme-warn-on-element); + background-color: var(--clr-theme-warn-element); + } + } + + &.integrated { + background-color: var(--clr-bg-1-muted); + + .status-badge { + color: var(--clr-theme-purp-on-element); + background-color: var(--clr-theme-purp-element); + } + } } .series-label { @@ -123,6 +167,27 @@ margin-top: -10px; } + .status-badge { + padding: 4px 6px 3px; + height: 100%; + border-radius: var(--radius-m); + color: var(--clr-core-ntrl-100); + } + + /* INTEGRATED LABEL */ + .integrated-label-wrap { + display: flex; + align-items: center; + gap: 4px; + padding-left: 6px; + margin-right: 2px; + color: var(--clr-text-2); + } + + .integrated-label { + white-space: nowrap; + } + .series-branch { display: flex; align-items: center; @@ -136,14 +201,6 @@ overflow: hidden; flex: 1; } - - .status-badge { - padding: 4px 6px 3px; - height: 100%; - border-radius: var(--radius-m); - color: var(--clr-core-ntrl-100); - } - &.conflicted { .status-badge { background-color: var(--clr-theme-warn-on-element); @@ -160,20 +217,6 @@ } } - /* INTEGRATED LABEL */ - .integrated-label-wrap { - display: flex; - align-items: center; - gap: 4px; - padding-left: 6px; - margin-right: 2px; - color: var(--clr-text-2); - } - - .integrated-label { - white-space: nowrap; - } - /* NESTING LINES */ .structure-lines { position: relative;