From 5c51f01877bfaaef486d21253f6beccc8a919106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=86motion=20Studio?= <163354043+AEmotionStudio@users.noreply.github.com> Date: Wed, 4 Nov 2026 11:43:54 -0800 Subject: [PATCH] Hide the frontend's $$ preview widgets from the Inspector rows Load Image listed its internal $$canvas-image-preview widget as a row in the Inspector and the pop-out. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 2 +- src/info-panel/NodeDataExtractor.ts | 4 ++-- tests/unit/WidgetEditing.test.ts | 12 ++++++++++++ web/info-panel/NodeDataExtractor.js | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 01aceb2..79a0196 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,7 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Node Title Emphasis** sits on the title bar instead of the first slot row, and is not drawn on nodes without a title bar such as Reroute. - The glass background matches the page past the canvas edge and at canvas zoom of 1.5 and above. - **Subgraphs**: The panel, picker, highlight and editing use the graph on screen, so they work inside subgraphs. Title bars and collapsed nodes are hit. -- **Widget edits** run the widget's callback, redraw the canvas and record undo. CLIPLoader's `type` widget shows again. +- **Widget edits** run the widget's callback, redraw the canvas and record undo. CLIPLoader's `type` widget shows again. The frontend's internal `$$` preview widgets (e.g. on Load Image) are no longer listed. - Dropdowns no longer get orphaned or keep writing after the panel re-renders, and they can be filtered by typing. - The panel re-renders only when the shown node changes, so hover, focus and text selection survive. - Saved fonts no longer reset on reload, and High Contrast Text applies on load. diff --git a/src/info-panel/NodeDataExtractor.ts b/src/info-panel/NodeDataExtractor.ts index a5b30ae..b800012 100644 --- a/src/info-panel/NodeDataExtractor.ts +++ b/src/info-panel/NodeDataExtractor.ts @@ -69,9 +69,9 @@ export function getImportantNodeParameters(nodeInfo: NodeInfo): ParameterItem[] }; }; - // Every named widget, as the pop-out shows them + // Every named widget, as the pop-out shows them. The frontend names its own preview widgets $$... for (const widget of nodeInfo.widgets) { - if (widget.name && (!SKIP_WIDGET_NAMES.includes(widget.name.toLowerCase()) || widgetSlot(widget))) { + if (widget.name && !widget.name.startsWith('$$') && (!SKIP_WIDGET_NAMES.includes(widget.name.toLowerCase()) || widgetSlot(widget))) { parameters.push(createParameterItem(widget)); } } diff --git a/tests/unit/WidgetEditing.test.ts b/tests/unit/WidgetEditing.test.ts index c5c6faa..57861df 100644 --- a/tests/unit/WidgetEditing.test.ts +++ b/tests/unit/WidgetEditing.test.ts @@ -268,4 +268,16 @@ describe('getImportantNodeParameters', () => { expect(seed.isLinked).toBe(true); expect(seed.isEditable).toBe(false); }); + + it("leaves out the frontend's own $$ preview widgets", () => { + const items = getImportantNodeParameters({ + id: 9, type: 'LoadImage', + widgets: [ + { name: 'image', type: 'combo', value: 'beetle.png', options: { values: ['beetle.png'] } }, + { name: '$$canvas-image-preview', type: 'image', value: '' } + ], + inputs: [] + } as any); + expect(items.map(i => i.label)).toEqual(['image']); + }); }); diff --git a/web/info-panel/NodeDataExtractor.js b/web/info-panel/NodeDataExtractor.js index 8c388f8..209cac2 100644 --- a/web/info-panel/NodeDataExtractor.js +++ b/web/info-panel/NodeDataExtractor.js @@ -33,7 +33,7 @@ function getImportantNodeParameters(nodeInfo) { }; }; for (const widget of nodeInfo.widgets) { - if (widget.name && (!SKIP_WIDGET_NAMES.includes(widget.name.toLowerCase()) || widgetSlot(widget))) { + if (widget.name && !widget.name.startsWith("$$") && (!SKIP_WIDGET_NAMES.includes(widget.name.toLowerCase()) || widgetSlot(widget))) { parameters.push(createParameterItem(widget)); } }