detect newer version tags for pinned images and show them as a badge with release notes
This commit is contained in:
17 files changed
+529
-144
No files matched your search
@@ -0,0 +1,48 @@
|
||||
<script lang="ts">
|
||||
import { Button } from '$lib/components/ui/button';
|
||||
import { CircleArrowUp, Tag } from 'lucide-svelte';
|
||||
import { scale } from 'svelte/transition';
|
||||
import { backOut } from 'svelte/easing';
|
||||
|
||||
interface Props {
|
||||
/** Whether any update indicator is present (digest, newer-version, or failed check). */
|
||||
show: boolean;
|
||||
/** Number of items with a digest update - shows the up-arrow icon + count. */
|
||||
digestCount: number;
|
||||
/** Number of items with a newer-version tag - shows the tag icon + count. */
|
||||
newerVersionCount: number;
|
||||
onDismiss: () => void;
|
||||
}
|
||||
|
||||
let { show, digestCount, newerVersionCount, onDismiss }: Props = $props();
|
||||
</script>
|
||||
|
||||
{#if show}
|
||||
<div transition:scale={{ duration: 220, start: 0.85, opacity: 0, easing: backOut }} class="flex">
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
onclick={onDismiss}
|
||||
class="gap-1.5 border-amber-500/40 text-amber-600 hover:bg-amber-500/10 hover:border-amber-500"
|
||||
title="Dismiss all update indicators"
|
||||
>
|
||||
{#if digestCount > 0}
|
||||
<span class="flex items-center gap-0.5">
|
||||
<CircleArrowUp class="w-3.5 h-3.5" />
|
||||
<span class="text-xs font-medium tabular-nums">{digestCount}</span>
|
||||
</span>
|
||||
{/if}
|
||||
{#if newerVersionCount > 0}
|
||||
<span class="flex items-center gap-0.5">
|
||||
<Tag class="w-2.5 h-2.5" />
|
||||
<span class="text-xs font-medium tabular-nums">{newerVersionCount}</span>
|
||||
</span>
|
||||
{/if}
|
||||
{#if digestCount === 0 && newerVersionCount === 0}
|
||||
<!-- only failed checks remain - fall back to the update icon -->
|
||||
<CircleArrowUp class="w-3.5 h-3.5" />
|
||||
{/if}
|
||||
<span class="text-base leading-none opacity-50">×</span>
|
||||
</Button>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -118,7 +118,7 @@
|
||||
{#if enabled && !isFloating}
|
||||
<div class="ml-6 flex items-start gap-2 rounded-md bg-muted/50 p-2 text-xs text-muted-foreground">
|
||||
<Info class="w-3.5 h-3.5 mt-0.5 shrink-0" />
|
||||
<span>A newer version shows as a badge on the container — it is <strong class="text-foreground font-semibold">never auto-applied</strong>. Bump the tag in your compose yourself.</span>
|
||||
<span>A newer version shows as a badge on the container — it is <strong class="text-foreground font-semibold">never auto-applied</strong>.</span>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user