Skip to content

Commit 0b460a3

Browse files
committed
Merge remote-tracking branch 'origin/main' into pysssss/tab-menu-breadcrumb
2 parents df51d4a + 97ca9f4 commit 0b460a3

File tree

140 files changed

+54614
-3219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+54614
-3219
lines changed

.github/workflows/ci-tests-e2e-forks.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Description: Deploys test results from forked PRs (forks can't access deployment secrets)
2-
name: "CI: Tests E2E (Deploy for Forks)"
2+
name: 'CI: Tests E2E (Deploy for Forks)'
33

44
on:
55
workflow_run:
6-
workflows: ["CI: Tests E2E"]
6+
workflows: ['CI: Tests E2E']
77
types: [requested, completed]
88

99
env:
@@ -81,6 +81,7 @@ jobs:
8181
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
8282
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
8383
GITHUB_TOKEN: ${{ github.token }}
84+
GITHUB_SHA: ${{ github.event.workflow_run.head_sha }}
8485
run: |
8586
# Rename merged report if exists
8687
[ -d "reports/playwright-report-chromium-merged" ] && \

.github/workflows/ci-tests-e2e.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Description: End-to-end testing with Playwright across multiple browsers, deploys test reports to Cloudflare Pages
2-
name: "CI: Tests E2E"
2+
name: 'CI: Tests E2E'
33

44
on:
55
push:
@@ -37,7 +37,7 @@ jobs:
3737
runs-on: ubuntu-latest
3838
timeout-minutes: 60
3939
container:
40-
image: ghcr.io/comfy-org/comfyui-ci-container:0.0.8
40+
image: ghcr.io/comfy-org/comfyui-ci-container:0.0.10
4141
credentials:
4242
username: ${{ github.actor }}
4343
password: ${{ secrets.GITHUB_TOKEN }}
@@ -85,7 +85,7 @@ jobs:
8585
needs: setup
8686
runs-on: ubuntu-latest
8787
container:
88-
image: ghcr.io/comfy-org/comfyui-ci-container:0.0.8
88+
image: ghcr.io/comfy-org/comfyui-ci-container:0.0.10
8989
credentials:
9090
username: ${{ github.actor }}
9191
password: ${{ secrets.GITHUB_TOKEN }}
@@ -222,6 +222,7 @@ jobs:
222222
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
223223
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
224224
GITHUB_TOKEN: ${{ github.token }}
225+
GITHUB_SHA: ${{ github.event.pull_request.head.sha }}
225226
run: |
226227
bash ./scripts/cicd/pr-playwright-deploy-and-comment.sh \
227228
"${{ github.event.pull_request.number }}" \

.github/workflows/pr-update-playwright-expectations.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
needs: setup
7878
runs-on: ubuntu-latest
7979
container:
80-
image: ghcr.io/comfy-org/comfyui-ci-container:0.0.8
80+
image: ghcr.io/comfy-org/comfyui-ci-container:0.0.10
8181
credentials:
8282
username: ${{ github.actor }}
8383
password: ${{ secrets.GITHUB_TOKEN }}

.i18nrc.cjs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = defineConfig({
1010
entry: 'src/locales/en',
1111
entryLocale: 'en',
1212
output: 'src/locales',
13-
outputLocales: ['zh', 'zh-TW', 'ru', 'ja', 'ko', 'fr', 'es', 'ar', 'tr', 'pt-BR'],
13+
outputLocales: ['zh', 'zh-TW', 'ru', 'ja', 'ko', 'fr', 'es', 'ar', 'tr', 'pt-BR', 'fa'],
1414
reference: `Special names to keep untranslated: flux, photomaker, clip, vae, cfg, stable audio, stable cascade, stable zero, controlnet, lora, HiDream, Civitai, Hugging Face.
1515
'latent' is the short form of 'latent space'.
1616
'mask' is in the context of image processing.
@@ -19,5 +19,11 @@ module.exports = defineConfig({
1919
- For 'zh' locale: Use ONLY Simplified Chinese characters (简体中文). Common examples: 节点 (not 節點), 画布 (not 畫布), 图像 (not 圖像), 选择 (not 選擇), 减小 (not 減小).
2020
- For 'zh-TW' locale: Use ONLY Traditional Chinese characters (繁體中文) with Taiwan-specific terminology.
2121
- NEVER mix Simplified and Traditional Chinese characters within the same locale.
22+
23+
IMPORTANT Persian Translation Guidelines:
24+
- For 'fa' locale: Use formal Persian (فارسی رسمی) for professional tone throughout the UI.
25+
- Keep commonly used technical terms in English when they are standard in Persian software (e.g., node, workflow).
26+
- Use Arabic-Indic numerals (۰-۹) for numbers where appropriate.
27+
- Maintain consistency with terminology used in Persian software and design applications.
2228
`
2329
});

.storybook/main.ts

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,32 @@ const config: StorybookConfig = {
6969
allowedHosts: true
7070
},
7171
resolve: {
72-
alias: {
73-
'@': process.cwd() + '/src'
74-
}
72+
alias: [
73+
{
74+
find: '@/composables/queue/useJobList',
75+
replacement: process.cwd() + '/src/storybook/mocks/useJobList.ts'
76+
},
77+
{
78+
find: '@/composables/queue/useJobActions',
79+
replacement: process.cwd() + '/src/storybook/mocks/useJobActions.ts'
80+
},
81+
{
82+
find: '@/utils/formatUtil',
83+
replacement:
84+
process.cwd() +
85+
'/packages/shared-frontend-utils/src/formatUtil.ts'
86+
},
87+
{
88+
find: '@/utils/networkUtil',
89+
replacement:
90+
process.cwd() +
91+
'/packages/shared-frontend-utils/src/networkUtil.ts'
92+
},
93+
{
94+
find: '@',
95+
replacement: process.cwd() + '/src'
96+
}
97+
]
7598
},
7699
esbuild: {
77100
// Prevent minification of identifiers to preserve _sfc_main

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,8 @@ The project uses **Nx** for build orchestration and task management
161161

162162
## Testing Guidelines
163163

164+
See @docs/testing/*.md for detailed patterns.
165+
164166
- Frameworks:
165167
- Vitest (unit/component, happy-dom)
166168
- Playwright (E2E)

docs/testing/vitest-patterns.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
---
2+
globs:
3+
- '**/*.test.ts'
4+
- '**/*.spec.ts'
5+
---
6+
7+
# Vitest Patterns
8+
9+
## Setup
10+
11+
Use `createTestingPinia` from `@pinia/testing`, not `createPinia`:
12+
13+
```typescript
14+
import { createTestingPinia } from '@pinia/testing'
15+
import { setActivePinia } from 'pinia'
16+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
17+
18+
describe('MyStore', () => {
19+
beforeEach(() => {
20+
setActivePinia(createTestingPinia({ stubActions: false }))
21+
vi.useFakeTimers()
22+
vi.resetAllMocks()
23+
})
24+
25+
afterEach(() => {
26+
vi.useRealTimers()
27+
})
28+
})
29+
```
30+
31+
**Why `stubActions: false`?** By default, testing pinia stubs all actions. Set to `false` when testing actual store behavior.
32+
33+
## Mock Patterns
34+
35+
### Reset all mocks at once
36+
37+
```typescript
38+
beforeEach(() => {
39+
vi.resetAllMocks() // Not individual mock.mockReset() calls
40+
})
41+
```
42+
43+
### Module mocks with vi.mock()
44+
45+
```typescript
46+
vi.mock('@/scripts/api', () => ({
47+
api: {
48+
addEventListener: vi.fn(),
49+
fetchData: vi.fn()
50+
}
51+
}))
52+
53+
vi.mock('@/services/myService', () => ({
54+
myService: {
55+
doThing: vi.fn()
56+
}
57+
}))
58+
```
59+
60+
### Configure mocks in tests
61+
62+
```typescript
63+
import { api } from '@/scripts/api'
64+
import { myService } from '@/services/myService'
65+
66+
it('handles success', () => {
67+
vi.mocked(myService.doThing).mockResolvedValue({ data: 'test' })
68+
// ... test code
69+
})
70+
```
71+
72+
## Testing Event Listeners
73+
74+
When a store registers event listeners at module load time:
75+
76+
```typescript
77+
function getEventHandler() {
78+
const call = vi.mocked(api.addEventListener).mock.calls.find(
79+
([event]) => event === 'my_event'
80+
)
81+
return call?.[1] as (e: CustomEvent<MyEventType>) => void
82+
}
83+
84+
function dispatch(data: MyEventType) {
85+
const handler = getEventHandler()
86+
handler(new CustomEvent('my_event', { detail: data }))
87+
}
88+
89+
it('handles events', () => {
90+
const store = useMyStore()
91+
dispatch({ field: 'value' })
92+
expect(store.items).toHaveLength(1)
93+
})
94+
```
95+
96+
## Testing with Fake Timers
97+
98+
For stores with intervals, timeouts, or polling:
99+
100+
```typescript
101+
beforeEach(() => {
102+
vi.useFakeTimers()
103+
})
104+
105+
afterEach(() => {
106+
vi.useRealTimers()
107+
})
108+
109+
it('polls after delay', async () => {
110+
const store = useMyStore()
111+
store.startPolling()
112+
113+
await vi.advanceTimersByTimeAsync(30000)
114+
115+
expect(mockService.fetch).toHaveBeenCalled()
116+
})
117+
```
118+
119+
## Assertion Style
120+
121+
Prefer `.toHaveLength()` over `.length.toBe()`:
122+
123+
```typescript
124+
// Good
125+
expect(store.items).toHaveLength(1)
126+
127+
// Avoid
128+
expect(store.items.length).toBe(1)
129+
```
130+
131+
Use `.toMatchObject()` for partial matching:
132+
133+
```typescript
134+
expect(store.completedItems[0]).toMatchObject({
135+
id: 'task-123',
136+
status: 'done'
137+
})
138+
```

knip.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const config: KnipConfig = {
88
'src/assets/css/style.css',
99
'src/main.ts',
1010
'src/scripts/ui/menu/index.ts',
11-
'src/types/index.ts'
11+
'src/types/index.ts',
12+
'src/storybook/mocks/**/*.ts'
1213
],
1314
project: ['**/*.{js,ts,vue}', '*.{js,ts,mts}']
1415
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@comfyorg/comfyui-frontend",
33
"private": true,
4-
"version": "1.37.6",
4+
"version": "1.37.9",
55
"type": "module",
66
"repository": "https://github.com/Comfy-Org/ComfyUI_frontend",
77
"homepage": "https://comfy.org",

0 commit comments

Comments
 (0)