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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ebae4f904d
commit
5c51f01877
+1
-1
@@ -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.
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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']);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user