Repository navigation
[HOTFIX] Fix missing model Electron download UI state - #11350
benceruleanlu wants to merge 2 commits into
Conversation
🎨 Storybook: ✅ Built — View Storybook |
🎭 Playwright: ✅ 1166 passed, 0 failed · 1 flaky📊 Browser Reports
|
📝 WalkthroughWalkthroughThis PR enhances download status tracking by introducing a standardized Changes
Sequence DiagramsequenceDiagram
participant Component as MissingModelRow
participant Composable as useMissingModelInteractions
participant DownloadFn as downloadModel
participant ElectronStore as electronDownloadStore
participant DownloadMgr as DownloadManager
rect rgba(100, 150, 200, 0.5)
Note over Component,DownloadMgr: Download Initiated
Component->>DownloadFn: downloadModel(url, savePath, filename)
alt Desktop Environment
DownloadFn->>ElectronStore: start({url, savePath, filename})
ElectronStore->>DownloadMgr: startDownload(url, savePath, filename)
DownloadMgr-->>ElectronStore: started (boolean)
ElectronStore-->>DownloadFn: Promise<started>
else Browser Environment
DownloadFn->>DownloadFn: trigger anchor click
end
DownloadFn-->>Component: Promise<boolean>
end
rect rgba(150, 200, 100, 0.5)
Note over Component,Composable: Conditional Follow-up
Component->>Composable: isSelectionConfirmable(key, url)
Composable->>Composable: getDownloadStatus(key, url)
Composable-->>Component: boolean (confirmable)
alt started === true
Component->>Component: handleComboSelect(key, name)
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error, 1 warning)
✅ Passed checks (3 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
📦 Bundle: 5.16 MB gzip 🔴 +294 BDetailsSummary
Category Glance App Entry Points — 22.3 kB (baseline 22.3 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.22 MB (baseline 1.22 MB) • 🔴 +1.09 kBGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 76.6 kB (baseline 76.6 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 9 added / 9 removed / 2 unchanged Panels & Settings — 482 kB (baseline 482 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 10 added / 10 removed / 11 unchanged User & Accounts — 17.1 kB (baseline 17.1 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 5 added / 5 removed / 2 unchanged Editors & Dialogs — 110 kB (baseline 110 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 2 added / 2 removed UI Components — 60.3 kB (baseline 60.3 kB) • ⚪ 0 BReusable component library chunks
Status: 5 added / 5 removed / 8 unchanged Data & Services — 3.01 MB (baseline 3.01 MB) • 🔴 +143 BStores, services, APIs, and repositories
Status: 14 added / 14 removed / 3 unchanged Utilities & Hooks — 344 kB (baseline 344 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 13 added / 13 removed / 14 unchanged Vendor & Third-Party — 9.86 MB (baseline 9.86 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 16 unchanged Other — 8.57 MB (baseline 8.57 MB) • 🔴 +61 BBundles that do not match a named category
Status: 58 added / 58 removed / 77 unchanged ⚡ Performance Report
No regressions detected. All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-04-17T22:44:02.299Z",
"gitSha": "952b5331892c3595fae93d9850b5d100c612df53",
"branch": "bl/missing-model-download-ui-fix",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2010.5899999999792,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.444,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 350.06399999999996,
"heapDeltaBytes": 19978508,
"heapUsedBytes": 63970980,
"domNodes": 18,
"jsHeapTotalBytes": 22806528,
"scriptDurationMs": 16.387000000000004,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-idle",
"durationMs": 2021.158000000014,
"styleRecalcs": 8,
"styleRecalcDurationMs": 8.17,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 370.972,
"heapDeltaBytes": 19825296,
"heapUsedBytes": 64289052,
"domNodes": 16,
"jsHeapTotalBytes": 23330816,
"scriptDurationMs": 19.309000000000005,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2020.9600000000592,
"styleRecalcs": 11,
"styleRecalcDurationMs": 10.841999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 399.54,
"heapDeltaBytes": 19985664,
"heapUsedBytes": 63985056,
"domNodes": 21,
"jsHeapTotalBytes": 22806528,
"scriptDurationMs": 22.633999999999997,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2014.257999999984,
"styleRecalcs": 84,
"styleRecalcDurationMs": 43.79,
"layouts": 12,
"layoutDurationMs": 3.2399999999999998,
"taskDurationMs": 956.1179999999999,
"heapDeltaBytes": 15658136,
"heapUsedBytes": 59568172,
"domNodes": 66,
"jsHeapTotalBytes": 23068672,
"scriptDurationMs": 127.303,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2049.2060000000265,
"styleRecalcs": 80,
"styleRecalcDurationMs": 48.927,
"layouts": 12,
"layoutDurationMs": 3.314,
"taskDurationMs": 954.485,
"heapDeltaBytes": 16442360,
"heapUsedBytes": 60298572,
"domNodes": 66,
"jsHeapTotalBytes": 23592960,
"scriptDurationMs": 128.31500000000003,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1830.961000000002,
"styleRecalcs": 71,
"styleRecalcDurationMs": 36.274,
"layouts": 12,
"layoutDurationMs": 3.725,
"taskDurationMs": 788.413,
"heapDeltaBytes": 15616708,
"heapUsedBytes": 59537468,
"domNodes": 53,
"jsHeapTotalBytes": 23855104,
"scriptDurationMs": 136.575,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1721.7319999999745,
"styleRecalcs": 31,
"styleRecalcDurationMs": 18.471999999999994,
"layouts": 6,
"layoutDurationMs": 0.758,
"taskDurationMs": 322.13199999999995,
"heapDeltaBytes": 24658316,
"heapUsedBytes": 68165572,
"domNodes": 78,
"jsHeapTotalBytes": 21495808,
"scriptDurationMs": 28.169000000000008,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1713.5710000000017,
"styleRecalcs": 30,
"styleRecalcDurationMs": 16.012,
"layouts": 6,
"layoutDurationMs": 0.5189999999999999,
"taskDurationMs": 287.771,
"heapDeltaBytes": 24581560,
"heapUsedBytes": 69788020,
"domNodes": 75,
"jsHeapTotalBytes": 21495808,
"scriptDurationMs": 18.415999999999997,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66999999999998,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1738.7249999999312,
"styleRecalcs": 32,
"styleRecalcDurationMs": 16.762,
"layouts": 6,
"layoutDurationMs": 0.5889999999999999,
"taskDurationMs": 292.097,
"heapDeltaBytes": 24371400,
"heapUsedBytes": 68031836,
"domNodes": 79,
"jsHeapTotalBytes": 20971520,
"scriptDurationMs": 18.13,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 628.1710000000089,
"styleRecalcs": 9,
"styleRecalcDurationMs": 14.107999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 377.20699999999994,
"heapDeltaBytes": 6892300,
"heapUsedBytes": 50963192,
"domNodes": 14,
"jsHeapTotalBytes": 12582912,
"scriptDurationMs": 70.362,
"eventListeners": 0,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "dom-widget-clipping",
"durationMs": 567.3889999999346,
"styleRecalcs": 11,
"styleRecalcDurationMs": 8.148000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 337.403,
"heapDeltaBytes": 6681700,
"heapUsedBytes": 50608360,
"domNodes": 18,
"jsHeapTotalBytes": 12582912,
"scriptDurationMs": 60.449000000000005,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "dom-widget-clipping",
"durationMs": 580.2439999999933,
"styleRecalcs": 11,
"styleRecalcDurationMs": 8.240999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 346.007,
"heapDeltaBytes": 6800864,
"heapUsedBytes": 50686964,
"domNodes": 18,
"jsHeapTotalBytes": 13107200,
"scriptDurationMs": 60.29799999999999,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.669999999999998,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "large-graph-idle",
"durationMs": 2035.7139999999845,
"styleRecalcs": 10,
"styleRecalcDurationMs": 10.265,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 532.284,
"heapDeltaBytes": 4250204,
"heapUsedBytes": 56614532,
"domNodes": -257,
"jsHeapTotalBytes": 16420864,
"scriptDurationMs": 97.777,
"eventListeners": -125,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2055.095999999935,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.616999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 552.1750000000001,
"heapDeltaBytes": 564392,
"heapUsedBytes": 54189468,
"domNodes": -261,
"jsHeapTotalBytes": 14848000,
"scriptDurationMs": 99.98899999999999,
"eventListeners": -125,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2047.6609999999482,
"styleRecalcs": 10,
"styleRecalcDurationMs": 9.582,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 575.863,
"heapDeltaBytes": 3272436,
"heapUsedBytes": 56952916,
"domNodes": -259,
"jsHeapTotalBytes": 17207296,
"scriptDurationMs": 116.87799999999999,
"eventListeners": -127,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2101.0420000000067,
"styleRecalcs": 69,
"styleRecalcDurationMs": 17.335000000000004,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1046.3519999999999,
"heapDeltaBytes": 11891364,
"heapUsedBytes": 65147716,
"domNodes": -262,
"jsHeapTotalBytes": 18460672,
"scriptDurationMs": 390.637,
"eventListeners": -127,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2155.110000000036,
"styleRecalcs": 67,
"styleRecalcDurationMs": 16.794,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1170.38,
"heapDeltaBytes": 20819992,
"heapUsedBytes": 75593224,
"domNodes": -263,
"jsHeapTotalBytes": 18198528,
"scriptDurationMs": 446.36600000000004,
"eventListeners": -127,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-pan",
"durationMs": 2137.6940000000104,
"styleRecalcs": 69,
"styleRecalcDurationMs": 17.553999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1068.813,
"heapDeltaBytes": 18638612,
"heapUsedBytes": 73176932,
"domNodes": -262,
"jsHeapTotalBytes": 17674240,
"scriptDurationMs": 380.872,
"eventListeners": -127,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3180.7750000000397,
"styleRecalcs": 65,
"styleRecalcDurationMs": 17.809,
"layouts": 60,
"layoutDurationMs": 7.181,
"taskDurationMs": 1352.144,
"heapDeltaBytes": 9117444,
"heapUsedBytes": 65459240,
"domNodes": -266,
"jsHeapTotalBytes": 16683008,
"scriptDurationMs": 522.6840000000001,
"eventListeners": -123,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3164.0560000000733,
"styleRecalcs": 62,
"styleRecalcDurationMs": 14.918000000000001,
"layouts": 60,
"layoutDurationMs": 7.28,
"taskDurationMs": 1370.8590000000002,
"heapDeltaBytes": 886296,
"heapUsedBytes": 59978228,
"domNodes": -269,
"jsHeapTotalBytes": 17707008,
"scriptDurationMs": 523.1279999999999,
"eventListeners": -123,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3161.8780000000015,
"styleRecalcs": 66,
"styleRecalcDurationMs": 19.036,
"layouts": 60,
"layoutDurationMs": 7.219999999999999,
"taskDurationMs": 1366.587,
"heapDeltaBytes": 9763696,
"heapUsedBytes": 65558040,
"domNodes": -265,
"jsHeapTotalBytes": 16420864,
"scriptDurationMs": 527.4169999999999,
"eventListeners": -123,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "minimap-idle",
"durationMs": 2042.763999999977,
"styleRecalcs": 9,
"styleRecalcDurationMs": 9.336,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 537.2660000000001,
"heapDeltaBytes": 2720692,
"heapUsedBytes": 58482812,
"domNodes": -263,
"jsHeapTotalBytes": 16158720,
"scriptDurationMs": 95.932,
"eventListeners": -127,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2060.0389999999607,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.696999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 512.076,
"heapDeltaBytes": 3121420,
"heapUsedBytes": 58848348,
"domNodes": -263,
"jsHeapTotalBytes": 15634432,
"scriptDurationMs": 89.926,
"eventListeners": -127,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "minimap-idle",
"durationMs": 2009.241999999972,
"styleRecalcs": 8,
"styleRecalcDurationMs": 7.32,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 519.394,
"heapDeltaBytes": 2641428,
"heapUsedBytes": 58554732,
"domNodes": -265,
"jsHeapTotalBytes": 15372288,
"scriptDurationMs": 88.118,
"eventListeners": -127,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 542.808999999977,
"styleRecalcs": 44,
"styleRecalcDurationMs": 8.944,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 358.80300000000005,
"heapDeltaBytes": 6657444,
"heapUsedBytes": 50894176,
"domNodes": 14,
"jsHeapTotalBytes": 12582912,
"scriptDurationMs": 119.91799999999999,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 533.4339999999429,
"styleRecalcs": 47,
"styleRecalcDurationMs": 11.136000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 338.26200000000006,
"heapDeltaBytes": 5884888,
"heapUsedBytes": 49539088,
"domNodes": 20,
"jsHeapTotalBytes": 13107200,
"scriptDurationMs": 118.629,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999727
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 575.4399999999578,
"styleRecalcs": 47,
"styleRecalcDurationMs": 12.516000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 359.751,
"heapDeltaBytes": 7053648,
"heapUsedBytes": 51012612,
"domNodes": 20,
"jsHeapTotalBytes": 13369344,
"scriptDurationMs": 121.98799999999999,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "subgraph-idle",
"durationMs": 2019.4430000000239,
"styleRecalcs": 10,
"styleRecalcDurationMs": 9.157999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 320.421,
"heapDeltaBytes": 19771912,
"heapUsedBytes": 63744460,
"domNodes": 20,
"jsHeapTotalBytes": 22806528,
"scriptDurationMs": 12.874000000000002,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-idle",
"durationMs": 2039.150999999947,
"styleRecalcs": 11,
"styleRecalcDurationMs": 9.773000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 343.054,
"heapDeltaBytes": 19934636,
"heapUsedBytes": 63858308,
"domNodes": 21,
"jsHeapTotalBytes": 22806528,
"scriptDurationMs": 18.628000000000004,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-idle",
"durationMs": 1991.7669999999816,
"styleRecalcs": 10,
"styleRecalcDurationMs": 11.796,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 351.411,
"heapDeltaBytes": 19797636,
"heapUsedBytes": 63709160,
"domNodes": 20,
"jsHeapTotalBytes": 23330816,
"scriptDurationMs": 15.173999999999992,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1700.0770000000216,
"styleRecalcs": 78,
"styleRecalcDurationMs": 39.703,
"layouts": 16,
"layoutDurationMs": 4.247000000000001,
"taskDurationMs": 656.064,
"heapDeltaBytes": 11420272,
"heapUsedBytes": 55382756,
"domNodes": 64,
"jsHeapTotalBytes": 23068672,
"scriptDurationMs": 98.04599999999999,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1708.9620000000423,
"styleRecalcs": 76,
"styleRecalcDurationMs": 37.294999999999995,
"layouts": 16,
"layoutDurationMs": 4.512,
"taskDurationMs": 660.6469999999999,
"heapDeltaBytes": 11837992,
"heapUsedBytes": 57271780,
"domNodes": 63,
"jsHeapTotalBytes": 23068672,
"scriptDurationMs": 95.78099999999999,
"eventListeners": 4,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1967.50899999995,
"styleRecalcs": 83,
"styleRecalcDurationMs": 47.497,
"layouts": 16,
"layoutDurationMs": 4.841,
"taskDurationMs": 882.445,
"heapDeltaBytes": 11839076,
"heapUsedBytes": 55746896,
"domNodes": 70,
"jsHeapTotalBytes": 22544384,
"scriptDurationMs": 100.03300000000002,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "viewport-pan-sweep",
"durationMs": 8165.030000000002,
"styleRecalcs": 251,
"styleRecalcDurationMs": 51.754999999999995,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3662.5570000000002,
"heapDeltaBytes": 22608868,
"heapUsedBytes": 76020436,
"domNodes": -258,
"jsHeapTotalBytes": 17674240,
"scriptDurationMs": 1235.536,
"eventListeners": -109,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8193.917000000056,
"styleRecalcs": 250,
"styleRecalcDurationMs": 55.914,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3580.566,
"heapDeltaBytes": 24692468,
"heapUsedBytes": 77873392,
"domNodes": -262,
"jsHeapTotalBytes": 18722816,
"scriptDurationMs": 1236.9279999999999,
"eventListeners": -111,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "viewport-pan-sweep",
"durationMs": 8193.169000000013,
"styleRecalcs": 249,
"styleRecalcDurationMs": 50.589000000000006,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 3698.183,
"heapDeltaBytes": 22100636,
"heapUsedBytes": 76445212,
"domNodes": -261,
"jsHeapTotalBytes": 19771392,
"scriptDurationMs": 1267.2020000000002,
"eventListeners": -111,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 12018.404999999973,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 12010.981999999998,
"heapDeltaBytes": -47132136,
"heapUsedBytes": 168058668,
"domNodes": -9850,
"jsHeapTotalBytes": 25751552,
"scriptDurationMs": 588.096,
"eventListeners": -23961,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.80000000000291
},
{
"name": "vue-large-graph-idle",
"durationMs": 11840.418,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 11831.490999999998,
"heapDeltaBytes": -46955436,
"heapUsedBytes": 168891728,
"domNodes": -9850,
"jsHeapTotalBytes": 26537984,
"scriptDurationMs": 603.91,
"eventListeners": -23961,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 12338.942999999972,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 12325.663999999999,
"heapDeltaBytes": -27161212,
"heapUsedBytes": 188054676,
"domNodes": -9850,
"jsHeapTotalBytes": 24178688,
"scriptDurationMs": 627.3839999999999,
"eventListeners": -23959,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 14120.603000000017,
"styleRecalcs": 66,
"styleRecalcDurationMs": 15.587000000000018,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14100.626,
"heapDeltaBytes": -63525616,
"heapUsedBytes": 162229188,
"domNodes": -9850,
"jsHeapTotalBytes": -8589312,
"scriptDurationMs": 903.497,
"eventListeners": -23953,
"totalBlockingTimeMs": 41,
"frameDurationMs": 17.219999999999953,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-pan",
"durationMs": 14169.571999999902,
"styleRecalcs": 67,
"styleRecalcDurationMs": 16.019000000000005,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 14149.695999999998,
"heapDeltaBytes": -42370524,
"heapUsedBytes": 171452028,
"domNodes": -9850,
"jsHeapTotalBytes": -12607488,
"scriptDurationMs": 841.9240000000001,
"eventListeners": -23983,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.223333333333358,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 15029.85000000001,
"styleRecalcs": 72,
"styleRecalcDurationMs": 17.58500000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 15007.373999999998,
"heapDeltaBytes": -74119652,
"heapUsedBytes": 150222992,
"domNodes": -9848,
"jsHeapTotalBytes": -10424320,
"scriptDurationMs": 899.5749999999999,
"eventListeners": -23983,
"totalBlockingTimeMs": 103,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "workflow-execution",
"durationMs": 128.72300000003634,
"styleRecalcs": 10,
"styleRecalcDurationMs": 18.296000000000003,
"layouts": 4,
"layoutDurationMs": 1.744,
"taskDurationMs": 93.609,
"heapDeltaBytes": 3374300,
"heapUsedBytes": 54728504,
"domNodes": 145,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 20.555000000000003,
"eventListeners": 37,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.700000000000273
},
{
"name": "workflow-execution",
"durationMs": 456.8089999999074,
"styleRecalcs": 13,
"styleRecalcDurationMs": 19.882,
"layouts": 5,
"layoutDurationMs": 1.3960000000000001,
"taskDurationMs": 112.382,
"heapDeltaBytes": 4944832,
"heapUsedBytes": 50485340,
"domNodes": 150,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 23.779,
"eventListeners": 71,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.663333333333338,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "workflow-execution",
"durationMs": 452.207000000044,
"styleRecalcs": 12,
"styleRecalcDurationMs": 17.46,
"layouts": 5,
"layoutDurationMs": 1.1949999999999998,
"taskDurationMs": 105.05699999999999,
"heapDeltaBytes": 4949464,
"heapUsedBytes": 50517396,
"domNodes": 148,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 22.474,
"eventListeners": 71,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999727
}
]
} |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6584566595
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| link.rel = 'noopener noreferrer' | ||
| link.click() | ||
| return | ||
| return Promise.resolve(true) |
There was a problem hiding this comment.
Avoid treating browser link open as completed download start
For non-desktop builds this path returns true immediately after link.click(), but MissingModelRow.handleDownload() now interprets that as a successful start and auto-selects the missing filename, which enables confirmation without any real download state. In web/self-hosted usage (where Electron progress tracking is unavailable), users can clear a missing-model error even if the browser download never finishes or is cancelled/blocked.
Useful? React with 👍 / 👎.
| } | ||
| return true | ||
| const status = getDownloadStatus(key, downloadUrl) | ||
| return !status || status.status === 'completed' |
There was a problem hiding this comment.
Permit recovery selection when download status is failed
This condition now blocks confirmation for any non-completed status, including failed/cancelled desktop downloads. Because the row always passes model.representative.url into isSelectionConfirmable, a stale failed entry from electronDownloadStore.findByUrl() can keep confirm disabled even after the user selects a different valid local model, creating a dead-end recovery path after one failed attempt.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/platform/missingModel/components/MissingModelRow.vue (1)
291-305:⚠️ Potential issue | 🟡 MinorMinor: potential double-click race while
downloadModelis pending.
handleDownloadis now async andawaitsdownloadModel(...)before callinghandleComboSelect, which is what gates the status card rendering (and hides the download button viav-if="!selectedLibraryModel[modelKey]"). During thatawaitwindow, the button stays visible and re-clickable, so a quick double-click can invokedownloadModeltwice.
electronDownloadStore.startdoes guard a duplicate entry via!findByUrl(url), butDownloadManager.startDownload(...)itself is still invoked twice — behavior there depends on the Electron side. Consider disabling the button while a download kickoff is in-flight (localref, or reuseisDownloadActiveby seeding pending state earlier).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/platform/missingModel/components/MissingModelRow.vue` around lines 291 - 305, handleDownload can be double-invoked while awaiting downloadModel; to fix, set a short-lived “starting” flag before awaiting and clear it after to prevent re-entry (e.g. use a local ref like isStartingDownload or seed selectedLibraryModel[modelKey] early), then make the download button respect that flag (same v-if/v-bind used for selectedLibraryModel or an isDownloadActive guard) so DownloadManager.startDownload cannot be triggered twice; update handleDownload, the download button binding, and/or seed electronDownloadStore.start (findByUrl) before awaiting to ensure only one kickoff occurs.
🧹 Nitpick comments (6)
src/platform/missingModel/missingModelDownload.test.ts (2)
38-64: Consider assertingstartis not called in the browser path.The browser test verifies
click()is invoked and resolvestrue, but doesn't assert thatmockStartDownloadis not called. Addingexpect(mockStartDownload).not.toHaveBeenCalled()would lock in theisDesktop === falsebranch and prevent regressions that accidentally call both paths.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/platform/missingModel/missingModelDownload.test.ts` around lines 38 - 64, The browser-path test for downloadModel should also assert the desktop download path isn't used: add an assertion like expect(mockStartDownload).not.toHaveBeenCalled() after the await/expect resolves to ensure mockStartDownload (the desktop helper) is not invoked when downloadModel runs in the browser branch; this locks the isDesktop === false behavior for the downloadModel function and prevents regressions that call both paths.
3-16: Considervi.hoisted()for the mutablemockIsDesktopflag.The
let mockIsDesktop = falsepattern at module scope with a getter invi.mockworks, but it sits against the guideline of keeping module mocks contained and avoiding module-level mutable state in test files.vi.hoisted()is the idiomatic Vitest way to share a mutable value between the hoisted mock factory and the test body:♻️ Optional refactor
-const mockStartDownload = vi.fn() -const mockUseElectronDownloadStore = vi.fn(() => ({ - start: mockStartDownload -})) -let mockIsDesktop = false - -vi.mock('@/platform/distribution/types', () => ({ - get isDesktop() { - return mockIsDesktop - } -})) +const hoisted = vi.hoisted(() => ({ + mockStartDownload: vi.fn(), + isDesktop: false +})) + +vi.mock('@/platform/distribution/types', () => ({ + get isDesktop() { + return hoisted.isDesktop + } +})) vi.mock('@/stores/electronDownloadStore', () => ({ - useElectronDownloadStore: () => mockUseElectronDownloadStore() + useElectronDownloadStore: () => ({ start: hoisted.mockStartDownload }) }))As per coding guidelines: "Keep module mocks contained; do not use global mutable state within the test file; use
vi.hoisted()if necessary for per-test mock manipulation".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/platform/missingModel/missingModelDownload.test.ts` around lines 3 - 16, Replace the module-level mutable flag pattern by hoisting a mutable mock value with vi.hoisted and using it inside the mocked module factory: create a hoisted container (e.g., const hoisted = vi.hoisted(() => ({ isDesktop: false })) ), update the vi.mock for '@/platform/distribution/types' to return a getter that reads hoisted().isDesktop, and in tests mutate hoisted().isDesktop instead of the top-level mockIsDesktop variable; adjust references where mockIsDesktop is read or set and keep the existing useElectronDownloadStore/mockStartDownload mocks unchanged.src/components/rightSidePanel/errors/TabErrors.vue (1)
348-352:voiddiscards are fine, but consider error handling for unhandled rejections.
downloadModel(...)now returns aPromise<boolean>that internallyawaitsDownloadManager.startDownload(...)on desktop. If that underlying call rejects (e.g., IPC/permission error), the rejection will surface as an unhandled promise rejection since wevoidit here without a.catch().Since this is a "download all" loop, a failure on one shouldn't block the rest — but wrapping with
.catch()(ortry/awaitper iteration) would keep the console clean and let users see which downloads failed to start.🛡️ Suggested fix
function downloadAllModels() { for (const model of downloadableModels.value) { - void downloadModel(model, missingModelStore.folderPaths) + downloadModel(model, missingModelStore.folderPaths).catch((err: unknown) => { + console.warn(`[TabErrors] Failed to start download for ${model.name}:`, err) + }) } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/rightSidePanel/errors/TabErrors.vue` around lines 348 - 352, The loop in downloadAllModels calls downloadModel(...) with a void discard causing unhandled rejections if downloadModel (which returns Promise<boolean>) rejects; update downloadAllModels to handle per-iteration errors by either awaiting each downloadModel(model, missingModelStore.folderPaths) inside a try/catch or attaching .catch(err => { /* log or surface error for model */ }) to the returned promise so a failing startDownload does not produce an unhandled rejection and you can log which model failed.src/stores/electronDownloadStore.ts (1)
53-79: Seeding a pending entry is the right fix; one subtle consideration.Pushing a
PENDINGentry synchronously after a successfulstartDownloadresolves is what unblocks the UI before the firstonDownloadProgressevent — good fix.One note: if
start()is invoked in a non-desktop context,DownloadManager!will throw at runtime due to the non-null assertion. Today the only caller (missingModelDownload.ts) guards withisDesktop, but since this is an exported store action, consider an early return or guard to keep the API robust:🛡️ Defensive guard
const start = async ({ url, savePath, filename }: { url: string savePath: string filename: string }) => { + if (!DownloadManager) return false - const started = await DownloadManager!.startDownload( + const started = await DownloadManager.startDownload( url, savePath, filename )🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/stores/electronDownloadStore.ts` around lines 53 - 79, The start function uses a non-null asserted DownloadManager (DownloadManager!.startDownload) which will throw if run outside desktop; add a defensive guard at the top of start to return early (e.g., return false) when DownloadManager is undefined or when not running in desktop mode, so callers can safely call this exported action; keep the existing logic that seeds a PENDING entry (downloads.value.push...) only after a successful startDownload and when findByUrl(url) is false.src/platform/missingModel/composables/useMissingModelInteractions.test.ts (1)
570-617: Good new coverage; consider one more edge case.The new
getDownloadStatussuite covers the key desktop normalization (pending→created) and asset-import-task precedence. Consider adding one more test: a desktopfailedstate (error + progress) normalizes into{ status: 'failed', error }so the status card's error-message branch is exercised. This would lock in the failure UX the PR is trying to unblock.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/platform/missingModel/composables/useMissingModelInteractions.test.ts` around lines 570 - 617, Add a test case to the getDownloadStatus suite that verifies desktop download failures are normalized to include the error: in the new case have mockFindElectronDownloadByUrl return { status: 'failed', progress: 0.4, error: 'some error' } (and no import task or a non-matching task), call getDownloadStatus from useMissingModelInteractions with the same URL/key, and assert the result equals { status: 'failed', progress: 0.4, error: 'some error' } so the failure branch is exercised.src/platform/missingModel/missingModelDownload.ts (1)
58-82: Return-shape change is sensible; minor suggestion on the browser branch semantics.The new
Promise<boolean>return type cleanly distinguishes "initiation successful" from "couldn't start" for the desktop path. Two small notes:
Browser branch always returns
trueregardless of whether the anchor click actually triggered a download — this is fine in practice (there's no way to detect browser download confirmation), but callers likeMissingModelRow.handleDownloadwill now always transition UI to the "selected/importing" state in browser mode even if the user cancels the browser's save dialog. That's likely the intended UX but worth confirming.The empty
modelPathsfallthrough on Line 81 silently returnsfalsewith no logging.MissingModelRowdoes log a warning before calling, butTabErrors.downloadAllModelsdoes not — a user triggering "Download All" on desktop with an unresolved directory will get silent no-ops. Consider aconsole.warnhere so the bulk path surfaces the issue too.🛡️ Suggested addition
const modelPaths = paths[model.directory] if (modelPaths?.[0]) { return useElectronDownloadStore().start({ url: model.url, savePath: modelPaths[0], filename: model.name }) } + console.warn( + `[missingModelDownload] No save path resolved for directory "${model.directory}"; skipping ${model.name}` + ) return Promise.resolve(false) }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/platform/missingModel/missingModelDownload.ts` around lines 58 - 82, The browser branch of downloadModel currently always resolves true (which is acceptable but should be explicit) and the desktop branch silently returns false when modelPaths are missing; update downloadModel so the browser path keeps returning Promise.resolve(true) but add a short inline comment documenting that callers may transition UI even if the user cancels the browser save, and in the desktop fallthrough where modelPaths is missing log a warning (e.g., console.warn) referencing the model.directory/model.name so callers like MissingModelRow.handleDownload and TabErrors.downloadAllModels surface why the download didn't start. Ensure you modify the downloadModel function and add the logging at the final return false branch.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/platform/missingModel/composables/useMissingModelInteractions.ts`:
- Around line 132-138: The current isSelectionConfirmable function (and similar
code in the 280-327 region) uses getDownloadStatus/findByUrl which is URL-scoped
and can return a stale Electron download entry; update the fallback logic to
ensure the Electron download entry’s filename (or another unique identifier)
matches the current selection before using its status—i.e., when
getDownloadStatus returns an electron entry from findByUrl(downloadUrl), compare
electronEntry.filename (or electronEntry.name) to
store.selectedLibraryModel[key].filename (or name) and only accept that status
if they match; otherwise ignore the electron entry and treat the status as
missing so the selection can be confirmed correctly.
---
Outside diff comments:
In `@src/platform/missingModel/components/MissingModelRow.vue`:
- Around line 291-305: handleDownload can be double-invoked while awaiting
downloadModel; to fix, set a short-lived “starting” flag before awaiting and
clear it after to prevent re-entry (e.g. use a local ref like isStartingDownload
or seed selectedLibraryModel[modelKey] early), then make the download button
respect that flag (same v-if/v-bind used for selectedLibraryModel or an
isDownloadActive guard) so DownloadManager.startDownload cannot be triggered
twice; update handleDownload, the download button binding, and/or seed
electronDownloadStore.start (findByUrl) before awaiting to ensure only one
kickoff occurs.
---
Nitpick comments:
In `@src/components/rightSidePanel/errors/TabErrors.vue`:
- Around line 348-352: The loop in downloadAllModels calls downloadModel(...)
with a void discard causing unhandled rejections if downloadModel (which returns
Promise<boolean>) rejects; update downloadAllModels to handle per-iteration
errors by either awaiting each downloadModel(model,
missingModelStore.folderPaths) inside a try/catch or attaching .catch(err => {
/* log or surface error for model */ }) to the returned promise so a failing
startDownload does not produce an unhandled rejection and you can log which
model failed.
In `@src/platform/missingModel/composables/useMissingModelInteractions.test.ts`:
- Around line 570-617: Add a test case to the getDownloadStatus suite that
verifies desktop download failures are normalized to include the error: in the
new case have mockFindElectronDownloadByUrl return { status: 'failed', progress:
0.4, error: 'some error' } (and no import task or a non-matching task), call
getDownloadStatus from useMissingModelInteractions with the same URL/key, and
assert the result equals { status: 'failed', progress: 0.4, error: 'some error'
} so the failure branch is exercised.
In `@src/platform/missingModel/missingModelDownload.test.ts`:
- Around line 38-64: The browser-path test for downloadModel should also assert
the desktop download path isn't used: add an assertion like
expect(mockStartDownload).not.toHaveBeenCalled() after the await/expect resolves
to ensure mockStartDownload (the desktop helper) is not invoked when
downloadModel runs in the browser branch; this locks the isDesktop === false
behavior for the downloadModel function and prevents regressions that call both
paths.
- Around line 3-16: Replace the module-level mutable flag pattern by hoisting a
mutable mock value with vi.hoisted and using it inside the mocked module
factory: create a hoisted container (e.g., const hoisted = vi.hoisted(() => ({
isDesktop: false })) ), update the vi.mock for '@/platform/distribution/types'
to return a getter that reads hoisted().isDesktop, and in tests mutate
hoisted().isDesktop instead of the top-level mockIsDesktop variable; adjust
references where mockIsDesktop is read or set and keep the existing
useElectronDownloadStore/mockStartDownload mocks unchanged.
In `@src/platform/missingModel/missingModelDownload.ts`:
- Around line 58-82: The browser branch of downloadModel currently always
resolves true (which is acceptable but should be explicit) and the desktop
branch silently returns false when modelPaths are missing; update downloadModel
so the browser path keeps returning Promise.resolve(true) but add a short inline
comment documenting that callers may transition UI even if the user cancels the
browser save, and in the desktop fallthrough where modelPaths is missing log a
warning (e.g., console.warn) referencing the model.directory/model.name so
callers like MissingModelRow.handleDownload and TabErrors.downloadAllModels
surface why the download didn't start. Ensure you modify the downloadModel
function and add the logging at the final return false branch.
In `@src/stores/electronDownloadStore.ts`:
- Around line 53-79: The start function uses a non-null asserted DownloadManager
(DownloadManager!.startDownload) which will throw if run outside desktop; add a
defensive guard at the top of start to return early (e.g., return false) when
DownloadManager is undefined or when not running in desktop mode, so callers can
safely call this exported action; keep the existing logic that seeds a PENDING
entry (downloads.value.push...) only after a successful startDownload and when
findByUrl(url) is false.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ccf46058-4aaa-4f71-940e-4446bd2f885e
📒 Files selected for processing (9)
src/components/rightSidePanel/errors/TabErrors.vuesrc/platform/missingModel/components/MissingModelRow.vuesrc/platform/missingModel/components/MissingModelStatusCard.vuesrc/platform/missingModel/composables/useMissingModelInteractions.test.tssrc/platform/missingModel/composables/useMissingModelInteractions.tssrc/platform/missingModel/missingModelDownload.test.tssrc/platform/missingModel/missingModelDownload.tssrc/platform/missingModel/types.tssrc/stores/electronDownloadStore.ts
| function isSelectionConfirmable(key: string, downloadUrl?: string): boolean { | ||
| if (!store.selectedLibraryModel[key]) return false | ||
| if (store.importCategoryMismatch[key]) return false | ||
|
|
||
| const status = getDownloadStatus(key) | ||
| if ( | ||
| status && | ||
| (status.status === 'running' || status.status === 'created') | ||
| ) { | ||
| return false | ||
| } | ||
| return true | ||
| const status = getDownloadStatus(key, downloadUrl) | ||
| return !status || status.status === 'completed' | ||
| } |
There was a problem hiding this comment.
Scope Electron status to the current selection.
findByUrl(downloadUrl) is URL-scoped, but this row’s selection is key-scoped. A stale Electron entry for the same URL can keep a later manual library selection in failed/imported state and block confirmation via Line 137. Consider matching the Electron download filename to the current selectedLibraryModel[key] before returning the fallback status.
Suggested scoping fix
function normalizeElectronDownloadStatus(
- downloadUrl?: string
+ downloadUrl?: string,
+ selectedFilename?: string
): MissingModelDownloadStatus | null {
if (!downloadUrl) return null
const download = electronDownloadStore.findByUrl(downloadUrl)
if (!download?.status) return null
+ if (selectedFilename && download.filename !== selectedFilename) return null
const progress =
download.status === 'completed' ? 1 : (download.progress ?? 0)
@@
- return normalizeElectronDownloadStatus(downloadUrl)
+ return normalizeElectronDownloadStatus(
+ downloadUrl,
+ store.selectedLibraryModel[key]
+ )
}Also applies to: 280-327
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/platform/missingModel/composables/useMissingModelInteractions.ts` around
lines 132 - 138, The current isSelectionConfirmable function (and similar code
in the 280-327 region) uses getDownloadStatus/findByUrl which is URL-scoped and
can return a stale Electron download entry; update the fallback logic to ensure
the Electron download entry’s filename (or another unique identifier) matches
the current selection before using its status—i.e., when getDownloadStatus
returns an electron entry from findByUrl(downloadUrl), compare
electronEntry.filename (or electronEntry.name) to
store.selectedLibraryModel[key].filename (or name) and only accept that status
if they match; otherwise ignore the electron entry and treat the status as
missing so the selection can be confirmed correctly.
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #11350 +/- ##
==========================================
+ Coverage 44.53% 44.55% +0.02%
==========================================
Files 1350 1350
Lines 69314 69341 +27
Branches 18357 19238 +881
==========================================
+ Hits 30871 30897 +26
- Misses 37843 37844 +1
Partials 600 600
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
The surrounding code is so poorly written that I think the cost of pushing this hotfix through outweighs the benefit of having model downloading fixed. I'm rewriting this to fix it the right way. |
|
Superseded by #11353, which carries the long-term contract-based fix instead of the direct UI fallback patch. |
Summary
Root Cause
The desktop download itself was starting correctly, but the Missing Models UI only knew how to read status through asset import task ids. Direct Electron downloads do not create that task mapping, so the row stayed on the default
Downloadbutton even while the file was downloading.What Changed
This patch adds a fallback from the missing-model UI to
electronDownloadStore.findByUrl(downloadUrl)and normalizes Electron download states into the shared UI status model. It also inserts a pending entry in the Electron download store as soon asstart()succeeds so the row can flip into an active state immediately.Impact
Desktop users now see the missing-model row move through active/imported states for direct downloads instead of appearing stuck on
Download.A longer-term contract cleanup is still needed so the desktop download hydration path and the missing-model UI use one aligned status model without the current fallback. That follow-up is tracked separately in
DESK2-48.Validation
pnpm exec vitest run src/platform/missingModel/missingModelDownload.test.ts src/platform/missingModel/composables/useMissingModelInteractions.test.tspnpm typecheckpnpm lintpnpm format:checkpnpm build┆Issue is synchronized with this Notion page by Unito