-
Notifications
You must be signed in to change notification settings - Fork 621
refactor(assets): delete isAssetAPIEnabled and Comfy.Assets.UseAssetAPI (FE-729) #12322
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
base: main
Are you sure you want to change the base?
Changes from 11 commits
7f6d354
fcdc440
b340265
09943f8
e48dcd1
ec0711d
ffe8d0f
0797b7a
c579c88
55b0329
a738f75
aaf2177
bc5d7a3
b0e0423
4066b2a
8e0970e
42fd381
f4ebb17
fc26526
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -119,9 +119,22 @@ export class BuilderSelectHelper { | |
| )[0] | ||
| if (!nodeRef) throw new Error(`Node ${nodeTitle} not found`) | ||
| await nodeRef.centerOnNode() | ||
| const widgetLocator = this.comfyPage.vueNodes | ||
| .getNodeLocator(String(nodeRef.id)) | ||
| .getByLabel(widgetName, { exact: true }) | ||
| const node = this.comfyPage.vueNodes.getNodeLocator(String(nodeRef.id)) | ||
| // Grid-mode widgets (WidgetSelectDefault) and number widgets expose | ||
| // aria-label on a wrapper/input. Asset-mode widgets (WidgetSelectDropdown) | ||
| // do not — the widget name lives in a sibling | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: (non-blocking)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Valid — The durable fix is the |
||
| // [data-testid="widget-layout-field-label"] div, so fall back to clicking | ||
| // the dropdown trigger button in the same row. | ||
| const byAriaLabel = node.getByLabel(widgetName, { exact: true }) | ||
| const widgetLocator = | ||
| (await byAriaLabel.count()) > 0 | ||
| ? byAriaLabel | ||
| : node | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: (non-blocking)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed — XPath parent-axis is brittle to wrapper changes. Same fix as the previous comment: a |
||
| .getByTestId('widget-layout-field-label') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: (non-blocking)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed — positional |
||
| .filter({ hasText: widgetName }) | ||
| .locator('..') | ||
| .locator('button') | ||
| .first() | ||
| // oxlint-disable-next-line playwright/no-force-option -- Node container has conditional pointer-events:none that blocks actionability | ||
| await widgetLocator.click({ force: true }) | ||
| await this.comfyPage.nextFrame() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,7 +27,6 @@ test.describe('Default Keybindings', { tag: '@keyboard' }, () => { | |
| const sidebarTabs = [ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: The
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The binding still exists — |
||
| { key: 'KeyW', tabId: 'workflows', label: 'workflows' }, | ||
| { key: 'KeyN', tabId: 'node-library', label: 'node library' }, | ||
| { key: 'KeyM', tabId: 'model-library', label: 'model library' }, | ||
| { key: 'KeyA', tabId: 'assets', label: 'assets' } | ||
| ] as const | ||
|
|
||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1283,23 +1283,9 @@ export function useCoreCommands(): ComfyCommand[] { | |
| { | ||
| id: 'Comfy.BrowseModelAssets', | ||
| icon: 'pi pi-folder-open', | ||
| label: 'Experimental: Browse Model Assets', | ||
| label: 'Browse Model Assets', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Localize this command label via vue-i18n. This user-facing label is a raw string and should go through i18n. 💡 Suggested change- label: 'Browse Model Assets',
+ label: () => t('commands.browseModelAssets'),🤖 Prompt for AI Agents
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Valid finding, but the raw-string
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The PR description image shows the ComfyUI Model Library dialog — a dark-themed modal with a left sidebar listing model categories (BEN, BiRefNet, CogVideo, etc.) and a main grid displaying LORA model cards with thumbnails, file names, dates, and "Use" buttons, along with search and filter controls.
🧠 Learnings used |
||
| versionAdded: '1.28.3', | ||
| function: async () => { | ||
| if (!useSettingStore().get('Comfy.Assets.UseAssetAPI')) { | ||
| const confirmed = await dialogService.confirm({ | ||
| title: 'Enable Asset API', | ||
| message: | ||
| 'The Asset API is currently disabled. Would you like to enable it?', | ||
| type: 'default' | ||
| }) | ||
|
|
||
| if (!confirmed) return | ||
|
|
||
| const settingStore = useSettingStore() | ||
| await settingStore.set('Comfy.Assets.UseAssetAPI', true) | ||
| await workflowService.reloadCurrentWorkflow() | ||
| } | ||
| const assetBrowserDialog = useAssetBrowserDialog() | ||
| await assetBrowserDialog.browse({ | ||
| assetType: 'models', | ||
|
|
@@ -1318,22 +1304,6 @@ export function useCoreCommands(): ComfyCommand[] { | |
| }) | ||
| } | ||
| }, | ||
| { | ||
| id: 'Comfy.ToggleAssetAPI', | ||
| icon: 'pi pi-database', | ||
| label: () => | ||
| `Experimental: ${ | ||
| useSettingStore().get('Comfy.Assets.UseAssetAPI') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: (non-blocking) Any user with a persisted keybinding to
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirmed the path: The clean fix is a graceful guard in the keybinding service (skip + warn on unregistered command ids), which also covers future removed commands and orphaned extension bindings. That touches shared keybinding infra beyond this delete-only PR, so I'll handle it as a separate follow-up rather than widen this one.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tracked as FE-1100 — the keybinding service will skip unregistered command ids gracefully (warn + no-op), covering this removal and any future ones plus orphaned extension bindings. https://linear.app/comfyorg/issue/FE-1100 |
||
| ? 'Disable' | ||
| : 'Enable' | ||
| } AssetAPI`, | ||
| function: async () => { | ||
| const settingStore = useSettingStore() | ||
| const current = settingStore.get('Comfy.Assets.UseAssetAPI') ?? false | ||
| await settingStore.set('Comfy.Assets.UseAssetAPI', !current) | ||
| await useWorkflowService().reloadCurrentWorkflow() // ensure changes take effect immediately | ||
| } | ||
| }, | ||
| { | ||
| id: 'Comfy.ToggleQPOV2', | ||
| icon: 'pi pi-list', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: The TODO comment is clear, but there is no machine enforcement that catches if
--enable-assetssurvives into a non-draft merge. Consider a CI lint step (agrepgate) or a note in the BE-786 ticket so the revert is verified automatically rather than relying on reviewer memory.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed it shouldn't rely on reviewer memory. The
--enable-assetsline lives in commit e48dcd1, which is itself reverted before this PR leaves draft-gating on BE-786 (PR checklist item). I'll add a note on BE-786 so the CI image flip and this revert are verified together.A standing grep gate isn't durable here since the whole temp commit is removed at merge, but I can add a transient CI check if you'd prefer belt-and-suspenders.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Posted the coordination note on BE-786 so the CI image flip and the
e48dcd11frevert get verified together when it lands.