Repository navigation
refactor(assets): extract getAssetStoredFilename helper (FE-733) - #12287
Conversation
…ureFlags test util L1 prerequisite cleanup. Two type-preserving refactors that make subsequent L1 sub-issues mechanical. 1. Extract getAssetStoredFilename(asset) helper to collapse the duplicated `isCloud && asset.asset_hash ? asset.asset_hash : asset.name` branch from useMediaAssetActions (lines 302, 446) into a single helper. Once BE-933/934 emit file_path and the cloud spec sync brings it into generated types, only the helper changes. 2. Add mockFeatureFlags(overrides) test utility under src/test-utils/. L1 sub-issues will use this consistently instead of re-inventing the mock shape each time. Includes a FeatureFlags type export from useFeatureFlags.ts so the mock stays in sync. Also auto-fixed unrelated tailwind class-order lint errors in four files (VirtualGrid, RightSidePanel, Textarea, ModelInfoPanel) to keep CI green. No behavior change.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a new exported helper ChangesAsset Stored Filename Utility
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 7✅ Passed checks (7 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎨 Storybook: ✅ Built — View Storybook |
🎭 Playwright: ✅ 1670 passed, 0 failed · 3 flaky📊 Browser Reports
|
📦 Bundle: 5.36 MB gzip 🔴 +242 BDetailsSummary
Category Glance App Entry Points — 26.1 kB (baseline 26.1 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.24 MB (baseline 1.24 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 82.9 kB (baseline 82.9 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 9 added / 9 removed / 2 unchanged Panels & Settings — 527 kB (baseline 527 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 10 added / 10 removed / 14 unchanged User & Accounts — 17.8 kB (baseline 17.8 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 5 added / 5 removed / 2 unchanged Editors & Dialogs — 112 kB (baseline 112 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 4 added / 4 removed UI Components — 58 kB (baseline 58 kB) • ⚪ 0 BReusable component library chunks
Status: 5 added / 5 removed / 8 unchanged Data & Services — 3.16 MB (baseline 3.16 MB) • 🟢 -40 BStores, services, APIs, and repositories
Status: 13 added / 13 removed / 4 unchanged Utilities & Hooks — 367 kB (baseline 366 kB) • 🔴 +786 BHelpers, composables, and utility bundles
Status: 14 added / 14 removed / 17 unchanged Vendor & Third-Party — 9.94 MB (baseline 9.94 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 16 unchanged Other — 9.16 MB (baseline 9.16 MB) • ⚪ 0 BBundles that do not match a named category
Status: 58 added / 58 removed / 85 unchanged ⚡ Performance Report
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-05-15T09:25:53.321Z",
"gitSha": "ac67370827fd8dbe18627e59a3d90c7ee2f1d78b",
"branch": "jaewon/fe-733-extract-stored-filename-helper",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2107.0310000000063,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.198999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 522.462,
"heapDeltaBytes": 19414912,
"heapUsedBytes": 69439912,
"domNodes": -262,
"jsHeapTotalBytes": 16211968,
"scriptDurationMs": 19.704,
"eventListeners": -131,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2003.9280000000872,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.776000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 366.10200000000003,
"heapDeltaBytes": 23195780,
"heapUsedBytes": 71841100,
"domNodes": 18,
"jsHeapTotalBytes": 15204352,
"scriptDurationMs": 17.558000000000003,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1872.8680000000395,
"styleRecalcs": 76,
"styleRecalcDurationMs": 39.357,
"layouts": 12,
"layoutDurationMs": 4.085999999999999,
"taskDurationMs": 820.721,
"heapDeltaBytes": -5315980,
"heapUsedBytes": 43686024,
"domNodes": 58,
"jsHeapTotalBytes": 16642048,
"scriptDurationMs": 115.456,
"eventListeners": -133,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1881.2860000000455,
"styleRecalcs": 77,
"styleRecalcDurationMs": 42.327000000000005,
"layouts": 12,
"layoutDurationMs": 4.687,
"taskDurationMs": 850.6479999999999,
"heapDeltaBytes": 13216604,
"heapUsedBytes": 62988224,
"domNodes": -258,
"jsHeapTotalBytes": 21454848,
"scriptDurationMs": 127.377,
"eventListeners": -129,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1742.3939999999902,
"styleRecalcs": 31,
"styleRecalcDurationMs": 17.633000000000003,
"layouts": 6,
"layoutDurationMs": 0.717,
"taskDurationMs": 364.02,
"heapDeltaBytes": 5028712,
"heapUsedBytes": 73248184,
"domNodes": 79,
"jsHeapTotalBytes": 31195136,
"scriptDurationMs": 27.008000000000003,
"eventListeners": 21,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1730.7559999999285,
"styleRecalcs": 32,
"styleRecalcDurationMs": 18.863000000000003,
"layouts": 6,
"layoutDurationMs": 0.715,
"taskDurationMs": 368.75600000000003,
"heapDeltaBytes": 23511212,
"heapUsedBytes": 73337064,
"domNodes": 80,
"jsHeapTotalBytes": 25165824,
"scriptDurationMs": 30.096,
"eventListeners": 21,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "dom-widget-clipping",
"durationMs": 549.7090000000071,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.560000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 332.581,
"heapDeltaBytes": 15214908,
"heapUsedBytes": 63870584,
"domNodes": 16,
"jsHeapTotalBytes": 16777216,
"scriptDurationMs": 57.419000000000004,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "dom-widget-clipping",
"durationMs": 550.8820000000014,
"styleRecalcs": 10,
"styleRecalcDurationMs": 6.956,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 344.338,
"heapDeltaBytes": 15008512,
"heapUsedBytes": 64213540,
"domNodes": 16,
"jsHeapTotalBytes": 16777216,
"scriptDurationMs": 54.82299999999999,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "large-graph-idle",
"durationMs": 2074.163999999996,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.963000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 606.617,
"heapDeltaBytes": 9812708,
"heapUsedBytes": 66892972,
"domNodes": -262,
"jsHeapTotalBytes": -495616,
"scriptDurationMs": 107.49300000000001,
"eventListeners": -129,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-idle",
"durationMs": 2026.4009999998507,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.827000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 675.173,
"heapDeltaBytes": 39353156,
"heapUsedBytes": 97160588,
"domNodes": -263,
"jsHeapTotalBytes": 33320960,
"scriptDurationMs": 110.93299999999999,
"eventListeners": -129,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2122.073999999998,
"styleRecalcs": 69,
"styleRecalcDurationMs": 18.55,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1197.807,
"heapDeltaBytes": 58592656,
"heapUsedBytes": 118575120,
"domNodes": -263,
"jsHeapTotalBytes": 35885056,
"scriptDurationMs": 398.60200000000003,
"eventListeners": -129,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2145.772999999963,
"styleRecalcs": 70,
"styleRecalcDurationMs": 19.292000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1180.77,
"heapDeltaBytes": -5206224,
"heapUsedBytes": 53093640,
"domNodes": -261,
"jsHeapTotalBytes": 6057984,
"scriptDurationMs": 405,
"eventListeners": -127,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3186.696999999981,
"styleRecalcs": 65,
"styleRecalcDurationMs": 19.314,
"layouts": 60,
"layoutDurationMs": 7.639,
"taskDurationMs": 1326.707,
"heapDeltaBytes": 9382716,
"heapUsedBytes": 70437840,
"domNodes": -266,
"jsHeapTotalBytes": 28672,
"scriptDurationMs": 479.646,
"eventListeners": -125,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3185.609000000113,
"styleRecalcs": 65,
"styleRecalcDurationMs": 19.342000000000002,
"layouts": 60,
"layoutDurationMs": 7.516,
"taskDurationMs": 1338.517,
"heapDeltaBytes": 7953556,
"heapUsedBytes": 69150172,
"domNodes": -270,
"jsHeapTotalBytes": 6057984,
"scriptDurationMs": 483.854,
"eventListeners": -125,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2053.5670000000437,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.394999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 607.3059999999999,
"heapDeltaBytes": 37081304,
"heapUsedBytes": 99070700,
"domNodes": -262,
"jsHeapTotalBytes": 32567296,
"scriptDurationMs": 95.803,
"eventListeners": -129,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2038.5099999998602,
"styleRecalcs": 9,
"styleRecalcDurationMs": 7.897999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 632.933,
"heapDeltaBytes": 40943580,
"heapUsedBytes": 102974356,
"domNodes": -263,
"jsHeapTotalBytes": 32305152,
"scriptDurationMs": 98.711,
"eventListeners": -129,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 524.485000000027,
"styleRecalcs": 46,
"styleRecalcDurationMs": 10.280999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 338.569,
"heapDeltaBytes": 14966812,
"heapUsedBytes": 65322080,
"domNodes": 18,
"jsHeapTotalBytes": 16515072,
"scriptDurationMs": 110.02800000000002,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 523.6509999999726,
"styleRecalcs": 45,
"styleRecalcDurationMs": 9.624999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 342.98299999999995,
"heapDeltaBytes": 9214256,
"heapUsedBytes": 58104848,
"domNodes": 16,
"jsHeapTotalBytes": 15728640,
"scriptDurationMs": 116.22900000000001,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-idle",
"durationMs": 2021.1839999999484,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.125,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 370.437,
"heapDeltaBytes": 22916388,
"heapUsedBytes": 71974088,
"domNodes": 18,
"jsHeapTotalBytes": 14680064,
"scriptDurationMs": 17.153000000000002,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-idle",
"durationMs": 2003.3350000001064,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.036999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 366.3310000000001,
"heapDeltaBytes": 22990520,
"heapUsedBytes": 72215004,
"domNodes": 18,
"jsHeapTotalBytes": 15204352,
"scriptDurationMs": 16.535,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1750.385999999935,
"styleRecalcs": 77,
"styleRecalcDurationMs": 40.524,
"layouts": 16,
"layoutDurationMs": 4.684000000000001,
"taskDurationMs": 771.2320000000001,
"heapDeltaBytes": 30647312,
"heapUsedBytes": 81075816,
"domNodes": 61,
"jsHeapTotalBytes": 40894464,
"scriptDurationMs": 91.18799999999999,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1699.8670000000402,
"styleRecalcs": 74,
"styleRecalcDurationMs": 36.706999999999994,
"layouts": 16,
"layoutDurationMs": 5.046,
"taskDurationMs": 681.664,
"heapDeltaBytes": 14451224,
"heapUsedBytes": 63553412,
"domNodes": 59,
"jsHeapTotalBytes": 14417920,
"scriptDurationMs": 88.71500000000002,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 898.194999999987,
"styleRecalcs": 16,
"styleRecalcDurationMs": 24.490000000000006,
"layouts": 5,
"layoutDurationMs": 10.875000000000002,
"taskDurationMs": 694.0029999999999,
"heapDeltaBytes": 30276956,
"heapUsedBytes": 95192412,
"domNodes": 13513,
"jsHeapTotalBytes": 16777216,
"scriptDurationMs": 27.151000000000007,
"eventListeners": 2527,
"totalBlockingTimeMs": 128,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8395.579999999994,
"styleRecalcs": 251,
"styleRecalcDurationMs": 55.317,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4175.525000000001,
"heapDeltaBytes": 76009372,
"heapUsedBytes": 134623984,
"domNodes": -262,
"jsHeapTotalBytes": 69701632,
"scriptDurationMs": 1290.342,
"eventListeners": -125,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 8424.514999999928,
"styleRecalcs": 251,
"styleRecalcDurationMs": 55.16399999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 4259.982999999999,
"heapDeltaBytes": 85378952,
"heapUsedBytes": 142805888,
"domNodes": -258,
"jsHeapTotalBytes": 76255232,
"scriptDurationMs": 1289.405,
"eventListeners": -125,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "vue-large-graph-idle",
"durationMs": 13254.290999999967,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13236.576,
"heapDeltaBytes": 11679332,
"heapUsedBytes": 266321420,
"domNodes": -8331,
"jsHeapTotalBytes": 16838656,
"scriptDurationMs": 663.0039999999999,
"eventListeners": -16488,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 13478.250000000116,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 13452.038000000002,
"heapDeltaBytes": 20892728,
"heapUsedBytes": 265262328,
"domNodes": -8331,
"jsHeapTotalBytes": 9170944,
"scriptDurationMs": 700.1529999999999,
"eventListeners": -16488,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-pan",
"durationMs": 12878.17300000006,
"styleRecalcs": 65,
"styleRecalcDurationMs": 17.176000000000023,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 12854.369999999999,
"heapDeltaBytes": -44586604,
"heapUsedBytes": 161329160,
"domNodes": -8331,
"jsHeapTotalBytes": 12906496,
"scriptDurationMs": 829.912,
"eventListeners": -16462,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 12860.413999999992,
"styleRecalcs": 65,
"styleRecalcDurationMs": 17.360999999999986,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 12829.301000000001,
"heapDeltaBytes": -58803028,
"heapUsedBytes": 156612048,
"domNodes": -8331,
"jsHeapTotalBytes": -3084288,
"scriptDurationMs": 944.0110000000001,
"eventListeners": -16462,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.77333333333336,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 451.50600000010854,
"styleRecalcs": 18,
"styleRecalcDurationMs": 23.628999999999998,
"layouts": 5,
"layoutDurationMs": 1.3870000000000002,
"taskDurationMs": 127.787,
"heapDeltaBytes": 5429396,
"heapUsedBytes": 55948396,
"domNodes": 168,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 27.932,
"eventListeners": 71,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "workflow-execution",
"durationMs": 445.34600000019964,
"styleRecalcs": 19,
"styleRecalcDurationMs": 23.421999999999997,
"layouts": 4,
"layoutDurationMs": 1.0639999999999998,
"taskDurationMs": 109.30300000000001,
"heapDeltaBytes": 5067732,
"heapUsedBytes": 55235904,
"domNodes": 157,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 20.897,
"eventListeners": 71,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999727
}
]
} |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/test-utils/mockFeatureFlags.ts (1)
42-43: 💤 Low valueConsider wrapping
flagswithreadonly()to match production behavior.The real
useFeatureFlags()returnsreadonly(flags)(line 179), preventing direct mutation. The mock returns the plain object, which allows test code to mutate flags in ways that wouldn't work in production. Wrapping withreadonly()would improve test fidelity.🔒 Suggested change
+import { readonly } from 'vue' + import { vi } from 'vitest'return { - flags, + flags: readonly(flags), featureFlag: vi.fn() as unknown as ReturnType<🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/test-utils/mockFeatureFlags.ts` around lines 42 - 43, The mock return value currently exposes a mutable flags object; update the mock in mockFeatureFlags (the function returning { flags, ... }) to wrap flags with readonly()—matching the real useFeatureFlags() behavior—so tests cannot directly mutate flags; locate the return in the mockFeatureFlags module and replace the plain flags with readonly(flags) while preserving all other returned properties.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/test-utils/mockFeatureFlags.ts`:
- Around line 42-43: The mock return value currently exposes a mutable flags
object; update the mock in mockFeatureFlags (the function returning { flags, ...
}) to wrap flags with readonly()—matching the real useFeatureFlags() behavior—so
tests cannot directly mutate flags; locate the return in the mockFeatureFlags
module and replace the plain flags with readonly(flags) while preserving all
other returned properties.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 69282e6a-b09a-4268-be1d-7447779c02b0
📒 Files selected for processing (9)
src/components/common/VirtualGrid.vuesrc/components/rightSidePanel/RightSidePanel.vuesrc/components/ui/textarea/Textarea.vuesrc/composables/useFeatureFlags.tssrc/platform/assets/components/modelInfo/ModelInfoPanel.vuesrc/platform/assets/composables/useMediaAssetActions.tssrc/platform/assets/utils/assetMetadataUtils.test.tssrc/platform/assets/utils/assetMetadataUtils.tssrc/test-utils/mockFeatureFlags.ts
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #12287 +/- ##
===========================================
- Coverage 74.99% 61.92% -13.08%
===========================================
Files 1568 1454 -114
Lines 93339 75208 -18131
Branches 26581 19599 -6982
===========================================
- Hits 70002 46569 -23433
- Misses 22634 28294 +5660
+ Partials 703 345 -358
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1144 files with indirect coverage changes 🚀 New features to boost your workflow:
|
knip flagged the newly added mockFeatureFlags test util and the FeatureFlags type export as unused, failing lint-and-format. Both are prerequisites consumed by upcoming stacked L1 sub-issue PRs, not by code in this PR. - Ignore src/test-utils/mockFeatureFlags.ts in knip.config.ts, matching the existing "pending integration in stacked PR" precedent. - Tag the FeatureFlags type export with @knipIgnoreUsedByStackedPR, matching the existing tag usage in apps/website/src/utils/video.ts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
DrJKL
left a comment
There was a problem hiding this comment.
Flying in from the vexillology desk — eight signals raised against the diff. Two heraldic field-faults need fixing before this banner unfurls; the rest are pennants for follow-up.
Verified before posting:
- The Cloud-vs-OSS
isCloud && asset.asset_hash ? asset.asset_hash : asset.namepattern has only one remaining occurrence (the new helper itself). Refactor charge is complete. isCloudis still used on lines 99 and 123 ofuseMediaAssetActions.ts, so the import is not orphaned.mockFeatureFlagsis not yet flown anywhere outside its own JSDoc example — confirmed it awaits the stacked L1 fleet.- 14 test files already inline-mock
useFeatureFlagsvia the flatvi.hoistedpattern (CurrentUserButton.test.ts,useWorkflowActionsMenu.test.ts,authTokenPriority.test.ts, …).
| * For display use {@link getAssetDisplayFilename}; for serialized | ||
| * identifiers use {@link getAssetFilename}. | ||
| */ | ||
| export function getAssetStoredFilename(asset: AssetItem): string { |
There was a problem hiding this comment.
L3 — three banners, near-identical devices. getAssetFilename, getAssetStoredFilename, and getAssetDisplayFilename all march as (AssetItem) => string and all concern "filename." Without the docstrings, picking the right one is heraldic guesswork. Not blocking this PR, but if there's a rename-pass follow-up, more semantic suffixes (e.g. getAssetCanonicalFilename / getAssetStorageFilename / getAssetVisibleFilename) would help future readers pick the correct ensign on sight.
…ed feature-flag test infra Per review (DrJKL): mockFeatureFlags and the exported FeatureFlags type have no live consumer in the open stack — FE-729~732 (#12322/#12335/#12375/#12417) don't use them, and FE-780/781 (#12485/#12486) still hand-roll inline vi.hoisted mocks. Shipping them here adds a public surface with no caller, so split them out; they'll be reintroduced bundled with the first PR that actually adopts the util. This PR is now scoped to the getAssetStoredFilename extraction, which is consumed at its two call sites in useMediaAssetActions. Retained-code review fixes: - M3: spread importOriginal in the distribution/types mock so isDesktop and isNightly survive the wholesale replacement. - L2: trim getAssetStoredFilename JSDoc; demote the BE-933/934 collapse to a one-line TODO. Removed: src/test-utils/mockFeatureFlags.ts, the FeatureFlags type export, and its knip ignore entry. Pre-split state preserved on local branch jaewon/fe-733-presplit-snapshot. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
d04d2f4 to
499b2a2
Compare
Resolve useMediaAssetActions.ts conflict: fold main's hash ?? asset_hash precedence into getAssetStoredFilename so both call sites keep using the extracted helper while honoring the new canonical hash field.
🌐 Website E2ETip All tests passed.
🔗 Website PreviewWebsite Preview: https://comfy-website-preview-pr-12287.vercel.app This commit: https://website-frontend-gotiyl8e0-comfyui.vercel.app Last updated: 2026-06-13T03:53:03Z for |
|
High-level safety summary for anyone landing here: Why this is safe to merge
Net: same behavior today, one switch-point tomorrow. |
|
Correction to my earlier note — main moved under this branch, so it's no longer a clean lift-and-merge. Two things to reconcile on rebase:
Once rebased + reconciled, the substance is still sound (the BE-ready check holds, threads resolved, DrJKL re-approved). It just needs the rebase first now rather than going in ahead of the queue. |
| * TODO(BE-933/934): collapse to `asset.file_path ?? asset.name`. | ||
| */ | ||
| export function getAssetStoredFilename(asset: AssetItem): string { | ||
| const hash = asset.hash ?? asset.asset_hash |
There was a problem hiding this comment.
Heads-up for the rebase: main has independently rewritten this same callsite (useMediaAssetActions.ts ~306/450) to read const cloudHash = asset.hash — it dropped the ?? asset_hash fallback already. So when you resolve the conflict here, collapse this to:
const hash = asset.hashKeeping asset.hash ?? asset.asset_hash would silently re-introduce the deprecated alias main just removed, which makes the extracted helper a behavior change against current main rather than the no-op refactor it's meant to be. (The rest of the conflicts are the deleted affiliates/* files — just accept main's deletions there.)
There was a problem hiding this comment.
Done in the merge (e73e5b4af) — collapsed the helper to drop the asset_hash alias exactly as flagged:
export function getAssetStoredFilename(asset: AssetItem): string {
return isCloud && asset.hash ? asset.hash : asset.name
}Two notes:
- It wasn't only a behavior concern:
mainremovedasset_hashfrom thezAssetschema entirely, soasset.hash ?? asset.asset_hashwas also a hard typecheck failure — same fix either way. I inlined the single-usehashlocal rather than keeping aconst hash = asset.hashbinding; identical behavior, one fewer name. - Updated the JSDoc to drop the alias mention and removed the now-meaningless "prefers hash over the deprecated alias" unit test. Remaining tests still cover cloud→hash, cloud→name fallback, and OSS→name.
Affiliate *.vue conflicts resolved as "take main" (accepted the deletions). typecheck / typecheck:browser / typecheck:website / lint / knip all green; PR is now MERGEABLE.
…-stored-filename-helper # Conflicts: # apps/website/src/components/affiliates/AudienceSection.vue # apps/website/src/components/affiliates/BrandAssetsSection.vue # apps/website/src/components/affiliates/FooterCtaSection.vue # apps/website/src/components/affiliates/HeroSection.vue # apps/website/src/components/affiliates/HowItWorksSection.vue # apps/website/src/components/affiliates/ProgramDetailsSection.vue # apps/website/src/components/affiliates/TrustBandSection.vue # src/platform/assets/composables/useMediaAssetActions.ts
e73e5b4
|
Rebase looks correct — the helper collapsed to One optional cleanup if you want a tidy diff: the rebase pulled in ~10 git checkout origin/main -- apps/website/
git commit -m "chore: drop unrelated website class-order churn"Totally non-blocking though — the functional change is good to go, so don't hold the stack on class ordering if you'd rather just ship. Just flagging since a helper-extraction PR touching 10 marketing-site files reads oddly in review. |
) ## Summary L1 prerequisite cleanup, scoped to a single type-preserving refactor: extract `getAssetStoredFilename(asset)` to collapse the duplicated `isCloud && asset.asset_hash ? asset.asset_hash : asset.name` branch from `useMediaAssetActions.ts` into one helper in `assetMetadataUtils.ts`. No behavior change. Once BE-933/934 emit `file_path` and the cloud spec sync brings the field into generated types, only the helper internals change (collapse to `asset.file_path ?? asset.name`). ## Scope change (per review) The `mockFeatureFlags` test util and the exported `FeatureFlags` type that this PR originally also added have been **split out**. They had no live consumer in the open stack — FE-729~732 (#12322 / #12335 / #12375 / #12417) don't use them, and FE-780 / FE-781 (#12485 / #12486) still hand-roll inline `vi.hoisted` mocks — so shipping them here would add a public surface with no caller. They will be reintroduced bundled with the first PR that actually adopts the util, where `featureFlag`'s return type and the "all flags off vs. production defaults" semantics can be validated against a real consumer. ## Review fixes carried in this PR - Mock `@/platform/distribution/types` via an `importOriginal` spread so `isDesktop` / `isNightly` survive the wholesale replacement (only `isCloud` was re-hoisted before). - Trimmed the `getAssetStoredFilename` JSDoc; the BE-933/934 future-collapse is now a one-line `TODO` rather than a design-doc paragraph. ## Review Focus - The helper is intentionally named `getAssetStoredFilename` to disambiguate from the existing `getAssetFilename` (which targets `user_metadata.filename` / `metadata.filename` for serialized-identifier contexts — missing-model matching, filename schema validation) and `getAssetDisplayFilename` (UI labels). Folding the `isCloud && asset_hash` fallback into either of those would regress display/identifier sites where the cloud hash is never meant to surface. - Fixes FE-733 - Parent: FE-601 (L1 umbrella) - RFC: [Asset Identity Semantics](https://www.notion.so/comfy-org/RFC-Asset-Identity-Semantics-35a6d73d365080e59d59c98cebae779b) - Survey: [Asset FE Divergence Survey M1 Scope](https://www.notion.so/comfy-org/Assets-FE-Divergence-Survey-M1-Scope-3616d73d365080d0a9cbf5f2394c12f8) - Slack thread: https://comfy-organization.slack.com/archives/C0AUUTS2RQV/p1778815571949519 ## Screenshots (if applicable) N/A — no UI change. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-12287-refactor-assets-extract-getAssetStoredFilename-helper-add-mockFeatureFlags-test-util-3616d73d365081c9a1c6e1982728a38a) by [Unito](https://www.unito.io) --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Alexander Brown <drjkl@comfy.org> Co-authored-by: Matt Miller <matt@miller-media.com>
) ## Summary L1 prerequisite cleanup, scoped to a single type-preserving refactor: extract `getAssetStoredFilename(asset)` to collapse the duplicated `isCloud && asset.asset_hash ? asset.asset_hash : asset.name` branch from `useMediaAssetActions.ts` into one helper in `assetMetadataUtils.ts`. No behavior change. Once BE-933/934 emit `file_path` and the cloud spec sync brings the field into generated types, only the helper internals change (collapse to `asset.file_path ?? asset.name`). ## Scope change (per review) The `mockFeatureFlags` test util and the exported `FeatureFlags` type that this PR originally also added have been **split out**. They had no live consumer in the open stack — FE-729~732 (#12322 / #12335 / #12375 / #12417) don't use them, and FE-780 / FE-781 (#12485 / #12486) still hand-roll inline `vi.hoisted` mocks — so shipping them here would add a public surface with no caller. They will be reintroduced bundled with the first PR that actually adopts the util, where `featureFlag`'s return type and the "all flags off vs. production defaults" semantics can be validated against a real consumer. ## Review fixes carried in this PR - Mock `@/platform/distribution/types` via an `importOriginal` spread so `isDesktop` / `isNightly` survive the wholesale replacement (only `isCloud` was re-hoisted before). - Trimmed the `getAssetStoredFilename` JSDoc; the BE-933/934 future-collapse is now a one-line `TODO` rather than a design-doc paragraph. ## Review Focus - The helper is intentionally named `getAssetStoredFilename` to disambiguate from the existing `getAssetFilename` (which targets `user_metadata.filename` / `metadata.filename` for serialized-identifier contexts — missing-model matching, filename schema validation) and `getAssetDisplayFilename` (UI labels). Folding the `isCloud && asset_hash` fallback into either of those would regress display/identifier sites where the cloud hash is never meant to surface. - Fixes FE-733 - Parent: FE-601 (L1 umbrella) - RFC: [Asset Identity Semantics](https://www.notion.so/comfy-org/RFC-Asset-Identity-Semantics-35a6d73d365080e59d59c98cebae779b) - Survey: [Asset FE Divergence Survey M1 Scope](https://www.notion.so/comfy-org/Assets-FE-Divergence-Survey-M1-Scope-3616d73d365080d0a9cbf5f2394c12f8) - Slack thread: https://comfy-organization.slack.com/archives/C0AUUTS2RQV/p1778815571949519 ## Screenshots (if applicable) N/A — no UI change. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-12287-refactor-assets-extract-getAssetStoredFilename-helper-add-mockFeatureFlags-test-util-3616d73d365081c9a1c6e1982728a38a) by [Unito](https://www.unito.io) --------- Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Alexander Brown <drjkl@comfy.org> Co-authored-by: Matt Miller <matt@miller-media.com>
Summary
L1 prerequisite cleanup, scoped to a single type-preserving refactor: extract
getAssetStoredFilename(asset)to collapse the duplicatedisCloud && asset.asset_hash ? asset.asset_hash : asset.namebranch fromuseMediaAssetActions.tsinto one helper inassetMetadataUtils.ts. No behavior change.Once BE-933/934 emit
file_pathand the cloud spec sync brings the field into generated types, only the helper internals change (collapse toasset.file_path ?? asset.name).Scope change (per review)
The
mockFeatureFlagstest util and the exportedFeatureFlagstype that this PR originally also added have been split out. They had no live consumer in the open stack — FE-729~732 (#12322 / #12335 / #12375 / #12417) don't use them, and FE-780 / FE-781 (#12485 / #12486) still hand-roll inlinevi.hoistedmocks — so shipping them here would add a public surface with no caller. They will be reintroduced bundled with the first PR that actually adopts the util, wherefeatureFlag's return type and the "all flags off vs. production defaults" semantics can be validated against a real consumer.Review fixes carried in this PR
@/platform/distribution/typesvia animportOriginalspread soisDesktop/isNightlysurvive the wholesale replacement (onlyisCloudwas re-hoisted before).getAssetStoredFilenameJSDoc; the BE-933/934 future-collapse is now a one-lineTODOrather than a design-doc paragraph.Review Focus
The helper is intentionally named
getAssetStoredFilenameto disambiguate from the existinggetAssetFilename(which targetsuser_metadata.filename/metadata.filenamefor serialized-identifier contexts — missing-model matching, filename schema validation) andgetAssetDisplayFilename(UI labels). Folding theisCloud && asset_hashfallback into either of those would regress display/identifier sites where the cloud hash is never meant to surface.Fixes FE-733
Parent: FE-601 (L1 umbrella)
RFC: Asset Identity Semantics
Survey: Asset FE Divergence Survey M1 Scope
Slack thread: https://comfy-organization.slack.com/archives/C0AUUTS2RQV/p1778815571949519
Screenshots (if applicable)
N/A — no UI change.
┆Issue is synchronized with this Notion page by Unito