-
Notifications
You must be signed in to change notification settings - Fork 638
fix(widgets): tolerate un-keyable widget ids in widget value store #13773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
cec0554
fix(widgets): tolerate un-keyable widget ids in widget value store
christian-byrne ba810e1
test(widgets): warn on declined widget id + expand un-keyable coverage
christian-byrne 1b5e292
fix(widgets): reconcile widget store entry when widget type changes (…
christian-byrne 5b14113
test(e2e): custom-node empty-name widget doesn't blank the node grid …
christian-byrne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
browser_tests/tests/vueNodes/widgets/emptyNameWidget.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import { | ||
| comfyExpect as expect, | ||
| comfyPageFixture as test | ||
| } from '@e2e/fixtures/ComfyPage' | ||
| import { TestIds } from '@e2e/fixtures/selectors' | ||
|
|
||
| const HOST_NODE_TYPE = 'KSampler' | ||
| const HOST_NODE_TITLE = 'KSampler' | ||
|
|
||
| /** | ||
| * Regression for #13773: a custom node that registers a client-side widget with | ||
| * an empty/placeholder name produces an un-keyable widget id (empty name | ||
| * segment). Before the fix, `parseWidgetId` threw on that id, which tripped the | ||
| * Vue `NodeWidgets` error boundary and blanked the node's ENTIRE widget grid | ||
| * (e.g. rgthree Power Lora Loader rendered no widgets). The un-storable widget | ||
| * must not take down its schema-declared siblings. | ||
| */ | ||
| test.describe( | ||
| 'Empty-name custom widget', | ||
| { tag: ['@vue-nodes', '@widget'] }, | ||
| () => { | ||
| test.beforeEach(async ({ comfyPage }) => { | ||
| // Emulate a custom node registering an extra, un-keyable widget | ||
| await comfyPage.nodeOps.clearGraph() | ||
| await comfyPage.nodeOps.addNode(HOST_NODE_TITLE, undefined, { | ||
| x: 400, | ||
| y: 200 | ||
| }) | ||
| await comfyPage.page.evaluate(() => | ||
| graph!.nodes[0].addWidget('text', '', '', () => {}) | ||
| ) | ||
| }) | ||
|
|
||
| test('renders schema widgets despite an un-keyable sibling', async ({ | ||
| comfyPage | ||
| }) => { | ||
| const node = comfyPage.vueNodes.getNodeByTitle(HOST_NODE_TITLE) | ||
| await expect(node).toBeVisible() | ||
|
|
||
| // Precondition: the un-keyable empty-name widget really is on the node, so | ||
| // this test exercises the regression rather than passing vacuously. | ||
| await expect | ||
| .poll(() => | ||
| comfyPage.page.evaluate((type) => { | ||
| const host = window.app!.graph.nodes.find((n) => n.type === type) | ||
| return host?.widgets?.some((w) => w.name === '') ?? false | ||
| }, HOST_NODE_TYPE) | ||
| ) | ||
| .toBe(true) | ||
|
|
||
| // The widget grid must render (v-else branch), not the error boundary. | ||
| await expect(node.getByTestId(TestIds.widgets.container)).toBeVisible() | ||
| await expect(node.locator('.node-error')).toHaveCount(0) | ||
|
|
||
| // Schema-declared siblings must still render and be interactable. | ||
| await expect(node.getByLabel('seed', { exact: true })).toBeVisible() | ||
| await expect(node.getByLabel('steps', { exact: true })).toBeVisible() | ||
| await expect(node.getByLabel('cfg', { exact: true })).toBeVisible() | ||
| }) | ||
| } | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.