Compare commits

...

16 Commits

Author SHA1 Message Date
Connor Byrne
13129d27cd feat: fold release summary into the unified PR report comment
Convert comment-release-links to upsert a release / desktop-release section
into the shared COMFYUI_FRONTEND_PR_REPORT comment instead of posting a
separate release-summary comment.
2026-06-17 18:28:27 -07:00
Connor Byrne
27efdc695e feat: fold website CI sections into the unified PR report comment
Point the website e2e, preview, and screenshot-update sections at the shared
COMFYUI_FRONTEND_PR_REPORT comment instead of the separate WEBSITE_CI_REPORT
comment, and add WEBSITE_CI_REPORT to the legacy-comment cleanup so the old
standalone website comment is removed.

Addresses review feedback:
https://github.com/Comfy-Org/ComfyUI_frontend/pull/11935#pullrequestreview-4226267093
2026-06-17 18:25:54 -07:00
AustinMroz
eafe2af91d Indicate in progress upload with spinner (#12673)
While a file is uploading to any of the file picker nodes (ie "Load
Image"), the 'select folder' icon is replaced with a loading spinner.

I had previously implemented this with a full progress bar indicating
the rate of upload, but found it particularly uninformative when used on
cloud.

<img width="659" height="494" alt="image"
src="https://github.com/user-attachments/assets/6d3ca82b-360b-44bc-b123-b276aae2c4d6"
/>
2026-06-17 18:09:49 -07:00
AustinMroz
4c870d84ed Fix disabling of linked widgets in props panel (#12896)
| Before | After |
| ------ | ----- |
| <img width="360" alt="before"
src="https://github.com/user-attachments/assets/9d602ee3-ff10-48b9-95ca-4c7f5ca57a45"
/> | <img width="360" alt="after"
src="https://github.com/user-attachments/assets/36e96aff-60ec-4f8c-b7c9-b4d68e03884c"
/>|

Making reactivity function is a little bit clunkier than I would like,
but it'll get simplified in the future by east coast swing
2026-06-17 18:05:57 -07:00
Christian Byrne
4f60d09420 ci: consolidate PR bot comments into one unified comment (#11935)
## Summary

- Merges the separate Playwright and Storybook bot comments into the
existing `<!-- COMFYUI_FRONTEND_PR_REPORT -->` unified comment, using
named sections via `upsert-comment-section`
- Each workflow independently upserts its own section without clobbering
others
- `pr-report.yaml` cleans up legacy `<!-- PLAYWRIGHT_TEST_STATUS -->`
and `<!-- STORYBOOK_BUILD_STATUS -->` comments on first run
- Perf report: collapses detailed metric tables in `<details>` by
default — only headline FPS/TBT/heap summary and a brief regression
count are visible inline

## Before → After

**Before:** 4–5 separate bot comments per PR (Playwright, Storybook,
Bundle/Perf/Coverage, Chromatic URLs) + CodeRabbit + Codecov

**After:** 1 unified comment with collapsible sections:
```
<!-- COMFYUI_FRONTEND_PR_REPORT -->
<!-- section:playwright:start --> ... <!-- section:playwright:end -->
<!-- section:storybook:start --> ... <!-- section:storybook:end -->
<!-- section:ci-metrics:start --> ... <!-- section:ci-metrics:end -->
<!-- section:chromatic:start --> ... <!-- section:chromatic:end -->
```
(CodeRabbit and Codecov are external and can't be merged)

## How it works

`upsert-comment-section` already existed for the website CI comment.
This PR extends that pattern to the main PR report comment:

1. **Playwright** — shell script writes to `SUMMARY_FILE` when set, CI
workflow uses `upsert-comment-section` with `section-name: playwright`
2. **Storybook** — same pattern, `section-name: storybook`
3. **Bundle/Perf/Coverage** — `pr-report.yaml` now also uses
`upsert-comment-section` instead of replacing the whole comment,
`section-name: ci-metrics`
4. **Chromatic** — `section-name: chromatic`, no script change needed

Both fork and non-fork PR paths updated.

## Perf report noise fix

Previously the full per-metric regression table was shown inline. Now:
- **Visible:** headline summary (avg FPS, P5 FPS, TBT, heap per test) +
"⚠️ N regressions detected" count
- **Collapsed by default:** regression detail table, all-metrics table,
historical variance, trend data

## Test plan

- [ ] Open a PR with frontend changes — confirm single unified bot
comment appears
- [ ] Confirm Playwright section appears with  then updates to results
- [ ] Confirm Storybook section appears only when storybook-relevant
files change
- [ ] Confirm legacy standalone Playwright/Storybook comments are
deleted by `pr-report.yaml`
- [ ] Confirm perf report shows headline only, details collapsed
- [ ] Test with a fork PR — confirm fork path also works

🤖 Generated with [Claude Code](https://claude.ai/claude-code)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-11935-ci-consolidate-PR-bot-comments-into-one-unified-comment-3566d73d36508173964cdf596cfae1f8)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Connor Byrne <c.byrne@comfy.org>
Co-authored-by: Alexander Brown <drjkl@comfy.org>
2026-06-17 18:02:28 -07:00
Alexander Brown
edf3e1a682 refactor(litegraph): remove vestigial use_uuids node-id mode (#12930)
## Summary

Removes LiteGraph's vestigial `use_uuids` node-id mode, which was never
enabled anywhere in the codebase.

## Changes

- **What**: Deletes the `LiteGraph.use_uuids` flag and the node-id
branches that read it. Newly created/added/cloned nodes now always
receive integer ids. The `asSerialisable` sort guard drops its
`@ts-expect-error` in favor of an explicit `Number(a.id) - Number(b.id)`
comparison.
- **Breaking**: `LiteGraph.use_uuids` is removed from the public
`LiteGraph` global. It defaulted to `false` and nothing ever set it to
`true`, so behavior is unchanged for all real usage — but the property
no longer exists on the global surface. Litegraph changes can affect
downstream custom-node repos.

`createUuidv4` / `LiteGraph.uuidv4` are intentionally kept — still used
for subgraph ids, slot ids, and clipboard remapping.

## Review Focus

- Confirm hard removal (vs. deprecate-then-remove no-op getter) is
acceptable for the public `LiteGraph` surface.
- `asSerialisable` sort now coerces ids via `Number()`; all serialised
node ids are numeric, so ordering is unchanged.

## Notes

- 2 litegraph test suites (`LGraphCanvas.clipboard.test.ts`,
`SubgraphWidgetPromotion.test.ts`) fail at import with a pre-existing
asset-URL error unrelated to this change (confirmed they fail with these
changes stashed). All 909 tests that ran pass.

Co-authored-by: Amp <amp@ampcode.com>
2026-06-17 23:02:35 +00:00
Alexander Brown
968598d9e6 fix: prevent Vitest createRequire crash on Windows public-asset URLs (#12927)
## Summary

Stop Vitest from crashing on Windows when a unit test imports a Vue
component whose template references an absolute public-asset URL (e.g.
`<img src="/assets/images/default-template.png">`).

## Changes

- **What**: Pass `template.transformAssetUrls.includeAbsolute: false` to
`@vitejs/plugin-vue` under Vitest only. With no dev server, the plugin
forces `includeAbsolute: true`, compiling absolute public-asset URLs
into module imports. Vite's module runner then derives a rootless
`import.meta.url` of `file:///assets/...`, which has no drive letter on
Windows, so Vitest's `createRequire(import.meta.url)` throws
`ERR_INVALID_ARG_VALUE` and aborts collection of any test transitively
importing such a component. Disabling the absolute transform under tests
keeps these as plain string literals (identical rendered output).
- **Breaking**: None — change is scoped to `process.env.VITEST`; dev and
production builds are unchanged.

## Review Focus

`vite.config.mts` — the `vuePluginOptions` const is `undefined` outside
Vitest, so only the test runner is affected.

Co-authored-by: Amp <amp@ampcode.com>
2026-06-17 22:58:40 +00:00
Christian Byrne
305d209f6f fix: remove unused export from Load3dSerializedBase type (#12928)
## Summary

Remove unused `export` keyword from `Load3dSerializedBase` type. The
type is only used internally as the return type of `snapshotLoad3dState`
and is not imported elsewhere.

Fixes knip "unused exported types" error.

Co-authored-by: Connor Byrne <c.byrne@comfy.org>
2026-06-17 21:15:59 +00:00
Maanil Verma
0c23e8305f fix: skip templates modal when opening a template from the URL (#12835)
## Summary

On first launch, the templates modal flashed open for a split second
before a deeplinked template (`?template=`) loaded, which felt broken.

## Changes

- **What**: Gate the first-launch templates modal on template URL
intent, alongside the existing shared-workflow (`?share=`) check. When a
template is being opened directly from the URL, the template modal no
longer opens. Behavior is unchanged when no template is in the URL — the
template modal still shows for first-time users.
- Test util: Added browser_tests/fixtures/utils/flashDetector.ts —
installs a pre-navigation requestAnimationFrame sampler that flags if a
[data-testid] element ever renders, even for a single frame. This
catches a brief flash that toBeHidden() (final-state only) cannot.

## Review Focus

`hasTemplateUrlIntent()` mirrors the existing
`hasSharedWorkflowIntent()` (direct `route.query` check plus
preserved-query fallback for the `/user-select` redirect path). Two
regression tests cover both the URL-param and preserved-intent cases.

**Coverage:**

- Unit (useWorkflowPersistenceV2.test.ts): the modal is not opened when
a template param is in the URL, and when template intent is preserved
across the /user-select redirect.
- E2E (templates.spec.ts): templates dialog never flashes when
first-time user opens a template link — verified red-without-fix,
green-with-fix.

Screen Recording 



https://github.com/user-attachments/assets/636094d4-0ef0-4e42-af32-d4e6c7ec5731



closes #12836
2026-06-17 21:00:02 +00:00
Matt Miller
810ada61fb ci: add team-gated Cursor review (thin caller for github-workflows) (#12859)
## Summary

Adds a team-gated, label-triggered multi-model Cursor review as a **thin
caller** for the reusable workflow in `Comfy-Org/github-workflows` — the
single source of truth for the panel, judge, prompts, and scripts. This
repo carries only the ~50-line caller, so there's no review logic to
drift out of sync.

## Changes

- **What**: `.github/workflows/pr-cursor-review.yaml` triggers on the
`cursor-review` label and calls
`Comfy-Org/github-workflows/.github/workflows/cursor-review.yml`, pinned
to `047ca48` (github-workflows#9, current main). Inheriting the reusable
workflow brings severity badges, line-anchored inline comments,
diff-size caps, prompt-injection hardening, and optional Slack DMs.
- **Config**: `diff_excludes` restated (overriding replaces the default
wholesale) with this repo's heavy paths added (Playwright snapshots,
generated manager types). Judge and panel both default to Opus 4.8 via
the reusable workflow — no overrides needed.

## Review Focus

- **Access control (the point).** Two layers, no allowlist: (1) only
triage+ users can apply a label in a public repo; (2) the reusable
workflow's secret-bearing jobs don't run on fork PRs, so
`CURSOR_API_KEY` is reachable only on internal branches.
- **Replaces a standalone draft.** Earlier revisions of this branch
carried a self-contained workflow + review/judge scripts; that
duplicated the reusable workflow, so it's been swapped for the thin
caller.

## Prerequisites (already done)

- `CURSOR_API_KEY` secret set on this repo.
- `cursor-review` label created.
- `SLACK_BOT_TOKEN` already present (enables the DM feature).

---------

Co-authored-by: GitHub Action <action@github.com>
2026-06-17 20:38:14 +00:00
Alexander Brown
ec91ecd695 ci: carry forward unit and e2e coverage flags (#12926)
## Summary

Enable Codecov carryforward on the `unit` and `e2e` flags so a missing
or late E2E coverage upload no longer produces a false `codecov/patch`
failure.

## Changes

- **What**: Add a `flags` block to `codecov.yml` marking `unit` and
`e2e` as `carryforward: true`. When a flag's upload is absent for a
commit, Codecov reuses that flag's last known coverage for unchanged
files instead of treating those lines as patch misses.

## Review Focus

The `e2e` flag is uploaded by the separate `ci-tests-e2e-coverage`
`workflow_run` job, which runs after CI and currently fails or skips
intermittently (uploaded with `fail_ci_if_error: false`). When that
upload is missing, the head report holds only the `unit` session, so
E2E-only code paths (canvas, vue-nodes, minimap, glsl, etc.) report as
uncovered and the patch status fails against the full-coverage base.
Carryforward fixes that symptom; the flaky coverage workflow remains a
separate root-cause fix.

Validated with `curl --data-binary @codecov.yml
https://codecov.io/validate` → `Valid!`. Carryforward takes effect after
merge once a `main` build establishes a baseline for both flags.

Co-authored-by: Amp <amp@ampcode.com>
2026-06-17 20:34:46 +00:00
Alexander Brown
c408f39cee test: harden assets media-type filter spec against VirtualGrid flake (#12897)
## Summary

Harden the cloud assets media-type filter spec against a VirtualGrid
virtualization flake that intermittently failed CI at the
`waitForAssets(4)` precondition.

## Changes

- **What**: Replace the 7 `waitForAssets(MIXED_JOBS.length)`
preconditions in `assets-filter.spec.ts` with `waitForAssets()` (first
card visible = data loaded), and document why.

## Review Focus

CI artifact (`playwright-report-cloud`) from the failing run showed only
3 of 4 cards in the DOM — the 3D card was missing and the audio card
rendered taller (inline player). `VirtualGrid.vue` sizes its render
window from a single uniform `itemHeight` measured off the first card,
so the taller audio card pushes the 3D card out of the initial window
and it is virtualized out of the DOM until a re-measure (same cause as
#11635).

Requiring all 4 cards to be mounted simultaneously fights
virtualization. `tab.open()` already waits for the first card (data
loaded), and filtering reads the full asset store regardless of what is
mounted, so the per-filter count assertions still provide the real
coverage. No behavioral change to the tests — only the
readiness/precondition strategy.

Verified `pnpm exec eslint` and `pnpm typecheck:browser` pass. Cloud E2E
could not be run locally (needs a running frontend + backend); relies on
the cloud CI job for confirmation.

Related to #11635

---------

Co-authored-by: Amp <amp@ampcode.com>
2026-06-17 19:38:22 +00:00
Deep Mehta
ccf2f12b25 fix(website): correct top-up credit rollover copy on cloud pricing (#12923)
## Summary

The `/cloud/pricing` page's "Add more credits anytime" feature claims
unused top-up credits **roll over** to the next month. Per product
(Pablo, #cloud), top-up credits **do not** roll over. Fix the copy to
match policy and the docs.

## Changes

- **What**: `pricing.included.feature5.description` (en + zh-CN) in
`apps/website/src/i18n/translations.ts`.
- Before: "Purchase additional credits at any time. Unused top-ups roll
over to the next month automatically for up to 1 year."
- After: "Purchase additional credits at any time. Top-up credits are
valid for 1 year from the date of purchase and do not roll over with
your monthly plan."
- Keeps the accurate 1-year validity window (matches
`docs/interface/credits.mdx`).
- Scope: this is the **only** rollover claim on the page. The tier cards
(lines 1224/1255/1286) only say "top-ups available" — no change needed.
- **Breaking**: none (copy only).

## Deliberately out of scope

The Slack thread surfaced an **unresolved** question: Pablo said top-ups
don't roll over *"as opposed to subscription credits which do,"* but
`docs/interface/credits.mdx` says monthly credits don't roll over
either. This PR makes **no claim about subscription/monthly credit
rollover** (the new copy is neutral: "do not roll over *with your
monthly plan*"). Resolving that — and the optional FAQ entry / docs
alignment Glary-Bot proposed — needs a product decision first. Flagging
for follow-up.
2026-06-17 18:38:56 +00:00
jaeone94
6850d22d99 Redesign error overlay count and toast behavior (#12871)
## Summary

Redesign the run error overlay so its count and copy use the same
grouped error semantics as the redesigned Error tab, while keeping
single-error toast copy precise.

This is a stacked follow-up to #12828. The parent PR redesigns the Error
tab cards and centralizes their grouped/row-based presentation. This PR
applies the same mental model to the compact overlay shown from the Run
button path, so users no longer see one count in the Error tab and a
different count in the overlay.

## Changes

- **What**: Align the error overlay count with the Error tab's grouped
error count.
- The overlay now reads the same grouped error surface that powers the
Error tab hero instead of independently summing raw store error counts.
- Validation/runtime/prompt execution groups use their grouped `count`.
- Missing model/media/node/swap groups keep the row/group count
semantics introduced by the Error tab redesign.
- This avoids cases where the overlay headline says one number while the
panel summarizes another.

- **What**: Preserve the existing single-error toast behavior while
adding explicit multi-row handling.
- A single true leaf still uses the catalog/resolver toast title and
toast message.
- A single grouped execution error with multiple node/input items uses
that group's title/message instead of the generic aggregate copy.
- A single missing model/media group with multiple model/file rows uses
the generic aggregate copy because it represents multiple actionable
rows.
- A single missing model/media row referenced by multiple nodes uses the
group title/message, since there is still only one model/file to
resolve.
- Multiple top-level groups continue to use the aggregate "N errors
found" style copy.

- **What**: Restyle the overlay toast to match the new error-surface
direction.
- Adds a compact dark card with a destructive left accent and a visible
outline for better contrast against the workspace.
  - Keeps the close button in the card header area.
- Keeps the primary "View details" action, but adjusts spacing, size,
and typography to better match the Figma direction.
- Removes the older footer-style dismiss action so the overlay behaves
like a focused status toast rather than a secondary dialog.

- **What**: Share error grouping/count helpers instead of duplicating
local logic.
- Extracts execution item-list detection for reuse between the Error tab
render path and count logic.
- Extracts missing-model grouping/count helpers so missing-model row
count semantics have one implementation.
- Removes `groupedErrorMessages`, which became unused after the overlay
copy decision moved to grouped error state.

- **Breaking**: None.

- **Dependencies**: None.

## Review Focus

- **Stack boundary**: Please review this against
`jaeone/fe-816-error-card-redesign`, not against `main` directly. The
parent PR is #12828 and contains the Error tab card redesign that this
overlay work builds on.

- **Count semantics**: The visible overlay count intentionally changes
from raw store counts to grouped Error tab counts. This is not just a
refactor; it is the intended product behavior so the compact overlay and
the panel hero agree.

- **Overlay message branches**: The overlay can now choose between three
message modes. The goal is to keep precise single-error copy where it is
useful, but avoid showing one node-specific toast message when the
overlay actually represents multiple actionable rows.

| Branch | When it applies | Overlay title source | Overlay message
source | Example output |
| --- | --- | --- | --- | --- |
| Aggregate summary | More than one top-level error group, or one
missing model/media group with multiple actionable model/file rows. |
Generic aggregate title using grouped count. | Generic aggregate
message. | Title: `2 errors found`<br>Message: `Resolve them before
running the workflow.`<br>Example case: one Missing Models group
containing `first.safetensors` and `second.safetensors`. |
| Group summary | Exactly one error group that is not a true single
leaf, but should still be described by the group. This includes one
execution catalog group with multiple items, or one missing model/media
row referenced by multiple nodes. | The group's `displayTitle`. | The
group's `displayMessage`. | Title: `Missing connection`<br>Message:
`Required input slots have no connection feeding them.`<br>Example case:
one validation group with `KSampler - model` and `KSampler - positive`
rows. |
| Single leaf toast | Exactly one group, one actionable row/card, and at
most one node reference. | Resolver/catalog `toastTitle`. |
Resolver/catalog `toastMessage`. | Title: `Model missing`<br>Message:
`CheckpointLoaderSimple is missing missing.safetensors.`<br>Example
case: one missing model file referenced by one node. |

- **Scope control**: This PR intentionally does not redesign the full
Error Overlay flow beyond the compact toast/card. It also does not
revisit the deeper Error tab card layouts already handled in #12828.

- **Accessibility**: The toast keeps `role="status"` for polite
announcement semantics. The duplicate `aria-live` attribute was removed
during cleanup because `role="status"` already implies polite
live-region behavior.

## Validation

- `pnpm format`
- `pnpm lint`
- `pnpm typecheck`
- `pnpm knip`
- `pnpm test:unit src/components/error/useErrorOverlayState.test.ts
src/platform/missingModel/missingModelGrouping.test.ts
src/components/error/ErrorOverlay.test.ts
src/components/rightSidePanel/errors/useErrorGroups.test.ts`
- Pre-commit staged checks passed.
- Pre-push `knip` passed.

## Screenshots (if applicable)
<img width="454" height="179" alt="스크린샷 2026-06-16 오후 6 00 10"
src="https://github.com/user-attachments/assets/a85376ba-2b22-4cf8-a6fa-79f83fb8b244"
/>
<img width="453" height="179" alt="스크린샷 2026-06-16 오후 6 00 31"
src="https://github.com/user-attachments/assets/d9a1d4bd-92ab-451a-bb79-e7cfbc3af7c6"
/>
<img width="486" height="148" alt="스크린샷 2026-06-16 오후 6 00 55"
src="https://github.com/user-attachments/assets/b66faf96-65c8-4a22-9ff9-e8ccd450986e"
/>
<img width="395" height="127" alt="스크린샷 2026-06-16 오후 6 01 22"
src="https://github.com/user-attachments/assets/c64443f9-0eba-4b2b-8049-c1887c788b1e"
/>
<img width="384" height="134" alt="스크린샷 2026-06-16 오후 6 01 30"
src="https://github.com/user-attachments/assets/42f4fcae-b003-4df9-8f3a-0fda85a90880"
/>
<img width="376" height="129" alt="스크린샷 2026-06-16 오후 6 01 53"
src="https://github.com/user-attachments/assets/ce9030d0-2a98-4b38-9e7d-7a9c3103960f"
/>
<img width="379" height="128" alt="스크린샷 2026-06-16 오후 6 02 01"
src="https://github.com/user-attachments/assets/3d4ce356-1c22-4e3b-a1d0-fece351d9fbb"
/>
<img width="463" height="133" alt="스크린샷 2026-06-16 오후 6 02 33"
src="https://github.com/user-attachments/assets/6ae13a44-02aa-4167-8878-4906db468ad6"
/>
2026-06-17 13:31:07 +00:00
Dante
543a39a6b0 fix(billing): DES review polish on workspace billing UI (#12917)
### before
<img width="539" height="475" alt="Screenshot 2026-06-17 at 9 52 50 PM"
src="https://github.com/user-attachments/assets/dd562cb4-870c-43de-aca4-81e0118735e9"
/>

### after 
<img width="529" height="592" alt="Screenshot 2026-06-17 at 9 53 40 PM"
src="https://github.com/user-attachments/assets/ba8ed01e-ac91-4654-bfaa-d8f73923f378"
/>


Design-review polish on the team-workspace billing UI (3 of the items
from the Figma 'Team Plan - Workspaces' review). All three components
are on main.

### 1. Remove dead 'Upgrade' badge in account popover
`CurrentUserPopoverWorkspace.vue` — the white badge beside 'Plans &
pricing' was gated on `canUpgrade`, which is hardcoded `false` (PRO is
the only tier), so it never rendered. Removed the badge markup and the
dead computed. (Figma node 2797-724189.)

### 2. Subscribe-to-Run button height
`SubscribeToRun.vue` — used `size="sm"`, which didn't match the sibling
run/queue button (an `h-8` button group it swaps with in the same slot
via `CloudRunButtonWrapper`). Switched to `size="unset"` + `h-8
rounded-lg gap-1.5 px-4` to match.

### 3. Duplicate border/radius on member 'subscription inactive' dialog
`useSubscriptionDialog.ts` — the layout dialog already zeroes the
*content* border (`border-none shadow-none`), but the *root* pt kept
only `bg-transparent`, so the dialog frame's default border+radius
doubled with the card's own `rounded-2xl border`. Added `border-none
rounded-none shadow-none` to root so only the card's single
border/radius shows. (Figma node 3253-19473.)

Surfaced during Billing V1 design review (team workspaces).

---------

Co-authored-by: GitHub Action <action@github.com>
2026-06-17 13:18:02 +00:00
Dante
c5eb05a2e9 fix(billing): truncate long workspace names in the switcher (#12918)
The workspace name was hard-clipped by the switcher panel's
`overflow-hidden` instead of truncating with an ellipsis. The name span
had `min-w-0` but its parent row `<button>` (`flex flex-1`) did not, so
the button kept its content width and the long name overflowed.

Add `min-w-0` to the row button (and the name span) so the flex chain
can shrink and the name truncates.

Follow-up to FE-769 (#12763, merged) — the component shipped without
this.

## Before / After
<img width="1370" height="538" alt="fe769-before-after"
src="https://github.com/user-attachments/assets/b05d6faf-9dfe-4c93-9941-3c0a9bbfcc2d"
/>

Verified live in the team-workspaces mock (long-named "Acme Studio
Workspace").

### after
<img width="703" height="302" alt="Screenshot 2026-06-17 at 9 54 34 PM"
src="https://github.com/user-attachments/assets/725c3175-b65f-4224-aca9-3de777c95e85"
/>
2026-06-17 12:56:04 +00:00
53 changed files with 1384 additions and 542 deletions

View File

@@ -1,5 +1,5 @@
name: Post Release Summary Comment
description: Post or update a PR comment summarizing release links with diff, derived versions, and optional extras.
description: Upsert a release-links section (diff, derived versions, optional extras) into the unified PR report comment.
author: ComfyUI Frontend Team
inputs:
@@ -49,7 +49,7 @@ runs:
exit 1
fi
MARKER='release-summary'
SECTION_NAME='release'
MESSAGE='Publish jobs finished successfully:'
LINKS_VALUE=''
@@ -60,7 +60,7 @@ runs:
'npm types|https://www.npmjs.com/package/@comfyorg/comfyui-frontend-types/v/{{version}}')
;;
apps/desktop-ui/package.json)
MARKER='desktop-release-summary'
SECTION_NAME='desktop-release'
LINKS_VALUE='npm desktop UI|https://www.npmjs.com/package/@comfyorg/desktop-ui/v/{{version}}'
;;
esac
@@ -71,7 +71,6 @@ runs:
COMMENT_FILE=$(mktemp)
{
echo "<!--$MARKER:$DIFF_PREFIX$NEW_VERSION-->"
echo "$MESSAGE"
echo ""
echo "- $DIFF_LABEL: [\`$DIFF_PREFIX$PREV_VERSION...$DIFF_PREFIX$NEW_VERSION\`]($DIFF_URL)"
@@ -99,21 +98,14 @@ runs:
echo "COMMENT_BODY_END_MARKER"
} >> "$GITHUB_OUTPUT"
echo "prev_version=$PREV_VERSION" >> "$GITHUB_OUTPUT"
echo "marker_search=<!--$MARKER:" >> "$GITHUB_OUTPUT"
echo "section_name=$SECTION_NAME" >> "$GITHUB_OUTPUT"
echo "new_version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
- name: Find existing comment
id: find
uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4.0.0
- name: Upsert release section into unified report
uses: ./.github/actions/upsert-comment-section
with:
issue-number: ${{ inputs.issue-number || github.event.pull_request.number }}
comment-author: github-actions[bot]
body-includes: ${{ steps.build.outputs.marker_search }}
- name: Post or update comment
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
with:
issue-number: ${{ inputs.issue-number || github.event.pull_request.number }}
comment-id: ${{ steps.find.outputs.comment-id }}
body: ${{ steps.build.outputs.body }}
edit-mode: replace
pr-number: ${{ inputs.issue-number || github.event.pull_request.number }}
section-name: ${{ steps.build.outputs.section_name }}
section-content: ${{ steps.build.outputs.body }}
comment-marker: '<!-- COMFYUI_FRONTEND_PR_REPORT -->'
token: ${{ github.token }}

View File

@@ -1,21 +1,22 @@
name: Upsert Comment Section
description: >
Manage a consolidated PR comment with independently-updatable sections.
All website CI workflows share the marker <!-- WEBSITE_CI_REPORT -->.
Valid section names: "e2e", "preview", "screenshot-update".
Multiple CI workflows can share the same comment by using the same
comment-marker and different section-names. Each workflow upserts only
its own section, leaving other sections intact.
inputs:
pr-number:
description: PR number to comment on
required: true
section-name:
description: 'Section identifier: "e2e", "preview", or "screenshot-update"'
description: 'Section identifier (e.g. "playwright", "storybook", "e2e", "preview")'
required: true
section-content:
description: Markdown content for this section
required: true
comment-marker:
description: Top-level HTML comment marker (must be <!-- WEBSITE_CI_REPORT --> for all callers)
description: Top-level HTML comment marker shared by all sections in this comment
required: true
token:
description: GitHub token with pull-requests write permission
@@ -38,6 +39,10 @@ runs:
const sectionContent = process.env.INPUT_SECTION_CONTENT
const commentMarker = process.env.INPUT_COMMENT_MARKER
if (!/^[a-z0-9-]+$/.test(sectionName)) {
throw new Error(`Invalid section-name: ${sectionName}`)
}
const sectionStart = `<!-- section:${sectionName}:start -->`
const sectionEnd = `<!-- section:${sectionName}:end -->`
const sectionBlock = `${sectionStart}\n${sectionContent}\n${sectionEnd}`

View File

@@ -38,16 +38,15 @@ jobs:
id: pr
uses: ./.github/actions/resolve-pr-from-workflow-run
- name: Handle Test Start
- name: Handle Test Start — upsert playwright starting section
if: steps.pr.outputs.skip != 'true' && github.event.action == 'requested'
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
chmod +x scripts/cicd/pr-playwright-deploy-and-comment.sh
./scripts/cicd/pr-playwright-deploy-and-comment.sh \
"${{ steps.pr.outputs.number }}" \
"${{ github.event.workflow_run.head_branch }}" \
"starting"
uses: ./.github/actions/upsert-comment-section
with:
pr-number: ${{ steps.pr.outputs.number }}
section-name: playwright
section-content: '## 🎭 Playwright: ⏳ Running...'
comment-marker: '<!-- COMFYUI_FRONTEND_PR_REPORT -->'
token: ${{ github.token }}
- name: Download and Deploy Reports
if: steps.pr.outputs.skip != 'true' && github.event.action == 'completed'
@@ -59,13 +58,15 @@ jobs:
path: reports
if_no_artifact_found: warn
- name: Handle Test Completion
- name: Handle Test Completion — deploy and generate section
if: steps.pr.outputs.skip != 'true' && github.event.action == 'completed' && hashFiles('reports/**') != ''
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
GITHUB_TOKEN: ${{ github.token }}
GITHUB_SHA: ${{ github.event.workflow_run.head_sha }}
SUMMARY_FILE: playwright-section.md
BRANCH_NAME: ${{ github.event.workflow_run.head_branch }}
run: |
# Rename merged report if exists
[ -d "reports/playwright-report-chromium-merged" ] && \
@@ -74,5 +75,22 @@ jobs:
chmod +x scripts/cicd/pr-playwright-deploy-and-comment.sh
./scripts/cicd/pr-playwright-deploy-and-comment.sh \
"${{ steps.pr.outputs.number }}" \
"${{ github.event.workflow_run.head_branch }}" \
"$BRANCH_NAME" \
"completed"
- name: Read playwright section
id: section
if: steps.pr.outputs.skip != 'true' && github.event.action == 'completed' && hashFiles('playwright-section.md') != ''
uses: juliangruber/read-file-action@b549046febe0fe86f8cb4f93c24e284433f9ab58 # v1.1.7
with:
path: playwright-section.md
- name: Upsert playwright section into unified report
if: steps.pr.outputs.skip != 'true' && github.event.action == 'completed' && steps.section.outputs.content != ''
uses: ./.github/actions/upsert-comment-section
with:
pr-number: ${{ steps.pr.outputs.number }}
section-name: playwright
section-content: ${{ steps.section.outputs.content }}
comment-marker: '<!-- COMFYUI_FRONTEND_PR_REPORT -->'
token: ${{ github.token }}

View File

@@ -224,7 +224,7 @@ jobs:
# when using pull_request event, we have permission to comment directly
# if its a forked repo, we need to use workflow_run event in a separate workflow (pr-playwright-deploy.yaml)
# Post starting comment for non-forked PRs
# Post starting section into the unified PR report comment for non-forked PRs
comment-on-pr-start:
needs: changes
runs-on: ubuntu-latest
@@ -240,17 +240,16 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v6
- name: Post starting comment
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
chmod +x scripts/cicd/pr-playwright-deploy-and-comment.sh
./scripts/cicd/pr-playwright-deploy-and-comment.sh \
"${{ github.event.pull_request.number }}" \
"${{ github.head_ref }}" \
"starting"
- name: Upsert playwright starting section into unified report
uses: ./.github/actions/upsert-comment-section
with:
pr-number: ${{ github.event.pull_request.number }}
section-name: playwright
section-content: '## 🎭 Playwright: ⏳ Running...'
comment-marker: '<!-- COMFYUI_FRONTEND_PR_REPORT -->'
token: ${{ github.token }}
# Deploy and comment for non-forked PRs only
# Deploy and upsert final playwright section for non-forked PRs only
deploy-and-comment:
needs: [changes, playwright-tests, merge-reports]
runs-on: ubuntu-latest
@@ -274,15 +273,34 @@ jobs:
pattern: playwright-report-*
path: reports
- name: Deploy reports and comment on PR
- name: Deploy reports and generate section
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
GITHUB_TOKEN: ${{ github.token }}
GITHUB_SHA: ${{ github.event.pull_request.head.sha }}
SUMMARY_FILE: playwright-section.md
BRANCH_NAME: ${{ github.head_ref }}
run: |
bash ./scripts/cicd/pr-playwright-deploy-and-comment.sh \
"${{ github.event.pull_request.number }}" \
"${{ github.head_ref }}" \
"$BRANCH_NAME" \
"completed"
- name: Read playwright section
id: section
if: ${{ !cancelled() && hashFiles('playwright-section.md') != '' }}
uses: juliangruber/read-file-action@b549046febe0fe86f8cb4f93c24e284433f9ab58 # v1.1.7
with:
path: playwright-section.md
- name: Upsert playwright section into unified report
if: ${{ !cancelled() && steps.section.outputs.content != '' }}
uses: ./.github/actions/upsert-comment-section
with:
pr-number: ${{ github.event.pull_request.number }}
section-name: playwright
section-content: ${{ steps.section.outputs.content }}
comment-marker: '<!-- COMFYUI_FRONTEND_PR_REPORT -->'
token: ${{ github.token }}
#### END Deployment and commenting (non-forked PRs only)

View File

@@ -38,16 +38,15 @@ jobs:
id: pr
uses: ./.github/actions/resolve-pr-from-workflow-run
- name: Handle Storybook Start
- name: Handle Storybook Start — upsert storybook starting section
if: steps.pr.outputs.skip != 'true' && github.event.action == 'requested'
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
chmod +x scripts/cicd/pr-storybook-deploy-and-comment.sh
./scripts/cicd/pr-storybook-deploy-and-comment.sh \
"${{ steps.pr.outputs.number }}" \
"${{ github.event.workflow_run.head_branch }}" \
"starting"
uses: ./.github/actions/upsert-comment-section
with:
pr-number: ${{ steps.pr.outputs.number }}
section-name: storybook
section-content: '## 🎨 Storybook: 🚧 Building...'
comment-marker: '<!-- COMFYUI_FRONTEND_PR_REPORT -->'
token: ${{ github.token }}
- name: Download and Deploy Storybook
if: steps.pr.outputs.skip != 'true' && github.event.action == 'completed' && github.event.workflow_run.conclusion == 'success'
@@ -58,7 +57,7 @@ jobs:
name: storybook-static
path: storybook-static
- name: Handle Storybook Completion
- name: Handle Storybook Completion — deploy and generate section
if: steps.pr.outputs.skip != 'true' && github.event.action == 'completed'
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
@@ -66,9 +65,28 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
WORKFLOW_CONCLUSION: ${{ github.event.workflow_run.conclusion }}
WORKFLOW_URL: ${{ github.event.workflow_run.html_url }}
SUMMARY_FILE: storybook-section.md
BRANCH_NAME: ${{ github.event.workflow_run.head_branch }}
run: |
chmod +x scripts/cicd/pr-storybook-deploy-and-comment.sh
./scripts/cicd/pr-storybook-deploy-and-comment.sh \
"${{ steps.pr.outputs.number }}" \
"${{ github.event.workflow_run.head_branch }}" \
"$BRANCH_NAME" \
"completed"
- name: Read storybook section
id: section
if: steps.pr.outputs.skip != 'true' && github.event.action == 'completed' && hashFiles('storybook-section.md') != ''
uses: juliangruber/read-file-action@b549046febe0fe86f8cb4f93c24e284433f9ab58 # v1.1.7
with:
path: storybook-section.md
- name: Upsert storybook section into unified report
if: steps.pr.outputs.skip != 'true' && github.event.action == 'completed' && steps.section.outputs.content != ''
uses: ./.github/actions/upsert-comment-section
with:
pr-number: ${{ steps.pr.outputs.number }}
section-name: storybook
section-content: ${{ steps.section.outputs.content }}
comment-marker: '<!-- COMFYUI_FRONTEND_PR_REPORT -->'
token: ${{ github.token }}

View File

@@ -37,15 +37,14 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v6
- name: Post starting comment
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
chmod +x scripts/cicd/pr-storybook-deploy-and-comment.sh
./scripts/cicd/pr-storybook-deploy-and-comment.sh \
"${{ github.event.pull_request.number }}" \
"${{ github.head_ref }}" \
"starting"
- name: Upsert storybook starting section into unified report
uses: ./.github/actions/upsert-comment-section
with:
pr-number: ${{ github.event.pull_request.number }}
section-name: storybook
section-content: '## 🎨 Storybook: 🚧 Building...'
comment-marker: '<!-- COMFYUI_FRONTEND_PR_REPORT -->'
token: ${{ github.token }}
# Build Storybook for all PRs (free Cloudflare deployment)
storybook-build:
@@ -164,19 +163,38 @@ jobs:
- name: Make deployment script executable
run: chmod +x scripts/cicd/pr-storybook-deploy-and-comment.sh
- name: Deploy Storybook and comment on PR
- name: Deploy Storybook and generate section
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
GITHUB_TOKEN: ${{ github.token }}
WORKFLOW_CONCLUSION: ${{ needs.storybook-build.outputs.conclusion }}
WORKFLOW_URL: ${{ needs.storybook-build.outputs.workflow-url }}
SUMMARY_FILE: storybook-section.md
BRANCH_NAME: ${{ github.head_ref }}
run: |
./scripts/cicd/pr-storybook-deploy-and-comment.sh \
"${{ github.event.pull_request.number }}" \
"${{ github.head_ref }}" \
"$BRANCH_NAME" \
"completed"
- name: Read storybook section
id: section
if: hashFiles('storybook-section.md') != ''
uses: juliangruber/read-file-action@b549046febe0fe86f8cb4f93c24e284433f9ab58 # v1.1.7
with:
path: storybook-section.md
- name: Upsert storybook section into unified report
if: steps.section.outputs.content != ''
uses: ./.github/actions/upsert-comment-section
with:
pr-number: ${{ github.event.pull_request.number }}
section-name: storybook
section-content: ${{ steps.section.outputs.content }}
comment-marker: '<!-- COMFYUI_FRONTEND_PR_REPORT -->'
token: ${{ github.token }}
# Deploy Storybook to production URL on main branch push
deploy-production:
runs-on: ubuntu-latest
@@ -208,35 +226,17 @@ jobs:
permissions:
pull-requests: write
steps:
- name: Update comment with Chromatic URLs
uses: actions/github-script@v8
- name: Checkout repository
uses: actions/checkout@v6
- name: Upsert Chromatic section into unified report
uses: ./.github/actions/upsert-comment-section
with:
script: |
const buildUrl = '${{ needs.chromatic-deployment.outputs.chromatic-build-url }}';
const storybookUrl = '${{ needs.chromatic-deployment.outputs.chromatic-storybook-url }}';
// Find the existing Storybook comment
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: ${{ github.event.pull_request.number }}
});
const storybookComment = comments.find(comment =>
comment.body.includes('<!-- STORYBOOK_BUILD_STATUS -->')
);
if (storybookComment && buildUrl && storybookUrl) {
// Append Chromatic info to existing comment
const updatedBody = storybookComment.body.replace(
/---\n(.*)$/s,
`---\n### 🎨 Chromatic Visual Tests\n- 📊 [View Chromatic Build](${buildUrl})\n- 📚 [View Chromatic Storybook](${storybookUrl})\n\n$1`
);
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: storybookComment.id,
body: updatedBody
});
}
pr-number: ${{ github.event.pull_request.number }}
section-name: chromatic
section-content: |
### 🎨 Chromatic Visual Tests
- 📊 [View Chromatic Build](${{ needs.chromatic-deployment.outputs.chromatic-build-url }})
- 📚 [View Chromatic Storybook](${{ needs.chromatic-deployment.outputs.chromatic-storybook-url }})
comment-marker: '<!-- COMFYUI_FRONTEND_PR_REPORT -->'
token: ${{ github.token }}

View File

@@ -185,7 +185,7 @@ jobs:
with:
pr-number: ${{ github.event.pull_request.number }}
section-name: e2e
comment-marker: '<!-- WEBSITE_CI_REPORT -->'
comment-marker: '<!-- COMFYUI_FRONTEND_PR_REPORT -->'
token: ${{ secrets.GITHUB_TOKEN }}
section-content: |-
## 🌐 Website E2E
@@ -265,6 +265,6 @@ jobs:
with:
pr-number: ${{ github.event.pull_request.number }}
section-name: e2e
comment-marker: '<!-- WEBSITE_CI_REPORT -->'
comment-marker: '<!-- COMFYUI_FRONTEND_PR_REPORT -->'
token: ${{ secrets.GITHUB_TOKEN }}
section-content: ${{ steps.content.outputs.section-content }}

55
.github/workflows/pr-cursor-review.yaml vendored Normal file
View File

@@ -0,0 +1,55 @@
# Description: Team-gated multi-model Cursor review — a thin caller for the
# reusable workflow in Comfy-Org/github-workflows, which is the single source of
# truth for the panel, judge, prompts, and scripts. Triggered by the
# 'cursor-review' label.
#
# Access control (team-only, two layers):
# 1. Only users with triage permission or higher can apply a label in a public
# repo, so the public cannot trigger this.
# 2. The reusable workflow's secret-bearing jobs do not run on fork PRs (forks
# get no secrets), so CURSOR_API_KEY is reachable only on internal branches.
name: 'PR: Cursor Review'
on:
pull_request:
types: [labeled, unlabeled]
permissions:
contents: read
pull-requests: write
concurrency:
# Re-labeling cancels an in-flight run for the same PR + label.
group: cursor-review-pr-${{ github.event.pull_request.number }}-${{ github.event.label.name }}
cancel-in-progress: true
jobs:
cursor-review:
if: github.event.action == 'labeled' && github.event.label.name == 'cursor-review'
# SHA-pinned per zizmor `unpinned-uses: hash-pin`. Bump this SHA to pick up
# upstream changes; keep `workflows_ref` matching so prompts/scripts load
# from the same commit as the workflow definition.
uses: Comfy-Org/github-workflows/.github/workflows/cursor-review.yml@047ca48febe3a6647608ed2e0c4331b491cb9d6a # github-workflows#9
with:
# Overriding diff_excludes replaces the reusable default wholesale, so
# this restates the generated/vendored defaults and adds this repo's heavy
# paths (Playwright snapshots, generated manager types).
diff_excludes: >-
:!**/package-lock.json
:!**/yarn.lock
:!**/pnpm-lock.yaml
:!**/node_modules/**
:!**/.claude/**
:!**/dist/**
:!**/vendor/**
:!**/*.generated.*
:!**/*.min.js
:!**/*.min.css
:!**/*-snapshots/**
:!src/workbench/extensions/manager/types/generatedManagerTypes.ts
# Load the prompts/scripts from the same ref as `uses:`.
workflows_ref: 047ca48febe3a6647608ed2e0c4331b491cb9d6a
secrets:
CURSOR_API_KEY: ${{ secrets.CURSOR_API_KEY }}
# Optional — enables start/complete Slack DMs to the triggerer.
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

View File

@@ -140,6 +140,9 @@ jobs:
const legacyMarkers = [
'<!-- COMFYUI_FRONTEND_SIZE -->',
'<!-- COMFYUI_FRONTEND_PERF -->',
'<!-- PLAYWRIGHT_TEST_STATUS -->',
'<!-- STORYBOOK_BUILD_STATUS -->',
'<!-- WEBSITE_CI_REPORT -->',
];
const comments = await github.paginate(github.rest.issues.listComments, {
@@ -160,11 +163,19 @@ jobs:
}
}
- name: Post PR comment
- name: Read PR report
id: report
if: steps.pr-meta.outputs.skip != 'true'
uses: ./.github/actions/post-pr-report-comment
uses: juliangruber/read-file-action@b549046febe0fe86f8cb4f93c24e284433f9ab58 # v1.1.7
with:
path: ./pr-report.md
- name: Upsert bundle/perf/coverage section into unified report
if: steps.pr-meta.outputs.skip != 'true'
uses: ./.github/actions/upsert-comment-section
with:
pr-number: ${{ steps.pr-meta.outputs.number }}
report-file: ./pr-report.md
section-name: ci-metrics
section-content: ${{ steps.report.outputs.content }}
comment-marker: '<!-- COMFYUI_FRONTEND_PR_REPORT -->'
token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -179,7 +179,7 @@ jobs:
with:
pr-number: ${{ github.event.number || github.event.issue.number }}
section-name: screenshot-update
comment-marker: '<!-- WEBSITE_CI_REPORT -->'
comment-marker: '<!-- COMFYUI_FRONTEND_PR_REPORT -->'
token: ${{ secrets.GITHUB_TOKEN }}
section-content: |-
## 📸 Screenshot Update
@@ -240,6 +240,6 @@ jobs:
with:
pr-number: ${{ needs.update-screenshots.outputs.pr-number }}
section-name: screenshot-update
comment-marker: '<!-- WEBSITE_CI_REPORT -->'
comment-marker: '<!-- COMFYUI_FRONTEND_PR_REPORT -->'
token: ${{ secrets.GITHUB_TOKEN }}
section-content: ${{ steps.content.outputs.section-content }}

View File

@@ -58,7 +58,7 @@ jobs:
with:
pr-number: ${{ steps.pr-meta.outputs.number }}
section-name: preview
comment-marker: '<!-- WEBSITE_CI_REPORT -->'
comment-marker: '<!-- COMFYUI_FRONTEND_PR_REPORT -->'
token: ${{ secrets.GITHUB_TOKEN }}
section-content: |-
## 🔗 Website Preview

View File

@@ -1385,9 +1385,9 @@ const translations = {
'zh-CN': '随时加购积分'
},
'pricing.included.feature5.description': {
en: 'Purchase additional credits at any time. Unused top-ups roll over to the next month automatically for up to 1 year.',
en: 'Purchase additional credits at any time. Top-up credits are valid for 1 year from the date of purchase and do not roll over with your monthly plan.',
'zh-CN':
'可随时购买额外积分。未使用的充值积分自动结转至下月,最长保留 1 年。'
'可随时购买额外积分。充值积分自购买之日起 1 年内有效,且不会随月度计划结转。'
},
'pricing.included.feature6.title': {
en: 'Pre-installed models',

View File

@@ -59,7 +59,7 @@ export class VueNodeHelpers {
* Matches against the actual title element, not the full node body.
* Use `.first()` for unique titles, `.nth(n)` for duplicates.
*/
getNodeByTitle(title: string): Locator {
getNodeByTitle(title: string | RegExp): Locator {
return this.page.locator('[data-node-id]').filter({
has: this.page.getByTestId('node-title').filter({ hasText: title })
})
@@ -145,7 +145,7 @@ export class VueNodeHelpers {
/**
* Resolve the data-node-id of the first rendered node matching the title.
*/
async getNodeIdByTitle(title: string): Promise<string> {
async getNodeIdByTitle(title: string | RegExp): Promise<string> {
const node = this.getNodeByTitle(title).first()
await node.waitFor({ state: 'visible' })
@@ -163,7 +163,7 @@ export class VueNodeHelpers {
* Return a DOM-focused VueNodeFixture for the first node matching the title.
* Resolves the node id up front so subsequent interactions survive title changes.
*/
async getFixtureByTitle(title: string): Promise<VueNodeFixture> {
async getFixtureByTitle(title: string | RegExp): Promise<VueNodeFixture> {
const nodeId = await this.getNodeIdByTitle(title)
return new VueNodeFixture(this.getNodeLocator(nodeId))
}

View File

@@ -0,0 +1,45 @@
import type { Page } from '@playwright/test'
function flagAttributeFor(testId: string) {
const encoded = Array.from(testId, (ch) =>
ch.charCodeAt(0).toString(16)
).join('')
return `data-flashed-${encoded}`
}
/**
* Flags the first time an element matching `[data-testid="<testId>"]` is
* present and rendered, sampled every frame via `requestAnimationFrame` from
* page load. Catches a dialog that mounts and unmounts within a few frames,
* which `toBeHidden()` (final state only) cannot.
*
* Must be called before navigation (e.g. before `comfyPage.setup()`).
*/
export async function trackElementFlash(
page: Page,
testId: string
): Promise<{ hasFlashed: () => Promise<boolean> }> {
const flagAttribute = flagAttributeFor(testId)
await page.addInitScript(
({ id, attribute }: { id: string; attribute: string }) => {
const sample = () => {
const el = document.querySelector(`[data-testid="${CSS.escape(id)}"]`)
if (el instanceof HTMLElement) {
const rect = el.getBoundingClientRect()
if (rect.width > 0 && rect.height > 0) {
document.documentElement.setAttribute(attribute, 'true')
}
}
requestAnimationFrame(sample)
}
requestAnimationFrame(sample)
},
{ id: testId, attribute: flagAttribute }
)
return {
hasFlashed: async () =>
(await page.locator('html').getAttribute(flagAttribute)) === 'true'
}
}

View File

@@ -34,6 +34,22 @@ test.describe('Properties panel - Node selection', () => {
await expect(panel.contentArea.getByText('seed')).toBeVisible()
await expect(panel.contentArea.getByText('steps')).toBeVisible()
})
test(
'a linked widget is disabled',
{ tag: '@vue-nodes' },
async ({ comfyPage }) => {
const seed = panel.contentArea.getByLabel('seed').locator('input')
await comfyPage.searchBoxV2.addNode('Int')
const intNode = await comfyPage.vueNodes.getFixtureByTitle(/Int/)
const ksampler = await comfyPage.vueNodes.getFixtureByTitle('KSampler')
await ksampler.select()
await expect(seed).toBeEnabled()
await intNode.getSlot('INT').dragTo(ksampler.getSlot('seed'))
await expect(seed).toBeDisabled()
}
)
})
test.describe('Multi-node', () => {

View File

@@ -15,6 +15,10 @@ import { createMixedMediaJobs } from '@e2e/fixtures/helpers/AssetsHelper'
// fixtures — Playwright runs auto fixtures before the `comfyPage` fixture's
// internal `setup()`, so the page first-loads with mocks already in place.
// See cloud-asset-default.spec.ts for the same pattern.
//
// Use `waitForAssets()` not `waitForAssets(MIXED_JOBS.length)`: VirtualGrid can
// virtualize the 3D card out of the initial render (#11635). Filtering reads the
// full store, so the per-filter count assertions still cover the behavior.
const MIXED_JOBS = createMixedMediaJobs(['images', 'video', 'audio', '3D'])
@@ -113,7 +117,7 @@ test.describe('Assets sidebar - media type filter', { tag: '@cloud' }, () => {
}) => {
const tab = comfyPage.menu.assetsTab
await tab.open()
await tab.waitForAssets(MIXED_JOBS.length)
await tab.waitForAssets()
await tab.openFilterMenu()
@@ -136,7 +140,7 @@ test.describe('Assets sidebar - media type filter', { tag: '@cloud' }, () => {
}) => {
const tab = comfyPage.menu.assetsTab
await tab.open()
await tab.waitForAssets(MIXED_JOBS.length)
await tab.waitForAssets()
await tab.openFilterMenu()
await tab.toggleMediaTypeFilter('image')
@@ -153,7 +157,7 @@ test.describe('Assets sidebar - media type filter', { tag: '@cloud' }, () => {
}) => {
const tab = comfyPage.menu.assetsTab
await tab.open()
await tab.waitForAssets(MIXED_JOBS.length)
await tab.waitForAssets()
await tab.openFilterMenu()
await tab.toggleMediaTypeFilter('video')
@@ -167,7 +171,7 @@ test.describe('Assets sidebar - media type filter', { tag: '@cloud' }, () => {
}) => {
const tab = comfyPage.menu.assetsTab
await tab.open()
await tab.waitForAssets(MIXED_JOBS.length)
await tab.waitForAssets()
await tab.openFilterMenu()
await tab.toggleMediaTypeFilter('audio')
@@ -179,7 +183,7 @@ test.describe('Assets sidebar - media type filter', { tag: '@cloud' }, () => {
test('Selecting only "3D" hides non-3D assets', async ({ comfyPage }) => {
const tab = comfyPage.menu.assetsTab
await tab.open()
await tab.waitForAssets(MIXED_JOBS.length)
await tab.waitForAssets()
await tab.openFilterMenu()
await tab.toggleMediaTypeFilter('3d')
@@ -193,7 +197,7 @@ test.describe('Assets sidebar - media type filter', { tag: '@cloud' }, () => {
}) => {
const tab = comfyPage.menu.assetsTab
await tab.open()
await tab.waitForAssets(MIXED_JOBS.length)
await tab.waitForAssets()
await tab.openFilterMenu()
await tab.toggleMediaTypeFilter('image')
@@ -211,7 +215,7 @@ test.describe('Assets sidebar - media type filter', { tag: '@cloud' }, () => {
}) => {
const tab = comfyPage.menu.assetsTab
await tab.open()
await tab.waitForAssets(MIXED_JOBS.length)
await tab.waitForAssets()
await tab.openFilterMenu()
await tab.toggleMediaTypeFilter('image')

View File

@@ -5,6 +5,7 @@ import type { WorkflowTemplates } from '@/platform/workflow/templates/types/temp
import { getWav } from '@e2e/fixtures/components/AudioPreview'
import { comfyPageFixture as test } from '@e2e/fixtures/ComfyPage'
import { TestIds } from '@e2e/fixtures/selectors'
import { trackElementFlash } from '@e2e/fixtures/utils/flashDetector'
async function checkTemplateFileExists(
page: Page,
@@ -505,3 +506,32 @@ test.describe('Templates', { tag: ['@slow', '@workflow'] }, () => {
expect(popup.url()).toEqual(tutorialUrl)
})
})
test.describe(
'Templates deeplink (new user)',
{ tag: ['@slow', '@workflow'] },
() => {
test('templates dialog never flashes when first-time user opens a template link', async ({
comfyPage
}) => {
const templatesFlash = await trackElementFlash(
comfyPage.page,
TestIds.templates.content
)
await comfyPage.settings.setSetting('Comfy.TutorialCompleted', false)
await comfyPage.setup({
clearStorage: true,
url: '/?template=default'
})
await expect
.poll(() => comfyPage.nodeOps.getGraphNodesCount())
.toBeGreaterThan(0)
expect(await templatesFlash.hasFlashed()).toBe(false)
await expect(comfyPage.templates.content).toBeHidden()
})
}
)

View File

@@ -1,3 +1,5 @@
import type { UploadImageResponse } from '@comfyorg/ingest-types'
import {
comfyExpect as expect,
comfyPageFixture as test
@@ -23,4 +25,42 @@ test.describe('Vue Upload Widgets', { tag: '@vue-nodes' }, () => {
)
.toBeGreaterThan(0)
})
test('shows a spinner during upload', async ({ comfyPage }) => {
let releaseUpload: () => void = () => {}
const uploadResponse: UploadImageResponse = { name: 'spinner-test.png' }
await comfyPage.page.route('**/upload/image', async (route) => {
await new Promise<void>((resolve) => {
releaseUpload = resolve
})
await route.fulfill({
status: 200,
contentType: 'application/json',
body: JSON.stringify(uploadResponse)
})
})
for (const nodeName of ['Load Image', 'Load Video', 'Load Audio']) {
await test.step(`for ${nodeName}`, async () => {
await comfyPage.menu.topbar.newWorkflowButton.click()
await comfyPage.nextFrame()
await comfyPage.searchBoxV2.addNode(nodeName)
const node = comfyPage.vueNodes.getNodeByTitle(nodeName)
const fileInput = node.locator('input[type="file"]')
const spinner = node.getByRole('status')
await expect(spinner).toBeHidden()
await fileInput.setInputFiles({
name: 'spinner-test.png',
mimeType: 'image/png',
buffer: Buffer.from('test')
})
await expect(spinner).toBeVisible()
releaseUpload()
await expect(spinner).toBeHidden()
})
}
})
})

View File

@@ -4,3 +4,14 @@ comment:
require_changes: false
require_base: false
require_head: true
# Carry forward the last known coverage for a flag when its upload is missing or
# late. The `e2e` flag is uploaded by a separate workflow_run job that can fail
# or arrive after Codecov has already computed the patch status; without this,
# E2E-only code paths show up as patch misses and the patch status fails. See
# https://docs.codecov.com/docs/carryforward-flags
flags:
unit:
carryforward: true
e2e:
carryforward: true

View File

@@ -1,8 +1,13 @@
#!/bin/bash
set -e
# Deploy Playwright test reports to Cloudflare Pages and comment on PR
# Deploy Playwright test reports to Cloudflare Pages and write section markdown.
# Usage: ./pr-playwright-deploy-and-comment.sh <pr_number> <branch_name> <status>
#
# When SUMMARY_FILE env var is set, the generated markdown is written there
# instead of posted as a standalone GitHub comment. The caller is then
# responsible for upserting that content into the unified PR report via the
# upsert-comment-section action.
# Input validation
# Validate PR number is numeric
@@ -103,17 +108,28 @@ deploy_report() {
echo "failed"
}
# Post or update GitHub comment
# Post or update GitHub comment, or write to SUMMARY_FILE if set.
# When SUMMARY_FILE is set, the caller (workflow) is responsible for upserting
# the content into the unified PR report via upsert-comment-section.
# The gh-api branch below is unused in CI (SUMMARY_FILE is always set there);
# it is retained for local/standalone runs that post a comment directly.
post_comment() {
body="$1"
if [ -n "${SUMMARY_FILE:-}" ]; then
printf '%s\n' "$body" > "$SUMMARY_FILE" || { echo "Failed to write $SUMMARY_FILE" >&2; exit 1; }
echo "Wrote playwright section to $SUMMARY_FILE" >&2
return
fi
temp_file=$(mktemp)
echo "$body" > "$temp_file"
if command -v gh > /dev/null 2>&1; then
# Find existing comment ID
existing=$(gh api "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/comments" \
--jq ".[] | select(.body | contains(\"$COMMENT_MARKER\")) | .id" | head -1)
if [ -n "$existing" ]; then
# Update specific comment by ID
gh api --method PATCH "repos/$GITHUB_REPOSITORY/issues/comments/$existing" \
@@ -126,15 +142,20 @@ post_comment() {
echo "GitHub CLI not available, outputting comment:"
cat "$temp_file"
fi
rm -f "$temp_file"
}
# Main execution
if [ "$STATUS" = "starting" ]; then
# Post concise starting comment
comment="$COMMENT_MARKER
# When writing to SUMMARY_FILE, omit the standalone marker (the upsert
# action uses its own section delimiters).
if [ -n "${SUMMARY_FILE:-}" ]; then
comment="## 🎭 Playwright: ⏳ Running..."
else
comment="$COMMENT_MARKER
## 🎭 Playwright: ⏳ Running..."
fi
post_comment "$comment"
else
@@ -281,9 +302,14 @@ else
flaky_note=" · $total_flaky flaky"
fi
# Generate compact single-line comment
comment="$COMMENT_MARKER
# Generate compact single-line comment (omit standalone marker when writing
# to SUMMARY_FILE — the upsert action adds its own section delimiters).
if [ -n "${SUMMARY_FILE:-}" ]; then
comment="## 🎭 Playwright: $status_icon $total_passed passed, $total_failed failed$flaky_note"
else
comment="$COMMENT_MARKER
## 🎭 Playwright: $status_icon $total_passed passed, $total_failed failed$flaky_note"
fi
# Extract and display failed tests from all browsers (flaky tests are treated as passing)
if [ $total_failed -gt 0 ]; then

View File

@@ -1,8 +1,13 @@
#!/bin/bash
set -e
# Deploy Storybook to Cloudflare Pages and comment on PR
# Deploy Storybook to Cloudflare Pages and write section markdown.
# Usage: ./pr-storybook-deploy-and-comment.sh <pr_number> <branch_name> <status>
#
# When SUMMARY_FILE env var is set, the generated markdown is written there
# instead of posted as a standalone GitHub comment. The caller is then
# responsible for upserting that content into the unified PR report via the
# upsert-comment-section action.
# Input validation
# Validate PR number is numeric
@@ -91,17 +96,26 @@ deploy_storybook() {
echo "failed"
}
# Post or update GitHub comment
# Post or update GitHub comment, or write to SUMMARY_FILE if set.
# When SUMMARY_FILE is set, the caller (workflow) is responsible for upserting
# the content into the unified PR report via upsert-comment-section.
post_comment() {
body="$1"
if [ -n "${SUMMARY_FILE:-}" ]; then
printf '%s\n' "$body" > "$SUMMARY_FILE" || { echo "Failed to write $SUMMARY_FILE" >&2; exit 1; }
echo "Wrote storybook section to $SUMMARY_FILE" >&2
return
fi
temp_file=$(mktemp)
echo "$body" > "$temp_file"
if command -v gh > /dev/null 2>&1; then
# Find existing comment ID
existing=$(gh api "repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/comments" \
--jq ".[] | select(.body | contains(\"$COMMENT_MARKER\")) | .id" | head -1)
if [ -n "$existing" ]; then
# Update specific comment by ID
gh api --method PATCH "repos/$GITHUB_REPOSITORY/issues/comments/$existing" \
@@ -113,15 +127,20 @@ post_comment() {
echo "GitHub CLI not available, outputting comment:"
cat "$temp_file"
fi
rm -f "$temp_file"
}
# Main execution
if [ "$STATUS" = "starting" ]; then
# Post starting comment
comment="$COMMENT_MARKER
# When writing to SUMMARY_FILE, omit the standalone marker (the upsert
# action uses its own section delimiters).
if [ -n "${SUMMARY_FILE:-}" ]; then
comment="## 🎨 Storybook: <img alt='loading' src='https://github.com/user-attachments/assets/755c86ee-e445-4ea8-bc2c-cca85df48686' width='14px' height='14px'/> Building..."
else
comment="$COMMENT_MARKER
## 🎨 Storybook: <img alt='loading' src='https://github.com/user-attachments/assets/755c86ee-e445-4ea8-bc2c-cca85df48686' width='14px' height='14px'/> Building..."
fi
post_comment "$comment"
elif [ "$STATUS" = "completed" ]; then
@@ -197,10 +216,18 @@ elif [ "$STATUS" = "completed" ]; then
</details>"
comment="$COMMENT_MARKER
# Omit standalone marker when writing to SUMMARY_FILE — the upsert action
# adds its own section delimiters.
if [ -n "${SUMMARY_FILE:-}" ]; then
comment="$header
$details"
else
comment="$COMMENT_MARKER
$header
$details"
fi
post_comment "$comment"
fi
fi

View File

@@ -316,12 +316,16 @@ function renderFullReport(
lines.push(
`⚠️ **${flaggedRows.length} regression${flaggedRows.length > 1 ? 's' : ''} detected**`,
'',
'<details><summary>Show regressions</summary>',
'',
...tableHeader,
...flaggedRows,
'',
'</details>',
''
)
} else {
lines.push('No regressions detected.', '')
lines.push('No regressions detected.', '')
}
lines.push(
@@ -393,6 +397,8 @@ function renderColdStartReport(
lines.push(
`> Collecting baseline variance data (${historicalCount}/15 runs). Significance will appear after 2 main branch runs.`,
'',
'<details><summary>All metrics (cold start)</summary>',
'',
'| Metric | Baseline | PR | Δ |',
'|--------|----------|-----|---|'
)
@@ -430,6 +436,7 @@ function renderColdStartReport(
}
}
lines.push('', '</details>')
return lines
}
@@ -438,7 +445,10 @@ function renderNoBaselineReport(
): string[] {
const lines: string[] = []
lines.push(
'No baseline found — showing absolute values.\n',
'> No baseline found — significance unavailable.',
'',
'<details><summary>Absolute values</summary>',
'',
'| Metric | Value |',
'|--------|-------|'
)
@@ -449,6 +459,7 @@ function renderNoBaselineReport(
lines.push(`| ${testName}: ${label} | ${formatValue(prVal, unit)} |`)
}
}
lines.push('', '</details>')
return lines
}

View File

@@ -7,12 +7,26 @@ import { createI18n } from 'vue-i18n'
import ErrorOverlay from './ErrorOverlay.vue'
import { useExecutionErrorStore } from '@/stores/executionErrorStore'
import type { NodeError } from '@/schemas/apiSchema'
import type {
MissingPackGroup,
SwapNodeGroup
} from '@/components/rightSidePanel/errors/useErrorGroups'
import type { ErrorGroup } from '@/components/rightSidePanel/errors/types'
import type { MissingMediaGroup } from '@/platform/missingMedia/types'
import type { MissingModelGroup } from '@/platform/missingModel/types'
const mockAllErrorGroups = vi.hoisted(() => ({ value: [] as ErrorGroup[] }))
const mockErrorGroups = vi.hoisted(() => ({
allErrorGroups: { value: [] as ErrorGroup[] },
missingPackGroups: { value: [] as MissingPackGroup[] },
missingModelGroups: { value: [] as MissingModelGroup[] },
missingMediaGroups: { value: [] as MissingMediaGroup[] },
swapNodeGroups: { value: [] as SwapNodeGroup[] }
}))
const mockAllErrorGroups = mockErrorGroups.allErrorGroups
vi.mock('@/components/rightSidePanel/errors/useErrorGroups', () => ({
useErrorGroups: () => ({ allErrorGroups: mockAllErrorGroups })
useErrorGroups: () => mockErrorGroups
}))
vi.mock('@/composables/graph/useNodeErrorFlagSync', () => ({
@@ -62,7 +76,6 @@ function createTestI18n() {
dismiss: 'Dismiss'
},
errorOverlay: {
errorCount: '{count} ERROR | {count} ERRORS',
multipleErrorCount: '{count} error found | {count} errors found',
multipleErrorsMessage: 'Resolve them before running the workflow.',
viewDetails: 'View details'
@@ -108,6 +121,10 @@ function renderOverlay(props: { appMode?: boolean } = {}) {
describe('ErrorOverlay', () => {
beforeEach(() => {
mockAllErrorGroups.value = []
mockErrorGroups.missingPackGroups.value = []
mockErrorGroups.missingModelGroups.value = []
mockErrorGroups.missingMediaGroups.value = []
mockErrorGroups.swapNodeGroups.value = []
mockOpenPanel.mockClear()
mockCanvasStore.linearMode = false
mockCanvasStore.canvas = null
@@ -116,17 +133,12 @@ describe('ErrorOverlay', () => {
})
it('renders a single overlay message without list markup', async () => {
renderOverlay()
const executionErrorStore = useExecutionErrorStore()
executionErrorStore.lastNodeErrors = {
'1': makeNodeError(['Only error'])
}
mockAllErrorGroups.value = [
{
type: 'execution',
groupKey: 'execution:KSampler',
displayTitle: 'Execution failed',
count: 1,
priority: 0,
cards: [
{
@@ -137,6 +149,12 @@ describe('ErrorOverlay', () => {
]
}
]
renderOverlay()
const executionErrorStore = useExecutionErrorStore()
executionErrorStore.lastNodeErrors = {
'1': makeNodeError(['Only error'])
}
executionErrorStore.showErrorOverlay()
await nextTick()
@@ -145,21 +163,19 @@ describe('ErrorOverlay', () => {
expect(screen.getByTestId('error-overlay-see-errors')).toHaveTextContent(
'View details'
)
expect(screen.getByTestId('error-overlay-dismiss')).toHaveAccessibleName(
'Close'
)
expect(screen.queryByRole('list')).not.toBeInTheDocument()
})
it('keeps the app mode button label', async () => {
renderOverlay({ appMode: true })
const executionErrorStore = useExecutionErrorStore()
executionErrorStore.lastNodeErrors = {
'1': makeNodeError(['Only error'])
}
mockAllErrorGroups.value = [
{
type: 'execution',
groupKey: 'execution:KSampler',
displayTitle: 'Execution failed',
count: 1,
priority: 0,
cards: [
{
@@ -170,6 +186,12 @@ describe('ErrorOverlay', () => {
]
}
]
renderOverlay({ appMode: true })
const executionErrorStore = useExecutionErrorStore()
executionErrorStore.lastNodeErrors = {
'1': makeNodeError(['Only error'])
}
executionErrorStore.showErrorOverlay()
await nextTick()

View File

@@ -7,47 +7,35 @@
<div v-if="isVisible" class="pointer-events-none flex w-full justify-end">
<div
role="status"
aria-live="polite"
data-testid="error-overlay"
class="pointer-events-auto flex w-fit max-w-120 min-w-80 flex-col overflow-hidden rounded-lg border border-destructive-background bg-comfy-menu-bg shadow-interface transition-colors duration-200 ease-in-out"
class="pointer-events-auto relative flex w-fit max-w-120 min-w-80 flex-col gap-2 overflow-hidden rounded-lg border border-l-4 border-border-default border-l-destructive-background bg-base-background p-3 shadow-interface transition-colors duration-200 ease-in-out"
>
<!-- Header -->
<div class="flex h-12 items-center gap-2 px-4">
<span class="flex-1 text-sm font-bold text-destructive-background">
<div class="flex w-full items-start gap-2 pr-8">
<i
class="mt-0.5 icon-[lucide--circle-x] size-4 shrink-0 text-destructive-background"
/>
<span class="min-w-0 flex-1 truncate text-sm text-base-foreground">
{{ overlayTitle }}
</span>
<Button
variant="muted-textonly"
size="icon-sm"
:aria-label="t('g.close')"
@click="dismiss"
>
<i class="icon-[lucide--x] block size-5 leading-none" />
</Button>
</div>
<!-- Body -->
<div class="px-4 pb-3" data-testid="error-overlay-messages">
<div
class="flex w-full items-start gap-2 pr-8"
data-testid="error-overlay-messages"
>
<span class="size-4 shrink-0" aria-hidden="true" />
<p
class="m-0 line-clamp-3 text-sm/snug wrap-break-word whitespace-pre-wrap text-muted-foreground"
class="m-0 line-clamp-3 min-w-0 flex-1 text-sm/snug wrap-break-word whitespace-pre-wrap text-muted-foreground"
>
{{ overlayMessage }}
</p>
</div>
<!-- Footer -->
<div class="flex items-center justify-end gap-4 px-4 py-3">
<Button
variant="muted-textonly"
size="unset"
data-testid="error-overlay-dismiss"
@click="dismiss"
>
{{ t('g.dismiss') }}
</Button>
<div class="flex w-full items-center justify-end pt-2">
<Button
variant="secondary"
size="lg"
size="unset"
class="min-h-8 rounded-lg px-3 py-2 text-xs font-normal"
data-testid="error-overlay-see-errors"
@click="seeErrors"
>
@@ -58,6 +46,17 @@
}}
</Button>
</div>
<Button
variant="muted-textonly"
size="icon-sm"
class="absolute top-2 right-2 size-6 rounded-sm"
data-testid="error-overlay-dismiss"
:aria-label="t('g.close')"
@click="dismiss"
>
<i class="icon-[lucide--x] block size-4 leading-none" />
</Button>
</div>
</div>
</Transition>

View File

@@ -8,12 +8,26 @@ import { useErrorOverlayState } from './useErrorOverlayState'
import { useExecutionErrorStore } from '@/stores/executionErrorStore'
import { useMissingMediaStore } from '@/platform/missingMedia/missingMediaStore'
import type { NodeError } from '@/schemas/apiSchema'
import type {
MissingPackGroup,
SwapNodeGroup
} from '@/components/rightSidePanel/errors/useErrorGroups'
import type { ErrorGroup } from '@/components/rightSidePanel/errors/types'
import type { MissingMediaGroup } from '@/platform/missingMedia/types'
import type { MissingModelGroup } from '@/platform/missingModel/types'
const mockAllErrorGroups = vi.hoisted(() => ({ value: [] as ErrorGroup[] }))
const mockErrorGroups = vi.hoisted(() => ({
allErrorGroups: { value: [] as ErrorGroup[] },
missingPackGroups: { value: [] as MissingPackGroup[] },
missingModelGroups: { value: [] as MissingModelGroup[] },
missingMediaGroups: { value: [] as MissingMediaGroup[] },
swapNodeGroups: { value: [] as SwapNodeGroup[] }
}))
const mockAllErrorGroups = mockErrorGroups.allErrorGroups
vi.mock('@/components/rightSidePanel/errors/useErrorGroups', () => ({
useErrorGroups: () => ({ allErrorGroups: mockAllErrorGroups })
useErrorGroups: () => mockErrorGroups
}))
vi.mock('@/composables/graph/useNodeErrorFlagSync', () => ({
@@ -44,7 +58,6 @@ function createTestI18n() {
messages: {
en: {
errorOverlay: {
errorCount: '{count} ERROR | {count} ERRORS',
multipleErrorCount: '{count} error found | {count} errors found',
multipleErrorsMessage: 'Resolve them before running the workflow.'
}
@@ -92,20 +105,19 @@ function mountOverlayState() {
describe('useErrorOverlayState', () => {
beforeEach(() => {
mockAllErrorGroups.value = []
mockErrorGroups.missingPackGroups.value = []
mockErrorGroups.missingModelGroups.value = []
mockErrorGroups.missingMediaGroups.value = []
mockErrorGroups.swapNodeGroups.value = []
})
it('uses the raw message for a single uncataloged execution error', async () => {
mountOverlayState()
const executionErrorStore = useExecutionErrorStore()
executionErrorStore.lastNodeErrors = {
'1': makeNodeError(['Only error'])
}
mockAllErrorGroups.value = [
{
type: 'execution',
groupKey: 'execution:KSampler',
displayTitle: 'Execution failed',
count: 1,
priority: 0,
cards: [
{
@@ -116,6 +128,12 @@ describe('useErrorOverlayState', () => {
]
}
]
mountOverlayState()
const executionErrorStore = useExecutionErrorStore()
executionErrorStore.lastNodeErrors = {
'1': makeNodeError(['Only error'])
}
executionErrorStore.showErrorOverlay()
await nextTick()
@@ -125,17 +143,12 @@ describe('useErrorOverlayState', () => {
})
it('uses toast copy for a single validation error', async () => {
mountOverlayState()
const executionErrorStore = useExecutionErrorStore()
executionErrorStore.lastNodeErrors = {
'1': makeNodeError(['Required input is missing'])
}
mockAllErrorGroups.value = [
{
type: 'execution',
groupKey: 'execution:KSampler',
displayTitle: 'Required input is missing',
count: 1,
priority: 0,
cards: [
{
@@ -152,6 +165,12 @@ describe('useErrorOverlayState', () => {
]
}
]
mountOverlayState()
const executionErrorStore = useExecutionErrorStore()
executionErrorStore.lastNodeErrors = {
'1': makeNodeError(['Required input is missing'])
}
executionErrorStore.showErrorOverlay()
await nextTick()
@@ -164,17 +183,12 @@ describe('useErrorOverlayState', () => {
})
it('uses display copy before raw copy when toast copy is absent', async () => {
mountOverlayState()
const executionErrorStore = useExecutionErrorStore()
executionErrorStore.lastNodeErrors = {
'1': makeNodeError(['Raw validation error'])
}
mockAllErrorGroups.value = [
{
type: 'execution',
groupKey: 'execution:KSampler',
displayTitle: 'Friendly validation title',
count: 1,
priority: 0,
cards: [
{
@@ -190,6 +204,12 @@ describe('useErrorOverlayState', () => {
]
}
]
mountOverlayState()
const executionErrorStore = useExecutionErrorStore()
executionErrorStore.lastNodeErrors = {
'1': makeNodeError(['Raw validation error'])
}
executionErrorStore.showErrorOverlay()
await nextTick()
@@ -202,24 +222,12 @@ describe('useErrorOverlayState', () => {
})
it('uses toast copy for a single runtime error', async () => {
mountOverlayState()
const executionErrorStore = useExecutionErrorStore()
executionErrorStore.lastExecutionError = {
prompt_id: 'prompt',
node_id: 1,
node_type: 'KSampler',
executed: [],
exception_message: 'CUDA out of memory',
exception_type: 'torch.OutOfMemoryError',
traceback: [],
timestamp: Date.now()
}
mockAllErrorGroups.value = [
{
type: 'execution',
groupKey: 'execution:KSampler',
displayTitle: 'Generation failed',
count: 1,
priority: 0,
cards: [
{
@@ -237,6 +245,19 @@ describe('useErrorOverlayState', () => {
]
}
]
mountOverlayState()
const executionErrorStore = useExecutionErrorStore()
executionErrorStore.lastExecutionError = {
prompt_id: 'prompt',
node_id: 1,
node_type: 'KSampler',
executed: [],
exception_message: 'CUDA out of memory',
exception_type: 'torch.OutOfMemoryError',
traceback: [],
timestamp: Date.now()
}
executionErrorStore.showErrorOverlay()
await nextTick()
@@ -247,6 +268,44 @@ describe('useErrorOverlayState', () => {
})
it('uses group toast copy for a single missing media error', async () => {
mockErrorGroups.missingMediaGroups.value = [
{
mediaType: 'image',
items: [
{
name: 'image.png',
mediaType: 'image',
representative: {
nodeId: '1',
nodeType: 'LoadImage',
widgetName: 'image',
mediaType: 'image',
name: 'image.png',
isMissing: true
},
referencingNodes: [
{
nodeId: '1',
nodeType: 'LoadImage',
widgetName: 'image'
}
]
}
]
}
]
mockAllErrorGroups.value = [
{
type: 'missing_media',
groupKey: 'missing_media',
displayTitle: 'Media input missing',
displayMessage: 'A required media input has no file selected.',
toastTitle: 'Media input missing',
toastMessage: 'Load Image is missing a required media file.',
count: 1,
priority: 3
}
]
mountOverlayState()
const executionErrorStore = useExecutionErrorStore()
@@ -261,17 +320,6 @@ describe('useErrorOverlayState', () => {
isMissing: true
}
])
mockAllErrorGroups.value = [
{
type: 'missing_media',
groupKey: 'missing_media',
displayTitle: 'Media input missing',
displayMessage: 'A required media input has no file selected.',
toastTitle: 'Media input missing',
toastMessage: 'Load Image is missing a required media file.',
priority: 3
}
]
executionErrorStore.showErrorOverlay()
await nextTick()
@@ -281,6 +329,147 @@ describe('useErrorOverlayState', () => {
)
})
it('uses group copy for one missing model referenced by multiple nodes', async () => {
mockErrorGroups.missingModelGroups.value = [
{
directory: 'checkpoints',
isAssetSupported: true,
models: [
{
name: 'missing.safetensors',
representative: {
nodeId: '1',
nodeType: 'CheckpointLoaderSimple',
widgetName: 'ckpt_name',
name: 'missing.safetensors',
directory: 'checkpoints',
isAssetSupported: true,
isMissing: true
},
referencingNodes: [
{ nodeId: '1', widgetName: 'ckpt_name' },
{ nodeId: '2', widgetName: 'ckpt_name' }
]
}
]
}
]
mockAllErrorGroups.value = [
{
type: 'missing_model',
groupKey: 'missing_model',
displayTitle: 'Missing Models',
displayMessage: 'Import a model, or open the node to replace it.',
toastTitle: 'Model missing',
toastMessage: 'CheckpointLoaderSimple is missing missing.safetensors.',
count: 1,
priority: 2
}
]
mountOverlayState()
const executionErrorStore = useExecutionErrorStore()
executionErrorStore.showErrorOverlay()
await nextTick()
expect(screen.getByTestId('title')).toHaveTextContent('Missing Models')
expect(screen.getByTestId('message')).toHaveTextContent(
'Import a model, or open the node to replace it.'
)
})
it('uses group copy for one execution group with multiple errors', async () => {
mockAllErrorGroups.value = [
{
type: 'execution',
groupKey: 'execution:required_input_missing',
displayTitle: 'Missing connection',
displayMessage: 'Required input slots have no connection feeding them.',
count: 2,
priority: 1,
cards: [
{
id: '1',
title: 'KSampler',
errors: [
{ message: 'KSampler is missing model' },
{ message: 'KSampler is missing positive' }
]
}
]
}
]
mountOverlayState()
const executionErrorStore = useExecutionErrorStore()
executionErrorStore.showErrorOverlay()
await nextTick()
expect(screen.getByTestId('title')).toHaveTextContent('Missing connection')
expect(screen.getByTestId('message')).toHaveTextContent(
'Required input slots have no connection feeding them.'
)
})
it('uses aggregate copy for one missing model group with multiple rows', async () => {
mockErrorGroups.missingModelGroups.value = [
{
directory: 'checkpoints',
isAssetSupported: true,
models: [
{
name: 'first.safetensors',
representative: {
nodeId: '1',
nodeType: 'CheckpointLoaderSimple',
widgetName: 'ckpt_name',
name: 'first.safetensors',
directory: 'checkpoints',
isAssetSupported: true,
isMissing: true
},
referencingNodes: [{ nodeId: '1', widgetName: 'ckpt_name' }]
},
{
name: 'second.safetensors',
representative: {
nodeId: '2',
nodeType: 'CheckpointLoaderSimple',
widgetName: 'ckpt_name',
name: 'second.safetensors',
directory: 'checkpoints',
isAssetSupported: true,
isMissing: true
},
referencingNodes: [{ nodeId: '2', widgetName: 'ckpt_name' }]
}
]
}
]
mockAllErrorGroups.value = [
{
type: 'missing_model',
groupKey: 'missing_model',
displayTitle: 'Missing Models',
displayMessage: 'Import a model, or open the node to replace it.',
toastTitle: 'Missing models',
toastMessage: '2 model files are missing.',
count: 2,
priority: 2
}
]
mountOverlayState()
const executionErrorStore = useExecutionErrorStore()
executionErrorStore.showErrorOverlay()
await nextTick()
expect(screen.getByTestId('title')).toHaveTextContent('2 errors found')
expect(screen.getByTestId('message')).toHaveTextContent(
'Resolve them before running the workflow.'
)
})
it('does not show when a raw error has no resolved overlay message', async () => {
mountOverlayState()
@@ -295,26 +484,14 @@ describe('useErrorOverlayState', () => {
expect(screen.getByTestId('message')).toBeEmptyDOMElement()
})
it('uses aggregate copy for multiple errors', async () => {
mountOverlayState()
const executionErrorStore = useExecutionErrorStore()
executionErrorStore.lastNodeErrors = {
'1': makeNodeError([
'First error',
'Second error',
'Third error',
'Fourth error',
'Fifth error',
'Sixth error',
'Seventh error'
])
}
it('uses grouped error counts for aggregate copy', async () => {
mockAllErrorGroups.value = [
{
type: 'execution',
groupKey: 'execution:KSampler',
displayTitle: 'Execution failed',
displayMessage: 'First group message',
count: 2,
priority: 0,
cards: [
{
@@ -323,13 +500,31 @@ describe('useErrorOverlayState', () => {
errors: [{ message: 'First error' }]
}
]
},
{
type: 'execution',
groupKey: 'execution:CLIPTextEncode',
displayTitle: 'Invalid CLIP input',
displayMessage: 'Second group message',
count: 3,
priority: 1,
cards: [
{
id: '2',
title: 'CLIPTextEncode',
errors: [{ message: 'Second error' }]
}
]
}
]
mountOverlayState()
const executionErrorStore = useExecutionErrorStore()
executionErrorStore.showErrorOverlay()
await nextTick()
expect(screen.getByTestId('visible')).toHaveTextContent('true')
expect(screen.getByTestId('title')).toHaveTextContent('7 errors found')
expect(screen.getByTestId('title')).toHaveTextContent('5 errors found')
expect(screen.getByTestId('message')).toHaveTextContent(
'Resolve them before running the workflow.'
)

View File

@@ -4,11 +4,17 @@ import { storeToRefs } from 'pinia'
import { useExecutionErrorStore } from '@/stores/executionErrorStore'
import { useErrorGroups } from '@/components/rightSidePanel/errors/useErrorGroups'
import type {
MissingPackGroup,
SwapNodeGroup
} from '@/components/rightSidePanel/errors/useErrorGroups'
import type { ErrorGroup } from '@/components/rightSidePanel/errors/types'
import type { MissingMediaGroup } from '@/platform/missingMedia/types'
import type { MissingModelGroup } from '@/platform/missingModel/types'
function resolveSingleOverlayCopy(
group: ErrorGroup
): { title?: string; message: string } | undefined {
type OverlayCopy = { title?: string; message: string }
function resolveSingleOverlayCopy(group: ErrorGroup): OverlayCopy | undefined {
if (group.type === 'execution') {
const [card] = group.cards
const [error] = card?.errors ?? []
@@ -37,27 +43,119 @@ function resolveSingleOverlayCopy(
}
}
function resolveGroupOverlayCopy(group: ErrorGroup): OverlayCopy | undefined {
const message =
group.displayMessage ?? group.toastMessage ?? group.displayTitle
if (!message) return undefined
return {
title: group.displayTitle,
message
}
}
function countMissingNodeReferences(groups: MissingPackGroup[]): number {
return groups.reduce((count, group) => count + group.nodeTypes.length, 0)
}
function countSwapNodeReferences(groups: SwapNodeGroup[]): number {
return groups.reduce((count, group) => count + group.nodeTypes.length, 0)
}
function getMissingModelRows(groups: MissingModelGroup[]) {
return groups.flatMap((group) => group.models)
}
function getMissingMediaRows(groups: MissingMediaGroup[]) {
return groups.flatMap((group) => group.items)
}
function hasSingleRowWithAtMostOneReference(
rows: Array<{ referencingNodes: readonly unknown[] }>
): boolean {
const row = rows[0]
return (
rows.length === 1 && row !== undefined && row.referencingNodes.length <= 1
)
}
interface OverlayGroupContext {
missingPackGroups: MissingPackGroup[]
missingModelGroups: MissingModelGroup[]
missingMediaGroups: MissingMediaGroup[]
swapNodeGroups: SwapNodeGroup[]
}
function isSingleLeafGroup(
group: ErrorGroup,
context: OverlayGroupContext
): boolean {
if (group.type === 'execution') {
return group.cards.length === 1 && group.cards[0]?.errors.length === 1
}
if (group.type === 'missing_node') {
return (
context.missingPackGroups.length === 1 &&
countMissingNodeReferences(context.missingPackGroups) === 1
)
}
if (group.type === 'swap_nodes') {
return (
context.swapNodeGroups.length === 1 &&
countSwapNodeReferences(context.swapNodeGroups) === 1
)
}
if (group.type === 'missing_model') {
return hasSingleRowWithAtMostOneReference(
getMissingModelRows(context.missingModelGroups)
)
}
return hasSingleRowWithAtMostOneReference(
getMissingMediaRows(context.missingMediaGroups)
)
}
function shouldUseAggregateCopyForSingleGroup(
group: ErrorGroup,
context: OverlayGroupContext
): boolean {
if (group.type === 'missing_node') {
return context.missingPackGroups.length > 1
}
if (group.type === 'swap_nodes') {
return context.swapNodeGroups.length > 1
}
if (group.type === 'missing_model') {
return getMissingModelRows(context.missingModelGroups).length > 1
}
if (group.type === 'missing_media') {
return getMissingMediaRows(context.missingMediaGroups).length > 1
}
return false
}
export function useErrorOverlayState() {
const { t } = useI18n()
const executionErrorStore = useExecutionErrorStore()
const { totalErrorCount, isErrorOverlayOpen } =
storeToRefs(executionErrorStore)
const { allErrorGroups } = useErrorGroups('')
const { isErrorOverlayOpen } = storeToRefs(executionErrorStore)
const {
allErrorGroups,
missingPackGroups,
missingModelGroups,
missingMediaGroups,
swapNodeGroups
} = useErrorGroups('')
const hasExactlyOneError = computed(() => totalErrorCount.value === 1)
const hasMultipleErrors = computed(() => totalErrorCount.value > 1)
const singleErrorGroup = computed(() =>
hasExactlyOneError.value && allErrorGroups.value.length === 1
? allErrorGroups.value[0]
: undefined
)
const errorCountLabel = computed(() =>
t(
'errorOverlay.errorCount',
{ count: totalErrorCount.value },
totalErrorCount.value
)
const totalErrorCount = computed(() =>
allErrorGroups.value.reduce((sum, group) => sum + group.count, 0)
)
const multipleErrorCountLabel = computed(() =>
@@ -68,25 +166,38 @@ export function useErrorOverlayState() {
)
)
const singleOverlayCopy = computed(() =>
singleErrorGroup.value
? resolveSingleOverlayCopy(singleErrorGroup.value)
: undefined
)
const aggregateOverlayCopy = computed<OverlayCopy>(() => ({
title: multipleErrorCountLabel.value,
message: t('errorOverlay.multipleErrorsMessage')
}))
const overlayMessage = computed(() => {
if (hasMultipleErrors.value) {
return t('errorOverlay.multipleErrorsMessage')
const overlayCopy = computed<OverlayCopy | undefined>(() => {
const groups = allErrorGroups.value
if (groups.length === 0) return undefined
if (groups.length > 1) return aggregateOverlayCopy.value
const [group] = groups
const context = {
missingPackGroups: missingPackGroups.value,
missingModelGroups: missingModelGroups.value,
missingMediaGroups: missingMediaGroups.value,
swapNodeGroups: swapNodeGroups.value
}
return singleOverlayCopy.value?.message ?? ''
if (shouldUseAggregateCopyForSingleGroup(group, context)) {
return aggregateOverlayCopy.value
}
if (isSingleLeafGroup(group, context)) {
return resolveSingleOverlayCopy(group) ?? resolveGroupOverlayCopy(group)
}
return resolveGroupOverlayCopy(group)
})
const overlayTitle = computed(() =>
hasMultipleErrors.value
? multipleErrorCountLabel.value
: (singleOverlayCopy.value?.title ?? errorCountLabel.value)
)
const overlayMessage = computed(() => overlayCopy.value?.message ?? '')
const overlayTitle = computed(() => overlayCopy.value?.title ?? '')
const isVisible = computed(
() =>

View File

@@ -333,6 +333,9 @@ describe('TabErrors.vue', () => {
expect(screen.getAllByText('CLIPTextEncode').length).toBeGreaterThanOrEqual(
1
)
expect(
within(screen.getByTestId('errors-summary-hero')).getByText('1')
).toBeInTheDocument()
expect(screen.queryByText('KSampler')).not.toBeInTheDocument()
})
@@ -550,6 +553,73 @@ describe('TabErrors.vue', () => {
expect(mockFocusNode.mock.calls.at(-1)?.[0]).toBe('4')
})
it('sums the summary hero count across error types', async () => {
const { getNodeByExecutionId } = await import('@/utils/graphTraversalUtil')
vi.mocked(getNodeByExecutionId).mockReturnValue({
title: 'Node'
} as ReturnType<typeof getNodeByExecutionId>)
renderComponent({
executionError: {
lastNodeErrors: {
'1': {
class_type: 'KSampler',
errors: [
{
type: 'required_input_missing',
message: 'Required input is missing',
details: 'Input: model',
extra_info: { input_name: 'model' }
},
{
type: 'required_input_missing',
message: 'Required input is missing',
details: 'Input: positive',
extra_info: { input_name: 'positive' }
}
]
},
'2': {
class_type: 'CLIPTextEncode',
errors: [
{
type: 'required_input_missing',
message: 'Required input is missing',
details: 'Input: clip',
extra_info: { input_name: 'clip' }
}
]
}
}
},
missingMedia: {
missingMediaCandidates: [
{
nodeId: '3',
nodeType: 'LoadImage',
widgetName: 'image',
mediaType: 'image',
name: 'a.png',
isMissing: true
},
{
nodeId: '4',
nodeType: 'LoadImage',
widgetName: 'image',
mediaType: 'image',
name: 'b.png',
isMissing: true
}
]
} satisfies { missingMediaCandidates: MissingMediaCandidate[] }
})
// 3 validation items + 2 missing media references
expect(
within(screen.getByTestId('errors-summary-hero')).getByText('5')
).toBeInTheDocument()
})
it('renders swap node rows below the section display message', () => {
const swapNode = {
type: 'OldSampler',

View File

@@ -61,7 +61,7 @@
:key="group.groupKey"
:data-testid="'error-group-' + group.type.replaceAll('_', '-')"
:title="group.displayTitle"
:count="getGroupCount(group)"
:count="group.count"
:collapse="isSectionCollapsed(group.groupKey) && !isSearching"
class="border-t border-secondary-background first:border-t-0"
@update:collapse="setSectionCollapsed(group.groupKey, $event)"
@@ -328,7 +328,6 @@ import MissingNodeCard from './MissingNodeCard.vue'
import SwapNodesCard from '@/platform/nodeReplacement/components/SwapNodesCard.vue'
import MissingModelCard from '@/platform/missingModel/components/MissingModelCard.vue'
import MissingMediaCard from '@/platform/missingMedia/components/MissingMediaCard.vue'
import { countMissingMediaReferences } from '@/platform/missingMedia/missingMediaGrouping'
import { isCloud, isDesktop, isNightly } from '@/platform/distribution/types'
import Button from '@/components/ui/button/Button.vue'
import DotSpinner from '@/components/common/DotSpinner.vue'
@@ -339,6 +338,7 @@ import { useErrorActions } from './useErrorActions'
import { useErrorGroups } from './useErrorGroups'
import type { SwapNodeGroup } from './useErrorGroups'
import type { ErrorGroup } from './types'
import { isExecutionItemListGroup } from './executionItemList'
import { useNodeReplacement } from '@/platform/nodeReplacement/useNodeReplacement'
interface ExecutionItemListEntry {
@@ -372,21 +372,6 @@ const searchQuery = ref('')
const expandedExecutionItemDetailKeys = ref(new Set<string>())
const isSearching = computed(() => searchQuery.value.trim() !== '')
function isExecutionItemListGroup(group: ErrorGroup) {
return (
group.type === 'execution' &&
group.cards.length > 0 &&
group.cards.every(
(card) =>
card.nodeId &&
card.errors.length > 0 &&
card.errors.every(
(error) => !error.isRuntimeError && Boolean(error.displayItemLabel)
)
)
)
}
function getExecutionItemList(group: ErrorGroup): ExecutionItemListEntry[] {
if (group.type !== 'execution') return []
@@ -418,14 +403,6 @@ function compareExecutionItemListEntry(
)
}
function getExecutionGroupCount(group: ErrorGroup) {
if (group.type !== 'execution') return 0
if (isExecutionItemListGroup(group)) {
return group.cards.reduce((count, card) => count + card.errors.length, 0)
}
return group.cards.length
}
function isExecutionItemDetailExpanded(key: string) {
return expandedExecutionItemDetailKeys.value.has(key)
}
@@ -458,26 +435,8 @@ const {
swapNodeGroups
} = useErrorGroups(searchQuery)
function getGroupCount(group: ErrorGroup): number {
switch (group.type) {
case 'execution':
return getExecutionGroupCount(group)
case 'missing_node':
return missingPackGroups.value.length
case 'swap_nodes':
return swapNodeGroups.value.length
case 'missing_model':
return missingModelGroups.value.reduce(
(total, modelGroup) => total + modelGroup.models.length,
0
)
case 'missing_media':
return countMissingMediaReferences(missingMediaGroups.value)
}
}
const totalErrorCount = computed(() =>
filteredGroups.value.reduce((sum, group) => sum + getGroupCount(group), 0)
filteredGroups.value.reduce((sum, group) => sum + group.count, 0)
)
const showMissingModelHeaderRefresh = computed(

View File

@@ -0,0 +1,21 @@
import type { ErrorCardData, ErrorGroup } from './types'
export function shouldRenderExecutionItemList(cards: ErrorCardData[]): boolean {
return (
cards.length > 0 &&
cards.every(
(card) =>
card.nodeId &&
card.errors.length > 0 &&
card.errors.every(
(error) => !error.isRuntimeError && Boolean(error.displayItemLabel)
)
)
)
}
export function isExecutionItemListGroup(group: ErrorGroup): boolean {
return (
group.type === 'execution' && shouldRenderExecutionItemList(group.cards)
)
}

View File

@@ -24,6 +24,7 @@ interface ErrorGroupBase extends Omit<ResolvedErrorMessage, 'displayTitle'> {
groupKey: string
/** Human-friendly title resolved for UI display. */
displayTitle: string
count: number
priority: number
}

View File

@@ -793,53 +793,6 @@ describe('useErrorGroups', () => {
})
})
describe('groupedErrorMessages', () => {
it('returns empty array when no errors', () => {
const { groups } = createErrorGroups()
expect(groups.groupedErrorMessages.value).toEqual([])
})
it('collects unique display messages from node errors', async () => {
const { store, groups } = createErrorGroups()
store.lastNodeErrors = {
'1': {
class_type: 'KSampler',
dependent_outputs: [],
errors: [
{ type: 'err_a', message: 'Error A', details: '' },
{ type: 'err_b', message: 'Error B', details: '' }
]
},
'2': {
class_type: 'CLIPLoader',
dependent_outputs: [],
errors: [{ type: 'err_a', message: 'Error A', details: '' }]
}
}
await nextTick()
const messages = groups.groupedErrorMessages.value
expect(messages).toEqual([unknownValidationMessage])
})
it('includes missing node group display message', async () => {
const { groups } = createErrorGroups()
const missingNodesStore = useMissingNodesErrorStore()
missingNodesStore.setMissingNodeTypes([
makeMissingNodeType('NodeA', { cnrId: 'pack-1' })
])
await nextTick()
const missingGroup = groups.allErrorGroups.value.find(
(g) => g.type === 'missing_node'
)
expect(missingGroup).toBeDefined()
expect(groups.groupedErrorMessages.value).toContain(
missingGroup!.displayMessage
)
})
})
describe('missingModelGroups', () => {
it('returns empty array when no missing models', () => {
const { groups } = createErrorGroups()

View File

@@ -25,14 +25,15 @@ import { isGroupNode } from '@/utils/executableGroupNodeDto'
import { st } from '@/i18n'
import type { MissingNodeType } from '@/types/comfy'
import type { ErrorCardData, ErrorGroup, ErrorItem } from './types'
import { shouldRenderExecutionItemList } from './executionItemList'
import type { NodeExecutionId } from '@/types/nodeIdentification'
import type {
MissingModelCandidate,
MissingModelGroup
} from '@/platform/missingModel/types'
import type { MissingModelGroup } from '@/platform/missingModel/types'
import type { ResolvedCatalogErrorMessage } from '@/platform/errorCatalog/types'
import type { MissingMediaGroup } from '@/platform/missingMedia/types'
import { groupCandidatesByName } from '@/platform/missingModel/missingModelScan'
import {
countMissingModels,
groupMissingModelCandidates
} from '@/platform/missingModel/missingModelGrouping'
import { groupCandidatesByMediaType } from '@/platform/missingMedia/missingMediaScan'
import { countMissingMediaReferences } from '@/platform/missingMedia/missingMediaGrouping'
import {
@@ -49,9 +50,6 @@ const PROMPT_CARD_ID = '__prompt__'
/** Sentinel: distinguishes "fetch in-flight" from "fetch done, pack not found (null)". */
const RESOLVING = '__RESOLVING__'
/** Sentinel key for grouping non-asset-supported missing models. */
const UNSUPPORTED = Symbol('unsupported')
export interface MissingPackGroup {
packId: string | null
nodeTypes: MissingNodeType[]
@@ -152,16 +150,28 @@ function compareNodeId(a: ErrorCardData, b: ErrorCardData): number {
return compareExecutionId(a.nodeId, b.nodeId)
}
function countExecutionCards(cards: ErrorCardData[]): number {
if (shouldRenderExecutionItemList(cards)) {
return cards.reduce((count, card) => count + card.errors.length, 0)
}
return cards.length
}
function toSortedGroups(groupsMap: Map<string, GroupEntry>): ErrorGroup[] {
return Array.from(groupsMap.entries())
.map(([rawGroupKey, groupData]) => ({
type: 'execution' as const,
groupKey: `execution:${rawGroupKey}`,
displayTitle: groupData.displayTitle,
displayMessage: groupData.displayMessage,
cards: Array.from(groupData.cards.values()).sort(compareNodeId),
priority: groupData.priority
}))
.map(([rawGroupKey, groupData]) => {
const cards = Array.from(groupData.cards.values()).sort(compareNodeId)
return {
type: 'execution' as const,
groupKey: `execution:${rawGroupKey}`,
displayTitle: groupData.displayTitle,
displayMessage: groupData.displayMessage,
count: countExecutionCards(cards),
cards,
priority: groupData.priority
}
})
.sort((a, b) => {
if (a.priority !== b.priority) return a.priority - b.priority
return a.displayTitle.localeCompare(b.displayTitle)
@@ -220,11 +230,13 @@ function searchErrorGroups(groups: ErrorGroup[], query: string) {
return groups
.map((group, gi) => {
if (group.type !== 'execution') return group
const cards = group.cards.filter((_: ErrorCardData, ci: number) =>
matchedCardKeys.has(`${gi}:${ci}`)
)
return {
...group,
cards: group.cards.filter((_: ErrorCardData, ci: number) =>
matchedCardKeys.has(`${gi}:${ci}`)
)
cards,
count: countExecutionCards(cards)
}
})
.filter((group) => group.type !== 'execution' || group.cards.length > 0)
@@ -591,6 +603,7 @@ export function useErrorGroups(searchQuery: MaybeRefOrGetter<string>) {
groups.push({
type: 'swap_nodes' as const,
groupKey: 'swap_nodes',
count: swapNodeGroups.value.length,
priority: 0,
...resolveMissingErrorMessage({
kind: 'swap_nodes',
@@ -605,6 +618,7 @@ export function useErrorGroups(searchQuery: MaybeRefOrGetter<string>) {
groups.push({
type: 'missing_node' as const,
groupKey: 'missing_node',
count: missingPackGroups.value.length,
priority: 1,
...resolveMissingErrorMessage({
kind: 'missing_node',
@@ -618,60 +632,21 @@ export function useErrorGroups(searchQuery: MaybeRefOrGetter<string>) {
return groups.sort((a, b) => a.priority - b.priority)
}
/** Groups missing models. Asset-supported models group by directory; others go into a separate group.
* Within each group, candidates with the same model name are merged into a single view model. */
const missingModelGroups = computed<MissingModelGroup[]>(() => {
const candidates = missingModelStore.missingModelCandidates
if (!candidates?.length) return []
type GroupKey = string | null | typeof UNSUPPORTED
const map = new Map<
GroupKey,
{ candidates: MissingModelCandidate[]; isAssetSupported: boolean }
>()
for (const c of candidates) {
const groupKey: GroupKey =
c.isAssetSupported || !isCloud ? c.directory || null : UNSUPPORTED
const existing = map.get(groupKey)
if (existing) {
existing.candidates.push(c)
} else {
// All candidates in the same directory share the same isAssetSupported
// value in practice (a directory is either asset-supported or not).
map.set(groupKey, {
candidates: [c],
isAssetSupported: c.isAssetSupported
})
}
}
return Array.from(map.entries())
.sort(([dirA], [dirB]) => {
if (dirA === UNSUPPORTED) return 1
if (dirB === UNSUPPORTED) return -1
if (dirA === null) return 1
if (dirB === null) return -1
return dirA.localeCompare(dirB)
})
.map(([key, { candidates: groupCandidates, isAssetSupported }]) => ({
directory: typeof key === 'string' ? key : null,
models: groupCandidatesByName(groupCandidates),
isAssetSupported
}))
return groupMissingModelCandidates(
missingModelStore.missingModelCandidates,
isCloud
)
})
function buildMissingModelGroups(): ErrorGroup[] {
if (!missingModelGroups.value.length) return []
const count = missingModelGroups.value.reduce(
(total, group) => total + group.models.length,
0
)
const count = countMissingModels(missingModelGroups.value)
return [
{
type: 'missing_model' as const,
groupKey: 'missing_model',
count,
priority: 2,
...resolveMissingErrorMessage({
kind: 'missing_model',
@@ -696,6 +671,7 @@ export function useErrorGroups(searchQuery: MaybeRefOrGetter<string>) {
{
type: 'missing_media' as const,
groupKey: 'missing_media',
count: totalRows,
priority: 3,
...resolveMissingErrorMessage({
kind: 'missing_media',
@@ -737,37 +713,7 @@ export function useErrorGroups(searchQuery: MaybeRefOrGetter<string>) {
(c) => c.nodeId != null && isAssetErrorInSelection(String(c.nodeId))
)
if (!filtered.length) return []
const map = new Map<
string | null | typeof UNSUPPORTED,
{ candidates: MissingModelCandidate[]; isAssetSupported: boolean }
>()
for (const c of filtered) {
const groupKey =
c.isAssetSupported || !isCloud ? c.directory || null : UNSUPPORTED
const existing = map.get(groupKey)
if (existing) {
existing.candidates.push(c)
} else {
map.set(groupKey, {
candidates: [c],
isAssetSupported: c.isAssetSupported
})
}
}
return Array.from(map.entries())
.sort(([dirA], [dirB]) => {
if (dirA === UNSUPPORTED) return 1
if (dirB === UNSUPPORTED) return -1
if (dirA === null) return 1
if (dirB === null) return -1
return dirA.localeCompare(dirB)
})
.map(([key, { candidates: groupCandidates, isAssetSupported }]) => ({
directory: typeof key === 'string' ? key : null,
models: groupCandidatesByName(groupCandidates),
isAssetSupported
}))
return groupMissingModelCandidates(filtered, isCloud)
})
const filteredMissingMediaGroups = computed(() => {
@@ -783,14 +729,12 @@ export function useErrorGroups(searchQuery: MaybeRefOrGetter<string>) {
function buildMissingModelGroupsFiltered(): ErrorGroup[] {
if (!filteredMissingModelGroups.value.length) return []
const count = filteredMissingModelGroups.value.reduce(
(total, group) => total + group.models.length,
0
)
const count = countMissingModels(filteredMissingModelGroups.value)
return [
{
type: 'missing_model' as const,
groupKey: 'missing_model',
count,
priority: 2,
...resolveMissingErrorMessage({
kind: 'missing_model',
@@ -811,6 +755,7 @@ export function useErrorGroups(searchQuery: MaybeRefOrGetter<string>) {
{
type: 'missing_media' as const,
groupKey: 'missing_media',
count: totalRows,
priority: 3,
...resolveMissingErrorMessage({
kind: 'missing_media',
@@ -865,22 +810,6 @@ export function useErrorGroups(searchQuery: MaybeRefOrGetter<string>) {
return searchErrorGroups(tabErrorGroups.value, query)
})
const groupedErrorMessages = computed<string[]>(() => {
const messages = new Set<string>()
for (const group of allErrorGroups.value) {
if (group.type === 'execution') {
for (const card of group.cards) {
for (const err of card.errors) {
messages.add(err.displayMessage ?? err.message)
}
}
} else {
messages.add(group.displayMessage ?? group.displayTitle)
}
}
return Array.from(messages)
})
return {
allErrorGroups,
tabErrorGroups,
@@ -889,7 +818,6 @@ export function useErrorGroups(searchQuery: MaybeRefOrGetter<string>) {
isSingleNodeSelected,
errorNodeCache,
missingNodeCache,
groupedErrorMessages,
missingPackGroups,
missingModelGroups,
missingMediaGroups,

View File

@@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n'
import EditableText from '@/components/common/EditableText.vue'
import { getControlWidget } from '@/composables/graph/useGraphNodeManager'
import { useVueNodeLifecycle } from '@/composables/graph/useVueNodeLifecycle'
import { st } from '@/i18n'
import type { LGraphNode } from '@/lib/litegraph/src/litegraph'
import type { SubgraphNode } from '@/lib/litegraph/src/subgraph/SubgraphNode'
@@ -67,6 +68,15 @@ const widgetComponent = computed(() => {
return component || WidgetLegacy
})
const isLinked = computed(() => {
const safeWidget = useVueNodeLifecycle()
.nodeManager.value?.vueNodeData.get(String(node.id))
?.widgets?.find((w) => w.name === widget.name)
return safeWidget?.slotMetadata
? !!safeWidget.slotMetadata.linked
: !!node.inputs?.find((inp) => inp.widget?.name === widget.name)?.link
})
const simplifiedWidget = computed((): SimplifiedWidget => {
const graphId = node.graph?.rootGraph?.id
const bareNodeId = stripGraphPrefix(String(node.id))
@@ -78,12 +88,14 @@ const simplifiedWidget = computed((): SimplifiedWidget => {
const widgetName = widgetState?.name ?? widget.name
const widgetType = widgetState?.type ?? widget.type
const baseOptions = widgetState?.options ?? widget.options
const disabled = isLinked.value || !!widget.disabled || undefined
return {
name: widgetName,
type: widgetType,
value: widgetState?.value ?? widget.value,
label: widgetState?.label ?? widget.label,
options: widgetState?.options ?? widget.options,
options: { ...baseOptions, disabled },
spec: nodeDefStore.getInputSpecForWidget(node, widgetName),
controlWidget: getControlWidget(widget)
}

View File

@@ -6,7 +6,7 @@ import type {
} from '@/extensions/core/load3d/interfaces'
import type { LGraphNode } from '@/lib/litegraph/src/LGraphNode'
export type Load3dSerializedBase = {
type Load3dSerializedBase = {
camera_info: CameraState | null
model_3d_info: Model3DInfo
}

View File

@@ -973,7 +973,7 @@ export class LGraph
console.warn(
'LiteGraph: there is already a node with this ID, changing it'
)
node.id = LiteGraph.use_uuids ? LiteGraph.uuidv4() : ++state.lastNodeId
node.id = ++state.lastNodeId
}
if (this._nodes.length >= LiteGraph.MAX_NUMBER_OF_NODES) {
@@ -981,14 +981,10 @@ export class LGraph
}
// give him an id
if (LiteGraph.use_uuids) {
if (node.id == null || node.id == -1) node.id = LiteGraph.uuidv4()
} else {
if (node.id == null || node.id == -1) {
node.id = ++state.lastNodeId
} else if (typeof node.id === 'number' && state.lastNodeId < node.id) {
state.lastNodeId = node.id
}
if (node.id == null || node.id == -1) {
node.id = ++state.lastNodeId
} else if (typeof node.id === 'number' && state.lastNodeId < node.id) {
state.lastNodeId = node.id
}
// Set ghost flag before registration so VueNodeData picks it up
@@ -2359,11 +2355,9 @@ export class LGraph
Required<Pick<SerialisableGraph, 'nodes' | 'groups' | 'extra'>> {
const { id, revision, config, state } = this
const nodeList =
!LiteGraph.use_uuids && options?.sortNodes
? // @ts-expect-error If LiteGraph.use_uuids is false, ids are numbers.
[...this._nodes].sort((a, b) => a.id - b.id)
: this._nodes
const nodeList = options?.sortNodes
? [...this._nodes].sort((a, b) => Number(a.id) - Number(b.id))
: this._nodes
const nodes = nodeList.map((node) => node.serialize())
const groups = this._groups.map((x) => x.serialize())

View File

@@ -810,7 +810,7 @@ export class LGraphNode
}
constructor(title: string, type?: string) {
this.id = LiteGraph.use_uuids ? LiteGraph.uuidv4() : -1
this.id = -1
this.title = title || 'Unnamed'
this.type = type ?? ''
this.size = [LiteGraph.NODE_WIDTH, 60]
@@ -1024,7 +1024,6 @@ export class LGraphNode
node.id = this.id
node.configure(data)
if (LiteGraph.use_uuids) node.id = LiteGraph.uuidv4()
return node
}

View File

@@ -266,10 +266,6 @@ export class LiteGraphGlobal {
*/
ctrl_shift_v_paste_connect_unselected_outputs = true
// if true, all newly created nodes/links will use string UUIDs for their id fields instead of integers.
// use this if you must have node IDs that are unique across all graphs and subgraphs.
use_uuids = false
// Whether to highlight the bounding box of selected groups
highlight_selected_group = true

View File

@@ -193,7 +193,6 @@ LiteGraphGlobal {
"throw_errors": true,
"truncateWidgetTextEvenly": false,
"truncateWidgetValuesFirst": false,
"use_uuids": false,
"uuidv4": [Function],
"vueNodesMode": false,
}

View File

@@ -3684,7 +3684,6 @@
}
},
"errorOverlay": {
"errorCount": "{count} ERROR | {count} ERRORS",
"multipleErrorCount": "{count} error found | {count} errors found",
"multipleErrorsMessage": "Resolve them before running the workflow.",
"viewDetails": "View details",

View File

@@ -4,9 +4,9 @@
value: buttonTooltip,
showDelay: 600
}"
class="subscribe-to-run-button whitespace-nowrap"
class="subscribe-to-run-button h-8 gap-1.5 rounded-lg px-4 whitespace-nowrap"
variant="gradient"
size="sm"
size="unset"
data-testid="subscribe-to-run-button"
@click="handleSubscribeToRun"
>

View File

@@ -51,7 +51,9 @@ export const useSubscriptionDialog = () => {
dialogComponentProps: {
style: 'width: min(360px, 95vw);',
pt: {
root: { class: 'bg-transparent' },
root: {
class: 'bg-transparent border-none rounded-none shadow-none'
},
content: { class: '!p-0 bg-transparent border-none shadow-none' }
}
}

View File

@@ -4,6 +4,7 @@ import type {
} from './types'
import { normalizeNodeName, translateCatalogMessage } from './catalogI18n'
import { countMissingMediaReferences } from '@/platform/missingMedia/missingMediaGrouping'
import { countMissingModels } from '@/platform/missingModel/missingModelGrouping'
import { st } from '@/i18n'
function formatNodeTypeName(nodeType: string): string | null {
@@ -167,11 +168,7 @@ type MissingModelSource = Extract<
>
function getMissingModelCount(source: MissingModelSource): number {
const count = source.groups.reduce(
(total, group) => total + group.models.length,
0
)
return count || source.count
return countMissingModels(source.groups) || source.count
}
function resolveMissingModelDisplayMessage(source: MissingModelSource): string {

View File

@@ -0,0 +1,159 @@
import { describe, expect, it } from 'vitest'
import {
countMissingModels,
groupMissingModelCandidates
} from '@/platform/missingModel/missingModelGrouping'
import type {
MissingModelCandidate,
MissingModelGroup,
MissingModelViewModel
} from '@/platform/missingModel/types'
function makeModel(name: string): MissingModelViewModel {
return {
name,
representative: {
nodeType: 'CheckpointLoaderSimple',
widgetName: 'ckpt_name',
name,
isAssetSupported: false,
isMissing: true
},
referencingNodes: [{ nodeId: '1', widgetName: 'ckpt_name' }]
}
}
function makeGroup(
directory: string | null,
modelNames: string[]
): MissingModelGroup {
return {
directory,
isAssetSupported: false,
models: modelNames.map(makeModel)
}
}
function makeCandidate(
name: string,
directory: string | undefined,
isAssetSupported: boolean
): MissingModelCandidate {
return {
nodeId: '1',
nodeType: 'CheckpointLoaderSimple',
widgetName: 'ckpt_name',
name,
directory,
isAssetSupported,
isMissing: true
}
}
function summarizeGroups(groups: MissingModelGroup[]) {
return groups.map((group) => ({
directory: group.directory,
isAssetSupported: group.isAssetSupported,
modelNames: group.models.map((model) => model.name)
}))
}
describe('countMissingModels', () => {
it('returns 0 for no groups', () => {
expect(countMissingModels([])).toBe(0)
})
it('counts every model file within a single directory group', () => {
expect(
countMissingModels([
makeGroup('checkpoints', ['a.safetensors', 'b.safetensors'])
])
).toBe(2)
})
it('sums model files across multiple directory groups', () => {
expect(
countMissingModels([
makeGroup('checkpoints', ['a.safetensors', 'b.safetensors']),
makeGroup('loras', ['c.safetensors']),
makeGroup(null, ['d.safetensors'])
])
).toBe(4)
})
})
describe('groupMissingModelCandidates', () => {
it('returns no groups without candidates', () => {
expect(groupMissingModelCandidates(null, true)).toEqual([])
expect(groupMissingModelCandidates(undefined, true)).toEqual([])
expect(groupMissingModelCandidates([], true)).toEqual([])
})
it('keeps cloud import-supported candidates grouped by directory', () => {
expect(
summarizeGroups(
groupMissingModelCandidates(
[
makeCandidate('checkpoint.safetensors', 'checkpoints', true),
makeCandidate('lora.safetensors', 'loras', true)
],
true
)
)
).toEqual([
{
directory: 'checkpoints',
isAssetSupported: true,
modelNames: ['checkpoint.safetensors']
},
{
directory: 'loras',
isAssetSupported: true,
modelNames: ['lora.safetensors']
}
])
})
it('moves cloud import-unsupported candidates into the unknown section', () => {
expect(
summarizeGroups(
groupMissingModelCandidates(
[
makeCandidate('supported.safetensors', 'loras', true),
makeCandidate('unsupported.safetensors', 'text_encoders', false)
],
true
)
)
).toEqual([
{
directory: 'loras',
isAssetSupported: true,
modelNames: ['supported.safetensors']
},
{
directory: null,
isAssetSupported: false,
modelNames: ['unsupported.safetensors']
}
])
})
it('keeps OSS candidates grouped by directory regardless of asset support', () => {
expect(
summarizeGroups(
groupMissingModelCandidates(
[makeCandidate('local.safetensors', 'text_encoders', false)],
false
)
)
).toEqual([
{
directory: 'text_encoders',
isAssetSupported: false,
modelNames: ['local.safetensors']
}
])
})
})

View File

@@ -0,0 +1,56 @@
import { sumBy } from 'es-toolkit'
import type {
MissingModelCandidate,
MissingModelGroup
} from '@/platform/missingModel/types'
import { groupCandidatesByName } from '@/platform/missingModel/missingModelScan'
const UNSUPPORTED = Symbol('unsupported')
export function countMissingModels(groups: MissingModelGroup[]): number {
return sumBy(groups, (group) => group.models.length)
}
export function groupMissingModelCandidates(
candidates: MissingModelCandidate[] | null | undefined,
isCloud: boolean
): MissingModelGroup[] {
if (!candidates?.length) return []
type GroupKey = string | null | typeof UNSUPPORTED
const map = new Map<
GroupKey,
{ candidates: MissingModelCandidate[]; isAssetSupported: boolean }
>()
for (const candidate of candidates) {
const groupKey: GroupKey =
candidate.isAssetSupported || !isCloud
? candidate.directory || null
: UNSUPPORTED
const existing = map.get(groupKey)
if (existing) {
existing.candidates.push(candidate)
} else {
map.set(groupKey, {
candidates: [candidate],
isAssetSupported: candidate.isAssetSupported
})
}
}
return Array.from(map.entries())
.sort(([dirA], [dirB]) => {
if (dirA === UNSUPPORTED) return 1
if (dirB === UNSUPPORTED) return -1
if (dirA === null) return 1
if (dirB === null) return -1
return dirA.localeCompare(dirB)
})
.map(([key, { candidates: groupCandidates, isAssetSupported }]) => ({
directory: typeof key === 'string' ? key : null,
models: groupCandidatesByName(groupCandidates),
isAssetSupported
}))
}

View File

@@ -591,5 +591,31 @@ describe('useWorkflowPersistenceV2', () => {
'Comfy.BrowseTemplates'
)
})
it('does not open templates browser when template param is in URL', async () => {
routeMocks.query = { template: 'default-template-id' }
const { initializeWorkflow } = mountWorkflowPersistence()
await initializeWorkflow()
expect(loadBlankWorkflowMock).toHaveBeenCalled()
expect(commandStoreMocks.execute).not.toHaveBeenCalledWith(
'Comfy.BrowseTemplates'
)
})
it('does not open templates browser when template intent is preserved across /user-select redirect', async () => {
preservedQueryMocks.payloads.template = {
template: 'default-template-id'
}
const { initializeWorkflow } = mountWorkflowPersistence()
await initializeWorkflow()
expect(loadBlankWorkflowMock).toHaveBeenCalled()
expect(commandStoreMocks.execute).not.toHaveBeenCalledWith(
'Comfy.BrowseTemplates'
)
})
})
})

View File

@@ -161,18 +161,24 @@ export function useWorkflowPersistenceV2() {
})
}
const hasSharedWorkflowIntent = () => {
if (typeof route.query.share === 'string') return true
hydratePreservedQuery(SHARE_NAMESPACE)
const merged = mergePreservedQueryIntoQuery(SHARE_NAMESPACE, route.query)
return typeof merged?.share === 'string'
const hasPreservedIntent = (namespace: string, key: string) => {
if (typeof route.query[key] === 'string') return true
hydratePreservedQuery(namespace)
const merged = mergePreservedQueryIntoQuery(namespace, route.query)
return typeof merged?.[key] === 'string'
}
const hasSharedWorkflowIntent = () =>
hasPreservedIntent(SHARE_NAMESPACE, 'share')
const hasTemplateUrlIntent = () =>
hasPreservedIntent(TEMPLATE_NAMESPACE, 'template')
const loadDefaultWorkflow = async () => {
if (!settingStore.get('Comfy.TutorialCompleted')) {
await settingStore.set('Comfy.TutorialCompleted', true)
await useWorkflowService().loadBlankWorkflow()
if (!hasSharedWorkflowIntent()) {
if (!hasSharedWorkflowIntent() && !hasTemplateUrlIntent()) {
await useCommandStore().execute('Comfy.BrowseTemplates')
}
} else {

View File

@@ -139,12 +139,6 @@
<span class="flex-1 text-sm text-base-foreground">{{
$t('subscription.plansAndPricing')
}}</span>
<span
v-if="canUpgrade"
class="rounded-full bg-base-foreground px-1.5 py-0.5 text-xs font-bold text-base-background"
>
{{ $t('subscription.upgrade') }}
</span>
</div>
<!-- Manage Plan (PERSONAL and OWNER, only if subscribed) -->
@@ -300,12 +294,6 @@ const displayedCredits = computed(() => {
})
})
const canUpgrade = computed(() => {
// PRO is currently the only/highest tier, so no upgrades available
// This will need updating when additional tiers are added
return false
})
const showPlansAndPricing = computed(
() => permissions.value.canManageSubscription
)

View File

@@ -30,7 +30,7 @@
"
>
<button
class="flex flex-1 cursor-pointer items-center gap-2 border-none bg-transparent p-0"
class="flex min-w-0 flex-1 cursor-pointer items-center gap-2 border-none bg-transparent p-0"
@click="handleSelectWorkspace(workspace)"
>
<WorkspaceProfilePic
@@ -38,10 +38,10 @@
:workspace-name="workspace.name"
/>
<div class="flex min-w-0 flex-1 flex-col items-start gap-1">
<div class="flex max-w-full items-center gap-1.5">
<div class="flex max-w-full min-w-0 items-center gap-1.5">
<span
:title="getDisplayName(workspace)"
class="truncate text-sm text-base-foreground"
class="min-w-0 truncate text-sm text-base-foreground"
>
{{ getDisplayName(workspace) }}
</span>

View File

@@ -150,6 +150,12 @@ function handleIsOpenUpdate(isOpen: boolean) {
void outputMediaAssets.refresh()
}
}
const isUploading = ref(false)
async function updateFiles(files: File[]) {
isUploading.value = true
await handleFilesUpdate(files)
isUploading.value = false
}
</script>
<template>
@@ -171,10 +177,11 @@ function handleIsOpenUpdate(isOpen: boolean) {
:ownership-options
:show-base-model-filter
:base-model-options
:is-uploading
v-bind="combinedProps"
class="w-full"
@update:selected="updateSelectedItems"
@update:files="handleFilesUpdate"
@update:files="updateFiles"
@update:is-open="handleIsOpenUpdate"
/>
</WidgetLayoutField>

View File

@@ -42,6 +42,7 @@ interface Props {
item: FormDropdownItem,
index: number
) => boolean
isUploading?: boolean
searcher?: (
query: string,
items: FormDropdownItem[],
@@ -277,6 +278,7 @@ function handleSearchEnter() {
:uploadable
:disabled
:accept
:is-uploading
@select-click="toggleDropdown"
@file-change="handleFileChange"
/>

View File

@@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n'
import { cn } from '@comfyorg/tailwind-utils'
import Loader from '@/components/loader/Loader.vue'
import { WidgetInputBaseClass } from '../../layout'
import type { FormDropdownInputProps } from './types'
@@ -100,7 +101,12 @@ defineExpose({ focus })
)
"
>
<i class="icon-[lucide--folder-search] size-4" aria-hidden="true" />
<Loader v-if="isUploading" size="sm" />
<i
v-else
class="icon-[lucide--folder-search] size-4"
aria-hidden="true"
/>
<input
type="file"
class="absolute inset-0 -z-1 opacity-0"

View File

@@ -39,6 +39,7 @@ export interface FormDropdownInputProps {
uploadable: boolean
disabled: boolean
accept?: string
isUploading?: boolean
}
export interface FormDropdownMenuItemProps {

View File

@@ -156,6 +156,13 @@ const gcsRedirectProxyConfig: ProxyOptions = {
}
}
// Disabling absolute asset-URL transforms under Vitest keeps `/assets/...` as
// string literals, avoiding rootless `file:///assets/...` imports that crash
// Vitest's `createRequire` on Windows.
const vuePluginOptions = process.env.VITEST
? { template: { transformAssetUrls: { includeAbsolute: false } } }
: undefined
export default defineConfig({
base: DISTRIBUTION === 'cloud' ? '/' : '',
server: {
@@ -259,8 +266,8 @@ export default defineConfig({
plugins: [
...(!DISABLE_VUE_PLUGINS
? [vueDevTools(), vue(), createHtmlPlugin({})]
: [vue()]),
? [vueDevTools(), vue(vuePluginOptions), createHtmlPlugin({})]
: [vue(vuePluginOptions)]),
tailwindcss(),
typegpuPlugin({}),
comfyAPIPlugin(IS_DEV),