Skip to content

Commit

Permalink
Relands "Fix node searchbox default value setting" (#152)
Browse files Browse the repository at this point in the history
* Revert "Revert "Fix node searchbox default value setting (#150)" (#151)"

This reverts commit bb02f93.

* Update test expectations [skip ci]

---------

Co-authored-by: github-actions <[email protected]>
  • Loading branch information
huchenlei and github-actions authored Jul 18, 2024
1 parent bb02f93 commit 54246d3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 1 addition & 12 deletions browser_tests/nodeSearchBox.spec.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
import { expect } from "@playwright/test";
import { ComfyPage, comfyPageFixture } from "./ComfyPage";
import { comfyPageFixture as test} from "./ComfyPage";

export const test = comfyPageFixture.extend<{ comfyPage: ComfyPage }>({
comfyPage: async ({ comfyPage }, use) => {
await comfyPage.page.evaluate(async () => {
await window["app"].ui.settings.setSettingValueAsync(
"Comfy.NodeSearchBoxImpl",
"default"
);
});
await use(comfyPage);
},
});

test.describe("Node search box", () => {
test("Can trigger on empty canvas double click", async ({ comfyPage }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,9 +429,9 @@ export class ComfyUI {
options: ["default", "litegraph (legacy)"],
defaultValue: "default",
onChange: (value?: string) => {
if (value === undefined) return;
if (!app.canvas) return;

value = value || "default";
const useLitegraphSearch = value === "litegraph (legacy)";
app.canvas.allow_searchbox = useLitegraphSearch;
document.dispatchEvent(
Expand Down

0 comments on commit 54246d3

Please sign in to comment.