Fix bypass display issue (#144)

* Fix bypass display issue

* nit

* Update test expectations [skip ci]

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2024-07-17 17:27:24 -04:00
committed by GitHub
parent 6b2acc146d
commit 31f4ee332a
6 changed files with 10 additions and 10 deletions

View File

@@ -58,9 +58,7 @@ test.describe('Node Right Click Menu', () => {
await expect(comfyPage.canvas).toHaveScreenshot('right-click-node-collapsed.png');
});
// See https://github.com/Comfy-Org/ComfyUI_frontend/pull/57
// Bypass produces different output on Windows VS Linux.
test.skip('Can bypass', async ({ comfyPage }) => {
test('Can bypass', async ({ comfyPage }) => {
await comfyPage.rightClickEmptyLatentNode();
await expect(comfyPage.canvas).toHaveScreenshot('right-click-node.png');
await comfyPage.page.getByText('Bypass').click();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

After

Width:  |  Height:  |  Size: 93 KiB

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "comfyui-frontend",
"version": "1.0.1",
"version": "1.1.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "comfyui-frontend",
"version": "1.0.1",
"version": "1.1.4",
"dependencies": {
"@comfyorg/litegraph": "^0.7.25",
"@primevue/themes": "^4.0.0-rc.2",

View File

@@ -1547,11 +1547,13 @@ export class ComfyApp {
this.editor_alpha = 0.4;
}
// Mode never equals 4 by ts check.
// if (node.mode === 4) { // never
// node.bgcolor = "#FF00FF";
// this.editor_alpha = 0.2;
// }
// ComfyUI's custom node mode enum value 4 => bypass/never.
// @ts-ignore
if (node.mode === 4) {
// never
node.bgcolor = "#FF00FF";
this.editor_alpha = 0.2;
}
const adjustColor = (color?: string) => {
return color ? lightenColor(color, 0.5) : color;