From dadc2ba760e9907ebc6009aca733d39722d2d8bb Mon Sep 17 00:00:00 2001 From: Donkie Date: Sat, 1 Aug 2026 10:54:25 +0200 Subject: [PATCH] Fold mirrored extra fields into the grid above them In the spool view the filament's custom fields sat under their own "Extra fields" heading, styled exactly like the FILAMENT and MANUFACTURER headings beside it, so it read as a third peer section rather than as more of the filament. Emit those rows straight into the preceding field grid instead. Only the read-only mirrors change; an entity's own extra-fields section keeps its heading, which is also where the "Manage fields" link lives. --- .../lib/components/ExtraFieldsSection.svelte | 33 ++++++++++++------- .../components/library/SpoolInspector.svelte | 6 ++-- .../components/library/VendorSection.svelte | 5 +-- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/client_v2/src/lib/components/ExtraFieldsSection.svelte b/client_v2/src/lib/components/ExtraFieldsSection.svelte index 2a4b9c11..e5c1c848 100644 --- a/client_v2/src/lib/components/ExtraFieldsSection.svelte +++ b/client_v2/src/lib/components/ExtraFieldsSection.svelte @@ -22,8 +22,16 @@ * another entity, where an empty section is just noise. */ manage?: boolean; + /** + * Emit only the field rows — no section header, no grid of its own — so the + * caller can drop them straight into its own . Used by the + * read-only mirrors of another entity, where a second "Extra fields" heading + * in the same panel reads as a peer section rather than as more of the + * entity above it (#992). + */ + headless?: boolean; } - let { entity, extra, onchange, readonly = false, manage = false }: Props = $props(); + let { entity, extra, onchange, readonly = false, manage = false, headless = false }: Props = $props(); $effect(() => { fields.ensure(entity); @@ -43,20 +51,21 @@ > {/snippet} -{#if show} +{#snippet rows()} + {#each defs as f (f.key)} + + onchange(f.key, json)} {readonly} /> + + {/each} +{/snippet} + +{#if headless} + {@render rows()} +{:else if show} {m['settings.extraFields.tab']()} {#if defs.length} - {#each defs as f (f.key)} - - onchange(f.key, json)} - {readonly} - /> - - {/each} + {@render rows()} {:else}
{m['inspector.noExtraFields']()}
diff --git a/client_v2/src/lib/components/library/SpoolInspector.svelte b/client_v2/src/lib/components/library/SpoolInspector.svelte index 9ed430e1..c066fcab 100644 --- a/client_v2/src/lib/components/library/SpoolInspector.svelte +++ b/client_v2/src/lib/components/library/SpoolInspector.svelte @@ -376,10 +376,12 @@ {/if} {filament.registeredLabel} + + {}} readonly headless />
- {}} readonly /> - {vendor.registeredLabel} + + {}} readonly headless /> - - {}} readonly /> {:else}
{m['add.noManufacturer']()}
{/if}