Commit 91af228
[feat] Implement media asset workflow actions and refactor duplications
Implemented 4 missing workflow features for media assets:
- copyJobId: Fixed to properly extract promptId from metadata
- addWorkflow: Add loader nodes (LoadImage/LoadVideo/LoadAudio) to canvas
- openWorkflow: Open workflow from asset metadata/embedded PNG in new tab
- exportWorkflow: Export workflow as JSON file
Created shared utilities to eliminate code duplication:
- assetTypeUtil.ts: Extract asset type with fallback (replaced 6 duplications)
- assetUrlUtil.ts: Construct asset URLs (replaced 3 duplications)
- workflowActionsService.ts: Shared workflow export/open operations
- workflowExtractionUtil.ts: Extract workflows from jobs/assets
- loaderNodeUtil.ts: Detect loader node types from filenames
Refactored existing code:
- Used formatUtil.getMediaTypeFromFilename() in loaderNodeUtil
- Extracted deleteAssetApi() helper to reduce deletion logic duplication
- Moved isResultItemType type guard to shared typeGuardUtil.ts
- Added 9 i18n strings for proper localization
- Added @comfyorg/shared-frontend-utils dependency
Input assets now support workflow features where applicable:
- All media files (JPEG/PNG/MP4/etc) can be added to current workflow
- PNG/WEBP/FLAC files with embedded metadata support open/export workflow
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 839e7c1 commit 91af228
File tree
11 files changed
+483
-234
lines changed- src
- locales/en
- platform
- assets
- components
- composables
- utils
- workflow
- core/services
- utils
- utils
11 files changed
+483
-234
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2044 | 2044 | | |
2045 | 2045 | | |
2046 | 2046 | | |
2047 | | - | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
2048 | 2057 | | |
2049 | 2058 | | |
2050 | 2059 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | 7 | | |
5 | 8 | | |
| |||
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
15 | | - | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
31 | | - | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | | - | |
| 37 | + | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
| |||
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
45 | | - | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| |||
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
55 | | - | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| |||
85 | 88 | | |
86 | 89 | | |
87 | 90 | | |
| 91 | + | |
| 92 | + | |
88 | 93 | | |
89 | 94 | | |
90 | 95 | | |
| |||
107 | 112 | | |
108 | 113 | | |
109 | 114 | | |
110 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
111 | 144 | | |
112 | 145 | | |
113 | 146 | | |
| |||
0 commit comments