Skip to content

Commit 6c72039

Browse files
authored
Merge branch 'main' into feature/new-wave-audio
2 parents 834e24a + af7bc38 commit 6c72039

File tree

202 files changed

+7445
-2853
lines changed

Some content is hidden

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

202 files changed

+7445
-2853
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
name: layer-audit
3+
description: 'Detect violations of the layered architecture import rules (base -> platform -> workbench -> renderer). Runs ESLint with the import-x/no-restricted-paths rule and generates a grouped report.'
4+
---
5+
6+
# Layer Architecture Audit
7+
8+
Finds imports that violate the layered architecture boundary rules enforced by `import-x/no-restricted-paths` in `eslint.config.ts`.
9+
10+
## Layer Hierarchy (bottom to top)
11+
12+
```
13+
renderer (top -- can import from all lower layers)
14+
^
15+
workbench
16+
^
17+
platform
18+
^
19+
base (bottom -- cannot import from any upper layer)
20+
```
21+
22+
Each layer may only import from layers below it.
23+
24+
## How to Run
25+
26+
```bash
27+
# Run ESLint filtering for just the layer boundary rule violations
28+
pnpm lint 2>&1 | grep 'import-x/no-restricted-paths' -B1 | head -200
29+
```
30+
31+
To get a full structured report, run:
32+
33+
```bash
34+
# Collect all violations from base/, platform/, workbench/ layers
35+
pnpm eslint src/base/ src/platform/ src/workbench/ --no-error-on-unmatched-pattern --rule '{"import-x/no-restricted-paths": "warn"}' --format compact 2>&1 | grep 'no-restricted-paths' | sort
36+
```
37+
38+
## How to Read Results
39+
40+
Each violation line shows:
41+
42+
- The **file** containing the bad import
43+
- The **import path** crossing the boundary
44+
- The **message** identifying which layer pair is violated
45+
46+
### Grouping by Layer Pair
47+
48+
After collecting violations, group them by the layer pair pattern:
49+
50+
| Layer pair | Meaning |
51+
| --------------------- | ----------------------------------- |
52+
| base -> platform | base/ importing from platform/ |
53+
| base -> workbench | base/ importing from workbench/ |
54+
| base -> renderer | base/ importing from renderer/ |
55+
| platform -> workbench | platform/ importing from workbench/ |
56+
| platform -> renderer | platform/ importing from renderer/ |
57+
| workbench -> renderer | workbench/ importing from renderer/ |
58+
59+
## When to Use
60+
61+
- Before creating a PR that adds imports between `src/base/`, `src/platform/`, `src/workbench/`, or `src/renderer/`
62+
- When auditing the codebase to find and plan migration of existing violations
63+
- After moving files between layers to verify no new violations were introduced
64+
65+
## Fixing Violations
66+
67+
Common strategies to resolve a layer violation:
68+
69+
1. **Move the import target down** -- if the imported module doesn't depend on upper-layer concepts, move it to a lower layer
70+
2. **Introduce an interface** -- define an interface/type in the lower layer and implement it in the upper layer via dependency injection or a registration pattern
71+
3. **Move the importing file up** -- if the file logically belongs in a higher layer, relocate it
72+
4. **Extract shared logic** -- pull the shared functionality into `base/` or a shared utility
73+
74+
## Reference
75+
76+
| Resource | Path |
77+
| ------------------------------- | ------------------ |
78+
| ESLint config (rule definition) | `eslint.config.ts` |
79+
| Base layer | `src/base/` |
80+
| Platform layer | `src/platform/` |
81+
| Workbench layer | `src/workbench/` |
82+
| Renderer layer | `src/renderer/` |

.claude/skills/writing-playwright-tests/SKILL.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,18 @@ await expect(node).toHaveClass(BYPASS_CLASS)
4444

4545
These are frequent causes of flaky tests - check them first, but investigate if they don't apply:
4646

