From 5bd4fa594d9bcd91cad7b7cd5eeb9bfce57aa3da Mon Sep 17 00:00:00 2001 From: Donkie Date: Sun, 19 Jul 2026 10:18:26 +0200 Subject: [PATCH] client_v2: don't link a missing manufacturer in the breadcrumbs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A filament with no vendor resolved through inventory.vendorOf(), whose placeholder shows as "?" — rendered as a clickable crumb leading to a broken vendor page. The inspectors now resolve the vendor directly and fall back to a muted, non-navigable "No manufacturer" crumb, and drop the "?" from the filament subtitle and spool title as well. Claude-Session: https://claude.ai/code/session_014Cwk5Yyze9yPvkYkUtMAP4 --- client_v2/src/lib/components/Breadcrumbs.svelte | 11 ++++++++++- .../lib/components/library/FilamentInspector.svelte | 13 ++++++++++--- .../lib/components/library/SpoolInspector.svelte | 10 +++++++--- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/client_v2/src/lib/components/Breadcrumbs.svelte b/client_v2/src/lib/components/Breadcrumbs.svelte index d7094963..ea050d83 100644 --- a/client_v2/src/lib/components/Breadcrumbs.svelte +++ b/client_v2/src/lib/components/Breadcrumbs.svelte @@ -1,10 +1,13 @@ @@ -14,6 +17,8 @@ {#if i > 0}{/if} {#if c.onclick} + {:else if c.muted} + {c.label} {:else} {c.label} {/if} @@ -43,4 +48,8 @@ .current { color: var(--text-2); } + .muted { + color: var(--text-dim); + font-style: italic; + } diff --git a/client_v2/src/lib/components/library/FilamentInspector.svelte b/client_v2/src/lib/components/library/FilamentInspector.svelte index f1e66907..69ed11d8 100644 --- a/client_v2/src/lib/components/library/FilamentInspector.svelte +++ b/client_v2/src/lib/components/library/FilamentInspector.svelte @@ -28,7 +28,9 @@ let { filament }: { filament: Filament } = $props(); - let vendor = $derived(inventory.vendorOf(filament)); + // Undefined when the filament has no manufacturer set (or it isn't cached yet) — + // the display falls back to a plain "no manufacturer" note instead of a link. + let vendor = $derived(inventory.vendorById(filament.vendorId)); // Fetch this filament's spools from the API (scoped list) rather than the cache. // Depend on the primitive id (via $derived) — not `filament` itself — so the @@ -88,7 +90,9 @@
params.select('vendor', vendor.id) }, + vendor + ? { label: vendor.name, onclick: () => params.select('vendor', vendor.id) } + : { label: m['add.noManufacturer'](), muted: true }, { label: filament.name } ]} /> @@ -103,7 +107,10 @@ title={serverInfo.externalDbName + ' · ' + filament.externalId}>{serverInfo.externalDbName}{/if}
-
{vendor.name} · {filament.material} · {filament.diameter} mm
+
+ {#if vendor}{vendor.name} · + {/if}{filament.material} · {filament.diameter} mm +