47-
| Symptom | Common Cause | Typical Fix |
48-
| ---------------------------------- | ------------------------- | -------------------------------------------------------------------------------------- |
49-
| Test passes locally, fails in CI | Missing nextFrame() | Add `await comfyPage.nextFrame()` after canvas ops (not needed after `loadWorkflow()`) |
50-
| Keyboard shortcuts don't work | Missing focus | Add `await comfyPage.canvas.click()` first |
51-
| Double-click doesn't trigger | Timing too fast | Add `{ delay: 5 }` option |
52-
| Elements end up in wrong position | Drag animation incomplete | Use `{ steps: 10 }` not `{ steps: 1 }` |
53-
| Widget value wrong after drag-drop | Upload incomplete | Add `{ waitForUpload: true }` |
54-
| Test fails when run with others | Test pollution | Add `afterEach` with `resetView()` |
55-
| Local screenshots don't match CI | Platform differences | Screenshots are Linux-only, use PR label |
47+
| Symptom | Common Cause | Typical Fix |
48+
| ----------------------------------- | ------------------------- | -------------------------------------------------------------------------------------- |
49+
| Test passes locally, fails in CI | Missing nextFrame() | Add `await comfyPage.nextFrame()` after canvas ops (not needed after `loadWorkflow()`) |
50+
| Keyboard shortcuts don't work | Missing focus | Add `await comfyPage.canvas.click()` first |
51+
| Double-click doesn't trigger | Timing too fast | Add `{ delay: 5 }` option |
52+
| Elements end up in wrong position | Drag animation incomplete | Use `{ steps: 10 }` not `{ steps: 1 }` |
53+
| Widget value wrong after drag-drop | Upload incomplete | Add `{ waitForUpload: true }` |
54+
| Test fails when run with others | Test pollution | Add `afterEach` with `resetView()` |
55+
| Local screenshots don't match CI | Platform differences | Screenshots are Linux-only, use PR label |
56+
| `subtree intercepts pointer events` | Canvas overlay (z-999) | Use `dispatchEvent` on the DOM element to bypass overlay |
57+
| Context menu empty / wrong items | Node not selected | Select node first: `vueNodes.selectNode()` or `nodeRef.click('title')` |
58+
| `navigateIntoSubgraph` timeout | Node too small in asset | Use node size `[400, 200]` minimum in test asset JSON |
5659

5760
## Test Tags
5861

.github/actions/setup-frontend/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ runs:
1212

1313
# Install pnpm, Node.js, build frontend
1414
- name: Install pnpm
15-
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
15+
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
1616
with:
1717
version: 10
1818

.github/workflows/api-update-electron-api-types.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
uses: actions/checkout@v6
1717

1818
- name: Install pnpm
19-
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
19+
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
2020
with:
2121
version: 10
2222

.github/workflows/api-update-manager-api-types.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: actions/checkout@v6
2222

2323
- name: Install pnpm
24-
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
24+
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
2525
with:
2626
version: 10
2727

.github/workflows/api-update-registry-api-types.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
uses: actions/checkout@v6
2121

2222
- name: Install pnpm
23-
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
23+
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
2424
with:
2525
version: 10
2626

.github/workflows/ci-dist-telemetry-scan.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2020

2121
- name: Install pnpm
22-
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
22+
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
2323
with:
2424
version: 10
2525

.github/workflows/ci-oss-assets-validation.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2121

2222
- name: Install pnpm
23-
uses: pnpm/action-setup@9fd676a19091d4595eefd76e4bd31c97133911f1 # v4.2.0
23+
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
2424
with:
2525
version: 10
2626

@@ -75,7 +75,7 @@ jobs:
7575
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
7676

7777
- name: Install pnpm
78-
uses: pnpm/action-setup@9fd676a19091d4595eefd76e4bd31c97133911f1 # v4.2.0
78+
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0
7979
with:
8080
version: 10
8181

.github/workflows/ci-perf-report.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ jobs:
6464
mkdir -p temp/perf-meta
6565
echo "${{ github.event.number }}" > temp/perf-meta/number.txt
6666
echo "${{ github.event.pull_request.base.ref }}" > temp/perf-meta/base.txt
67+
echo "${{ github.event.pull_request.head.sha }}" > temp/perf-meta/head-sha.txt
6768
6869
- name: Upload PR metadata
6970
if: github.event_name == 'pull_request'

.github/workflows/ci-size-data.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
branches:
99
- main
1010

11+
concurrency:
12+
group: size-${{ github.ref }}
13+
cancel-in-progress: true
14+
1115
permissions:
1216
contents: read
1317

@@ -28,11 +32,12 @@ jobs:
2832
- name: Collect size data
2933
run: node scripts/size-collect.js
3034

31-
- name: Save PR number & base branch
35+
- name: Save PR metadata
3236
if: ${{ github.event_name == 'pull_request' }}
3337
run: |
3438
echo ${{ github.event.number }} > ./temp/size/number.txt
3539
echo ${{ github.base_ref }} > ./temp/size/base.txt
40+
echo ${{ github.event.pull_request.head.sha }} > ./temp/size/head-sha.txt
3641
3742
- name: Upload size data
3843
uses: actions/upload-artifact@v6

0 commit comments

Comments
 (0)