Skip to content

Conversation

@christian-byrne
Copy link
Contributor

@christian-byrne christian-byrne commented Nov 26, 2025

Summary

Adds mode as a valid url query param when opening template from URL.

2025-11-25.17-05-30_processed_20251125_170610.mp4

┆Issue is synchronized with this Notion page by Unito

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Nov 26, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 26, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Adds support for a URL mode query parameter: validated and removed from the URL, preserved by the router for the TEMPLATE namespace, and applied to the canvas store (enables linear mode when mode=linear) after a successful template load.

Changes

Cohort / File(s) Summary
Template URL loader
src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
Import and use useCanvasStore; accept a mode query param; validate mode against ^[a-zA-Z0-9_-]+$; warn on invalid or unsupported values; strip mode during URL cleanup; when a template loads successfully and mode=linear, set canvasStore.linearMode = true.
Router query preservation
src/router.ts
Add mode to preserved query keys for the TEMPLATE namespace (keys now: template, source, mode).
Tests
tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
Add tests and mocks for mode: ensure linearMode becomes true on successful load with mode=linear; remains false on failure or non-linear modes; reject invalid or array-form mode values; warn on unsupported modes; verify mode is removed during query cleanup.

Sequence Diagram(s)

sequenceDiagram
    participant U as URL
    participant R as Router
    participant L as TemplateLoader
    participant C as CanvasStore

    U->>R: Request with query (`template`, `source`, `mode`)
    R->>R: Preserve keys (`template`,`source`,`mode`)
    R->>L: Invoke loader with query
    L->>L: Parse `template` / `source` and `mode`
    alt mode present
        L->>L: Validate `mode` (^[a-zA-Z0-9_-]+$)
        alt valid
            L->>L: Load template
            alt load success
                opt mode == "linear"
                    L->>C: set linearMode = true
                end
            else load failure
                L-->>C: do not change linearMode
            end
        else invalid
            L-->>L: console.warn and ignore `mode`
        end
    else no mode
        L->>L: Load template normally
    end
    L->>L: Remove `template`, `source`, `mode` from URL
    L-->>R: Complete
Loading
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch linear-mode-url

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Nov 26, 2025

🎨 Storybook Build Status

Build completed successfully!

⏰ Completed at: 11/26/2025, 11:32:56 PM UTC

🔗 Links


🎉 Your Storybook is ready for review!

@github-actions
Copy link

github-actions bot commented Nov 26, 2025

🎭 Playwright Test Results

⚠️ Tests passed with flaky tests

⏰ Completed at: 11/26/2025, 11:41:33 PM UTC

📈 Summary

  • Total Tests: 492
  • Passed: 477 ✅
  • Failed: 0
  • Flaky: 6 ⚠️
  • Skipped: 9 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 468 / ❌ 0 / ⚠️ 6 / ⏭️ 9
  • chromium-2x: View Report • ✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • chromium-0.5x: View Report • ✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • mobile-chrome: View Report • ✅ 6 / ❌ 0 / ⚠️ 0 / ⏭️ 0

🎉 Click on the links above to view detailed test results for each browser configuration.

@github-actions
Copy link

github-actions bot commented Nov 26, 2025

Bundle Size Report

Summary

  • Raw size: 17 MB baseline 17 MB — 🔴 +786 B
  • Gzip: 3.37 MB baseline 3.37 MB — 🔴 +160 B
  • Brotli: 2.58 MB baseline 2.58 MB — 🔴 +68 B
  • Bundles: 93 current • 93 baseline • 36 added / 36 removed

Category Glance
Graph Workspace 🔴 +778 B (945 kB) · App Entry Points 🔴 +8 B (3.18 MB) · Vendor & Third-Party ⚪ 0 B (8.56 MB) · Other ⚪ 0 B (3.84 MB) · Panels & Settings ⚪ 0 B (298 kB) · UI Components ⚪ 0 B (138 kB) · + 3 more

Per-category breakdown
App Entry Points — 3.18 MB (baseline 3.18 MB) • 🔴 +8 B

Main entry bundles and manifests

File Before After Δ Raw Δ Gzip Δ Brotli
assets/index-CMDth0Yu.js (new) 2.95 MB 🔴 +2.95 MB 🔴 +615 kB 🔴 +467 kB
assets/index-CM3wRx8R.js (removed) 2.95 MB 🟢 -2.95 MB 🟢 -615 kB 🟢 -467 kB
assets/index-Bi0CumcP.js (new) 227 kB 🔴 +227 kB 🔴 +48.6 kB 🔴 +40 kB
assets/index-J6vsBKQ5.js (removed) 227 kB 🟢 -227 kB 🟢 -48.6 kB 🟢 -40 kB
assets/index-C8J6YZao.js (new) 345 B 🔴 +345 B 🔴 +244 B 🔴 +207 B
assets/index-CrnSgeIi.js (removed) 345 B 🟢 -345 B 🟢 -243 B 🟢 -221 B

Status: 3 added / 3 removed

Graph Workspace — 945 kB (baseline 944 kB) • 🔴 +778 B

Graph editor runtime, canvas, workflow orchestration

File Before After Δ Raw Δ Gzip Δ Brotli
assets/GraphView-BCFthkP4.js (new) 945 kB 🔴 +945 kB 🔴 +183 kB 🔴 +140 kB
assets/GraphView-DkL6ca5A.js (removed) 944 kB 🟢 -944 kB 🟢 -183 kB 🟢 -140 kB

Status: 1 added / 1 removed

Views & Navigation — 6.54 kB (baseline 6.54 kB) • ⚪ 0 B

Top-level views, pages, and routed surfaces

File Before After Δ Raw Δ Gzip Δ Brotli
assets/UserSelectView-AdhRTGf6.js (new) 6.54 kB 🔴 +6.54 kB 🔴 +2.14 kB 🔴 +1.91 kB
assets/UserSelectView-U64ogSAu.js (removed) 6.54 kB 🟢 -6.54 kB 🟢 -2.14 kB 🟢 -1.9 kB

Status: 1 added / 1 removed

Panels & Settings — 298 kB (baseline 298 kB) • ⚪ 0 B

Configuration panels, inspectors, and settings screens

File Before After Δ Raw Δ Gzip Δ Brotli
assets/CreditsPanel-BGjmaYft.js (removed) 21.4 kB 🟢 -21.4 kB 🟢 -5.15 kB 🟢 -4.5 kB
assets/CreditsPanel-CgXNmUmS.js (new) 21.4 kB 🔴 +21.4 kB 🔴 +5.15 kB 🔴 +4.5 kB
assets/KeybindingPanel-C5z17hHr.js (removed) 13.6 kB 🟢 -13.6 kB 🟢 -3.42 kB 🟢 -3.01 kB
assets/KeybindingPanel-Crm4spH3.js (new) 13.6 kB 🔴 +13.6 kB 🔴 +3.42 kB 🔴 +3.02 kB
assets/ExtensionPanel-BPvAHgKE.js (new) 10.4 kB 🔴 +10.4 kB 🔴 +2.48 kB 🔴 +2.16 kB
assets/ExtensionPanel-CG67aVES.js (removed) 10.4 kB 🟢 -10.4 kB 🟢 -2.48 kB 🟢 -2.16 kB
assets/AboutPanel-BitHWgN7.js (removed) 9.16 kB 🟢 -9.16 kB 🟢 -2.46 kB 🟢 -2.21 kB
assets/AboutPanel-Cobwgv3Q.js (new) 9.16 kB 🔴 +9.16 kB 🔴 +2.46 kB 🔴 +2.21 kB
assets/ServerConfigPanel-BduZR2tH.js (new) 6.56 kB 🔴 +6.56 kB 🔴 +1.83 kB 🔴 +1.62 kB
assets/ServerConfigPanel-BGnjagu2.js (removed) 6.56 kB 🟢 -6.56 kB 🟢 -1.83 kB 🟢 -1.62 kB
assets/UserPanel-By4ZMv5F.js (new) 6.23 kB 🔴 +6.23 kB 🔴 +1.72 kB 🔴 +1.5 kB
assets/UserPanel-fVMFMLKQ.js (removed) 6.23 kB 🟢 -6.23 kB 🟢 -1.72 kB 🟢 -1.5 kB
assets/settings-BXTtSH4O.js 33.3 kB 33.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-C9Pzn-NG.js 25.2 kB 25.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-CCy2fA_h.js 27.3 kB 27.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-CQpqEFfl.js 26.6 kB 26.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DHcnxypw.js 21.7 kB 21.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DhFTK9fY.js 25.1 kB 25.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DlT4t_ui.js 25.9 kB 25.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DRgSrIdD.js 24.2 kB 24.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-tjkeqiZq.js 21.1 kB 21.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 6 added / 6 removed

UI Components — 138 kB (baseline 138 kB) • ⚪ 0 B

Reusable component library chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/Load3D.vue_vue_type_script_setup_true_lang-C-dTRbf1.js (new) 53.9 kB 🔴 +53.9 kB 🔴 +8.52 kB 🔴 +7.31 kB
assets/Load3D.vue_vue_type_script_setup_true_lang-CLCSZwHY.js (removed) 53.9 kB 🟢 -53.9 kB 🟢 -8.52 kB 🟢 -7.32 kB
assets/WidgetSelect.vue_vue_type_script_setup_true_lang-_TotIMTM.js (removed) 46.9 kB 🟢 -46.9 kB 🟢 -10.1 kB 🟢 -8.76 kB
assets/WidgetSelect.vue_vue_type_script_setup_true_lang-DrE2Rbjd.js (new) 46.9 kB 🔴 +46.9 kB 🔴 +10.1 kB 🔴 +8.79 kB
assets/WidgetInputNumber.vue_vue_type_script_setup_true_lang-C2iS5a8x.js (removed) 12.8 kB 🟢 -12.8 kB 🟢 -3.35 kB 🟢 -2.96 kB
assets/WidgetInputNumber.vue_vue_type_script_setup_true_lang-ozPtMr2X.js (new) 12.8 kB 🔴 +12.8 kB 🔴 +3.36 kB 🔴 +2.96 kB
assets/ComfyQueueButton-CBUn8J3D.js (new) 7.73 kB 🔴 +7.73 kB 🔴 +2.2 kB 🔴 +1.95 kB
assets/ComfyQueueButton-CUDA53S9.js (removed) 7.73 kB 🟢 -7.73 kB 🟢 -2.2 kB 🟢 -1.95 kB
assets/MediaTitle.vue_vue_type_script_setup_true_lang-B-lx0WxG.js (new) 897 B 🔴 +897 B 🔴 +503 B 🔴 +430 B
assets/MediaTitle.vue_vue_type_script_setup_true_lang-D2bKwiYb.js (removed) 897 B 🟢 -897 B 🟢 -505 B 🟢 -435 B
assets/LazyImage.vue_vue_type_script_setup_true_lang-DfYZUWfZ.js 10.8 kB 10.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/UserAvatar.vue_vue_type_script_setup_true_lang-lBvEY_Sb.js 1.34 kB 1.34 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetButton-D0RxLHdl.js 2.04 kB 2.04 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetLayoutField.vue_vue_type_script_setup_true_lang-BdcB0N2p.js 2 kB 2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 5 added / 5 removed

Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 B

Stores, services, APIs, and repositories

File Before After Δ Raw Δ Gzip Δ Brotli
assets/keybindingService-Bk5bIc1-.js (new) 7.51 kB 🔴 +7.51 kB 🔴 +1.83 kB 🔴 +1.58 kB
assets/keybindingService-iviyKE5-.js (removed) 7.51 kB 🟢 -7.51 kB 🟢 -1.84 kB 🟢 -1.58 kB
assets/audioService-B-200UHc.js (removed) 2.2 kB 🟢 -2.2 kB 🟢 -962 B 🟢 -823 B
assets/audioService-BGGTS30z.js (new) 2.2 kB 🔴 +2.2 kB 🔴 +961 B 🔴 +825 B
assets/serverConfigStore-BHFq9bew.js 2.83 kB 2.83 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 2 added / 2 removed

Utilities & Hooks — 2.94 kB (baseline 2.94 kB) • ⚪ 0 B

Helpers, composables, and utility bundles

File Before After Δ Raw Δ Gzip Δ Brotli
assets/audioUtils-Bbf43QTR.js (new) 1.41 kB 🔴 +1.41 kB 🔴 +651 B 🔴 +546 B
assets/audioUtils-BYLEjmY_.js (removed) 1.41 kB 🟢 -1.41 kB 🟢 -652 B 🟢 -543 B
assets/mathUtil-CTARWQ-l.js 1.07 kB 1.07 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeFilterUtil-CXKCRJ-m.js 460 B 460 B ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 1 added / 1 removed

Vendor & Third-Party — 8.56 MB (baseline 8.56 MB) • ⚪ 0 B

External libraries and shared vendor chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/vendor-chart--ViqMbDH.js 452 kB 452 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-other-D3dKDPA9.js 3.98 MB 3.98 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-primevue-oJ2MsX9s.js 1.96 MB 1.96 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-three-aR6ntw5X.js 1.37 MB 1.37 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-tiptap-DkSGWC41.js 232 kB 232 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-vue-Dcaw_-2x.js 160 kB 160 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-xterm-BZLod3g9.js 407 kB 407 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
Other — 3.84 MB (baseline 3.84 MB) • ⚪ 0 B

Bundles that do not match a named category

File Before After Δ Raw Δ Gzip Δ Brotli
assets/WidgetRecordAudio-CHnrLOvr.js (removed) 20.4 kB 🟢 -20.4 kB 🟢 -5.24 kB 🟢 -4.63 kB
assets/WidgetRecordAudio-dzkHwQ7p.js (new) 20.4 kB 🔴 +20.4 kB 🔴 +5.24 kB 🔴 +4.62 kB
assets/AudioPreviewPlayer-BZiDN_fj.js (new) 13.5 kB 🔴 +13.5 kB 🔴 +3.4 kB 🔴 +3.04 kB
assets/AudioPreviewPlayer-CrJbSc-N.js (removed) 13.5 kB 🟢 -13.5 kB 🟢 -3.4 kB 🟢 -3.04 kB
assets/WidgetGalleria-ErYLdBSQ.js (new) 4.1 kB 🔴 +4.1 kB 🔴 +1.45 kB 🔴 +1.3 kB
assets/WidgetGalleria-oHFNenAj.js (removed) 4.1 kB 🟢 -4.1 kB 🟢 -1.45 kB 🟢 -1.31 kB
assets/WidgetColorPicker-dkCk-Oul.js (new) 3.41 kB 🔴 +3.41 kB 🔴 +1.38 kB 🔴 +1.22 kB
assets/WidgetColorPicker-DuqwU0eC.js (removed) 3.41 kB 🟢 -3.41 kB 🟢 -1.38 kB 🟢 -1.22 kB
assets/WidgetMarkdown-B_fW7Ecx.js (new) 3.1 kB 🔴 +3.1 kB 🔴 +1.29 kB 🔴 +1.12 kB
assets/WidgetMarkdown-C5H0bcpb.js (removed) 3.1 kB 🟢 -3.1 kB 🟢 -1.29 kB 🟢 -1.13 kB
assets/WidgetAudioUI-BrLBw4wa.js (new) 2.82 kB 🔴 +2.82 kB 🔴 +1.12 kB 🔴 +1.02 kB
assets/WidgetAudioUI-k78Iqydc.js (removed) 2.82 kB 🟢 -2.82 kB 🟢 -1.12 kB 🟢 -1.01 kB
assets/WidgetTextarea-B6Lp_mZj.js (removed) 2.48 kB 🟢 -2.48 kB 🟢 -1.01 kB 🟢 -888 B
assets/WidgetTextarea-pqLhsOQo.js (new) 2.48 kB 🔴 +2.48 kB 🔴 +1.01 kB 🔴 +895 B
assets/WidgetInputText-BWSmCpjc.js (removed) 1.99 kB 🟢 -1.99 kB 🟢 -916 B 🟢 -851 B
assets/WidgetInputText-DPSQAhOy.js (new) 1.99 kB 🔴 +1.99 kB 🔴 +918 B 🔴 +851 B
assets/MediaImageBottom--f740vVl.js (removed) 1.57 kB 🟢 -1.57 kB 🟢 -737 B 🟢 -649 B
assets/MediaImageBottom-BRVwaYom.js (new) 1.57 kB 🔴 +1.57 kB 🔴 +735 B 🔴 +648 B
assets/MediaAudioBottom-CF_z_baP.js (new) 1.52 kB 🔴 +1.52 kB 🔴 +742 B 🔴 +654 B
assets/MediaAudioBottom-DfzEzZ81.js (removed) 1.52 kB 🟢 -1.52 kB 🟢 -740 B 🟢 -656 B
assets/MediaVideoBottom-B0L_gsnF.js (removed) 1.52 kB 🟢 -1.52 kB 🟢 -739 B 🟢 -653 B
assets/MediaVideoBottom-CdW3Q_-J.js (new) 1.52 kB 🔴 +1.52 kB 🔴 +741 B 🔴 +653 B
assets/Media3DBottom-B1nNud0M.js (removed) 1.5 kB 🟢 -1.5 kB 🟢 -731 B 🟢 -652 B
assets/Media3DBottom-BfnIMakX.js (new) 1.5 kB 🔴 +1.5 kB 🔴 +726 B 🔴 +646 B
assets/Media3DTop-4zaR4Eqv.js (new) 1.49 kB 🔴 +1.49 kB 🔴 +764 B 🔴 +652 B
assets/Media3DTop-BYdNL2Ip.js (removed) 1.49 kB 🟢 -1.49 kB 🟢 -765 B 🟢 -653 B
assets/WidgetSelect-BiwauhYr.js (new) 655 B 🔴 +655 B 🔴 +341 B 🔴 +287 B
assets/WidgetSelect-CADI8HK5.js (removed) 655 B 🟢 -655 B 🟢 -342 B 🟢 -289 B
assets/WidgetInputNumber-BzbrI4E8.js (new) 595 B 🔴 +595 B 🔴 +330 B 🔴 +277 B
assets/WidgetInputNumber-CNM7KUHA.js (removed) 595 B 🟢 -595 B 🟢 -331 B 🟢 -278 B
assets/Load3D-BkzeEXGl.js (removed) 424 B 🟢 -424 B 🟢 -267 B 🟢 -223 B
assets/Load3D-jhAxkBJM.js (new) 424 B 🔴 +424 B 🔴 +267 B 🔴 +224 B
assets/WidgetLegacy-BDyOnc3A.js (new) 364 B 🔴 +364 B 🔴 +237 B 🔴 +193 B
assets/WidgetLegacy-DsepKb5m.js (removed) 364 B 🟢 -364 B 🟢 -236 B 🟢 -192 B
assets/commands-_s-RvhJR.js 13.6 kB 13.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-BuUILW6P.js 13 kB 13 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-BV4R6fLx.js 14.9 kB 14.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CLwPdnT6.js 14.2 kB 14.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CWMchBmd.js 15.9 kB 15.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DazTQhtc.js 12.9 kB 12.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DmWrOe93.js 13.7 kB 13.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DwiH7Kr6.js 13.8 kB 13.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-mS3LCNPn.js 14.5 kB 14.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-5lOBdqcC.js 84.5 kB 84.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-BOCuaVpE.js 73.4 kB 73.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-ClrEFGUz.js 72.4 kB 72.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-CyNU0iQX.js 99.3 kB 99.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-D7gwLxft.js 114 kB 114 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-DC8o4BCt.js 86.8 kB 86.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-DKiesCV4.js 94.3 kB 94.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Hq2q-OtB.js 83.6 kB 83.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-USAlAlnj.js 82 kB 82 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaAudioTop-DqRKCSyG.js 1.46 kB 1.46 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaImageTop-B_ZBEjC1.js 1.75 kB 1.75 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaVideoTop-BFDrQq-5.js 2.76 kB 2.76 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-_Px5dSNW.js 306 kB 306 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-7z21KPoS.js 285 kB 285 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-BWKZzBPK.js 346 kB 346 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CGbgH4Yl.js 320 kB 320 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CjjjdWkV.js 313 kB 313 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CVrNtxvj.js 288 kB 288 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-DLRSA0IK.js 309 kB 309 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-DQV2gnwA.js 372 kB 372 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-ofqLG5vz.js 310 kB 310 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetChart-B2-gppzM.js 2.48 kB 2.48 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetImageCompare-BOXn8KLW.js 2.21 kB 2.21 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/widgetPropFilter-BIbGSUAt.js 1.28 kB 1.28 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetToggleSwitch-C_oC_TUM.js 1.58 kB 1.58 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 17 added / 17 removed

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/platform/workflow/templates/composables/useTemplateUrlLoader.ts (1)

77-84: Consider validating recognized mode values.

The format validation is correct, but currently any alphanumeric value passes validation even though only mode=linear is supported (line 103). Other values are silently ignored.

Consider adding a check for recognized mode values to provide better user feedback:

 if (modeParam && !isValidParameter(modeParam)) {
   console.warn(
     `[useTemplateUrlLoader] Invalid mode parameter format: ${modeParam}`
   )
   return
 }
+
+const SUPPORTED_MODES = ['linear'] as const
+if (modeParam && !SUPPORTED_MODES.includes(modeParam)) {
+  console.warn(
+    `[useTemplateUrlLoader] Unsupported mode parameter: ${modeParam}. Supported modes: ${SUPPORTED_MODES.join(', ')}`
+  )
+}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ff3a0e and 07fd472.

📒 Files selected for processing (2)
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts (6 hunks)
  • src/router.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (15)
**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{vue,ts,tsx}: Leverage VueUse functions for performance-enhancing utilities
Use vue-i18n in Composition API for any string literals and place new translation entries in src/locales/en/main.json

Files:

  • src/router.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursorrules)

Use es-toolkit for utility functions

Files:

  • src/router.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

Use TypeScript for type safety

**/*.{ts,tsx}: Never use any type - use proper TypeScript types
Never use as any type assertions - fix the underlying type issue

Files:

  • src/router.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx,js,vue}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper error handling in components and services

**/*.{ts,tsx,js,vue}: Use 2-space indentation, single quotes, no semicolons, and maintain 80-character line width as configured in .prettierrc
Organize imports by sorting and grouping by plugin, and run pnpm format before committing

Files:

  • src/router.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/*.{vue,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json

Files:

  • src/router.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/*.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.ts: Use es-toolkit for utility functions
Use TypeScript for type safety

Files:

  • src/router.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx,js,jsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Use camelCase for variable and setting names in TypeScript/Vue files

Files:

  • src/router.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx,vue}: Use const settingStore = useSettingStore() and settingStore.get('Comfy.SomeSetting') to retrieve settings in TypeScript/Vue files
Use await settingStore.set('Comfy.SomeSetting', newValue) to update settings in TypeScript/Vue files
Check server capabilities using api.serverSupportsFeature('feature_name') before using enhanced features
Use api.getServerFeature('config_name', defaultValue) to retrieve server feature configuration

Enforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates

Files:

  • src/router.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Define dynamic setting defaults using runtime context with functions in settings configuration
Use defaultsByInstallVersion property for gradual feature rollout based on version in settings configuration

Files:

  • src/router.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/*.{ts,tsx,vue}: Sanitize HTML with DOMPurify to prevent XSS attacks
Avoid using @ts-expect-error; use proper TypeScript types instead
Use es-toolkit for utility functions instead of other utility libraries
Implement proper TypeScript types throughout the codebase

Files:

  • src/router.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/router.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/{services,composables}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/{services,composables}/**/*.{ts,tsx}: Use api.apiURL() for backend endpoints instead of constructing URLs directly
Use api.fileURL() for static file access instead of constructing URLs directly

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/{composables,components}/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Clean up subscriptions in state management to prevent memory leaks

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/{components,composables}/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Use vue-i18n for ALL user-facing strings by adding them to src/locales/en/main.json

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/composables/use*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Name composables in the format useXyz.ts

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
🧠 Learnings (2)
📚 Learning: 2025-11-24T19:47:34.324Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/{services,composables}/**/*.{ts,tsx} : Use `api.fileURL()` for static file access instead of constructing URLs directly

Applied to files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
📚 Learning: 2025-11-24T19:47:14.779Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:14.779Z
Learning: Applies to **/*.{ts,tsx,vue} : Use `const settingStore = useSettingStore()` and `settingStore.get('Comfy.SomeSetting')` to retrieve settings in TypeScript/Vue files

Applied to files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
🧬 Code graph analysis (1)
src/platform/workflow/templates/composables/useTemplateUrlLoader.ts (1)
src/renderer/core/canvas/canvasStore.ts (1)
  • useCanvasStore (24-152)
🪛 ESLint
src/platform/workflow/templates/composables/useTemplateUrlLoader.ts

[error] 7-7: Unable to resolve path to module '@/renderer/core/canvas/canvasStore'.

(import-x/no-unresolved)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: deploy-and-comment
  • GitHub Check: collect
  • GitHub Check: setup
  • GitHub Check: lint-and-format
  • GitHub Check: test
🔇 Additional comments (5)
src/platform/workflow/templates/composables/useTemplateUrlLoader.ts (4)

17-20: Documentation clearly describes the new mode parameter.

The updated comments appropriately document the new URL parameter format and validation requirements.


29-29: LGTM: Canvas store correctly initialized.

The store initialization follows Vue composition API best practices and is necessary for toggling linear mode.


42-48: LGTM: URL cleanup correctly includes mode parameter.

The cleanup function appropriately removes the mode parameter along with template and source, ensuring the URL is clean after template loading completes.


103-106: Based on my analysis of the codebase, I can now provide the rewritten review comment.

No initialization guards needed—linearMode is a Vue ref that can be assigned directly.

The pattern at lines 103–106 is correct and idiomatic. linearMode is defined as ref(false) in canvasStore and supports direct assignment. This same pattern is used elsewhere in the codebase (e.g., workflowStore.ts:333), and a comment in useVueNodeResizeTracking.ts:65 explicitly states "Canvas is ready when this code runs; no defensive guards needed." The timing is appropriate since linearMode is set only after successful template load.

src/router.ts (1)

80-85: LGTM: Mode parameter correctly added to preserved queries.

The addition of 'mode' to the preserved query keys ensures the parameter persists across navigation, which is essential for the template URL loading feature to work correctly. This change aligns perfectly with the implementation in useTemplateUrlLoader.ts.

@christian-byrne christian-byrne added needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch cloud/1.32 labels Nov 26, 2025
AustinMroz
AustinMroz previously approved these changes Nov 26, 2025
Copy link
Collaborator

@AustinMroz AustinMroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Nov 26, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/platform/workflow/templates/composables/useTemplateUrlLoader.ts (1)

77-85: Optional: make mode parameter type check explicit for symmetry

modeParam is validated with the same regex as other params, which is good. For consistency with templateParam, you might also explicitly guard on typeof modeParam === 'string' before validating, so non-string values (e.g. arrays) are clearly treated as unsupported rather than implicitly rejected via string coercion.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 07fd472 and 126140a.

📒 Files selected for processing (3)
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts (6 hunks)
  • src/router.ts (1 hunks)
  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/router.ts
🧰 Additional context used
📓 Path-based instructions (17)
**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{vue,ts,tsx}: Leverage VueUse functions for performance-enhancing utilities
Use vue-i18n in Composition API for any string literals and place new translation entries in src/locales/en/main.json

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursorrules)

Use es-toolkit for utility functions

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

Use TypeScript for type safety

**/*.{ts,tsx}: Never use any type - use proper TypeScript types
Never use as any type assertions - fix the underlying type issue

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx,js,vue}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper error handling in components and services

**/*.{ts,tsx,js,vue}: Use 2-space indentation, single quotes, no semicolons, and maintain 80-character line width as configured in .prettierrc
Organize imports by sorting and grouping by plugin, and run pnpm format before committing

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx,js,jsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Use camelCase for variable and setting names in TypeScript/Vue files

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx,vue}: Use const settingStore = useSettingStore() and settingStore.get('Comfy.SomeSetting') to retrieve settings in TypeScript/Vue files
Use await settingStore.set('Comfy.SomeSetting', newValue) to update settings in TypeScript/Vue files
Check server capabilities using api.serverSupportsFeature('feature_name') before using enhanced features
Use api.getServerFeature('config_name', defaultValue) to retrieve server feature configuration

Enforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Define dynamic setting defaults using runtime context with functions in settings configuration
Use defaultsByInstallVersion property for gradual feature rollout based on version in settings configuration

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
tests-ui/**/*.test.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (tests-ui/CLAUDE.md)

tests-ui/**/*.test.{js,ts,jsx,tsx}: Write tests for new features
Follow existing test patterns in the codebase
Use existing test utilities rather than writing custom utilities
Mock external dependencies in tests
Always prefer vitest mock functions over writing verbose manual mocks

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
**/*.{test,spec}.{ts,tsx,js}

📄 CodeRabbit inference engine (AGENTS.md)

Unit and component tests should be located in tests-ui/ or co-located with components as src/components/**/*.{test,spec}.ts; E2E tests should be in browser_tests/

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
**/composables/use*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Name composables in the format useXyz.ts

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/*.{vue,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/*.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.ts: Use es-toolkit for utility functions
Use TypeScript for type safety

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/{services,composables}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/{services,composables}/**/*.{ts,tsx}: Use api.apiURL() for backend endpoints instead of constructing URLs directly
Use api.fileURL() for static file access instead of constructing URLs directly

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/*.{ts,tsx,vue}: Sanitize HTML with DOMPurify to prevent XSS attacks
Avoid using @ts-expect-error; use proper TypeScript types instead
Use es-toolkit for utility functions instead of other utility libraries
Implement proper TypeScript types throughout the codebase

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/{composables,components}/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Clean up subscriptions in state management to prevent memory leaks

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/{components,composables}/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Use vue-i18n for ALL user-facing strings by adding them to src/locales/en/main.json

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
🧠 Learnings (10)
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Write tests for new features

Applied to files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Follow existing test patterns in the codebase

Applied to files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
📚 Learning: 2025-11-24T19:47:22.909Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Test user workflows in browser tests

Applied to files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Mock external dependencies in tests

Applied to files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Use existing test utilities rather than writing custom utilities

Applied to files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
📚 Learning: 2025-11-24T19:47:22.909Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Check assets/ directory for test data when writing tests

Applied to files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
📚 Learning: 2025-11-24T19:47:22.909Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Test across multiple viewports

Applied to files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Always prefer vitest mock functions over writing verbose manual mocks

Applied to files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
📚 Learning: 2025-11-24T19:47:34.324Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/{services,composables}/**/*.{ts,tsx} : Use `api.fileURL()` for static file access instead of constructing URLs directly

Applied to files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
📚 Learning: 2025-11-24T19:47:14.779Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:14.779Z
Learning: Applies to **/*.{ts,tsx,vue} : Use `const settingStore = useSettingStore()` and `settingStore.get('Comfy.SomeSetting')` to retrieve settings in TypeScript/Vue files

Applied to files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
🧬 Code graph analysis (2)
tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts (1)
src/platform/workflow/templates/composables/useTemplateUrlLoader.ts (1)
  • useTemplateUrlLoader (23-127)
src/platform/workflow/templates/composables/useTemplateUrlLoader.ts (1)
src/renderer/core/canvas/canvasStore.ts (1)
  • useCanvasStore (24-152)
🪛 ESLint
src/platform/workflow/templates/composables/useTemplateUrlLoader.ts

[error] 7-7: Unable to resolve path to module '@/renderer/core/canvas/canvasStore'.

(import-x/no-unresolved)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: test
  • GitHub Check: setup
  • GitHub Check: collect
  • GitHub Check: lint-and-format
🔇 Additional comments (6)
src/platform/workflow/templates/composables/useTemplateUrlLoader.ts (2)

11-21: Mode parameter documentation and cleanup are consistent and clear

The JSDoc and cleanupUrlParams correctly include mode alongside template and source, and the shared validation rule is clearly documented. No changes requested.

Also applies to: 39-47


7-8: Canvas store integration for linear mode looks correct

Importing useCanvasStore and enabling canvasStore.linearMode = true only when the template load succeeds and mode === 'linear' is a clean, side‑effect‑controlled way to hook URL state into the canvas. This matches the intended “linear mode via URL” behavior without impacting other modes.

Also applies to: 29-30, 103-106

tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts (4)

5-14: Test description updated to cover mode and validation is accurate

The header comment now correctly documents the mode=linear behavior and the inclusion of mode in input validation, keeping the test file self‑describing.


74-81: Canvas store mocking and reset strategy are appropriate

Mocking useCanvasStore with a shared mockCanvasStore and resetting linearMode in beforeEach gives you deterministic state across tests and isolates URL‑driven behavior cleanly. This aligns well with the existing mocking style. Based on learnings, this matches the preference for vitest mocks and existing utilities.

Also applies to: 87-88


246-260: URL cleanup test correctly exercises mode removal

Including mode: 'linear' in mockQueryParams and asserting that router.replace is called with only { other: 'param' } verifies that mode is cleaned alongside template and source. This gives good regression coverage for the new query key.


286-353: Linear mode behavior tests are comprehensive

The new tests cover:

  • Enabling linearMode only when mode=linear and the template load succeeds.
  • Keeping linearMode false on load failure or when mode is not linear.
  • Rejecting invalid mode values and accepting multiple valid formats while asserting the right linearMode state.

This gives strong confidence in the new URL‑driven linear mode behavior.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 126140a and d46b244.

📒 Files selected for processing (2)
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts (6 hunks)
  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts (4 hunks)
🧰 Additional context used
📓 Path-based instructions (17)
**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{vue,ts,tsx}: Leverage VueUse functions for performance-enhancing utilities
Use vue-i18n in Composition API for any string literals and place new translation entries in src/locales/en/main.json

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursorrules)

Use es-toolkit for utility functions

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

Use TypeScript for type safety

**/*.{ts,tsx}: Never use any type - use proper TypeScript types
Never use as any type assertions - fix the underlying type issue

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx,js,vue}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper error handling in components and services

**/*.{ts,tsx,js,vue}: Use 2-space indentation, single quotes, no semicolons, and maintain 80-character line width as configured in .prettierrc
Organize imports by sorting and grouping by plugin, and run pnpm format before committing

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx,js,jsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Use camelCase for variable and setting names in TypeScript/Vue files

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx,vue}: Use const settingStore = useSettingStore() and settingStore.get('Comfy.SomeSetting') to retrieve settings in TypeScript/Vue files
Use await settingStore.set('Comfy.SomeSetting', newValue) to update settings in TypeScript/Vue files
Check server capabilities using api.serverSupportsFeature('feature_name') before using enhanced features
Use api.getServerFeature('config_name', defaultValue) to retrieve server feature configuration

Enforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Define dynamic setting defaults using runtime context with functions in settings configuration
Use defaultsByInstallVersion property for gradual feature rollout based on version in settings configuration

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
tests-ui/**/*.test.{js,ts,jsx,tsx}

📄 CodeRabbit inference engine (tests-ui/CLAUDE.md)

tests-ui/**/*.test.{js,ts,jsx,tsx}: Write tests for new features
Follow existing test patterns in the codebase
Use existing test utilities rather than writing custom utilities
Mock external dependencies in tests
Always prefer vitest mock functions over writing verbose manual mocks

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
**/*.{test,spec}.{ts,tsx,js}

📄 CodeRabbit inference engine (AGENTS.md)

Unit and component tests should be located in tests-ui/ or co-located with components as src/components/**/*.{test,spec}.ts; E2E tests should be in browser_tests/

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
**/composables/use*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Name composables in the format useXyz.ts

Files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/*.{vue,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/*.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.ts: Use es-toolkit for utility functions
Use TypeScript for type safety

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/{services,composables}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/{services,composables}/**/*.{ts,tsx}: Use api.apiURL() for backend endpoints instead of constructing URLs directly
Use api.fileURL() for static file access instead of constructing URLs directly

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/*.{ts,tsx,vue}: Sanitize HTML with DOMPurify to prevent XSS attacks
Avoid using @ts-expect-error; use proper TypeScript types instead
Use es-toolkit for utility functions instead of other utility libraries
Implement proper TypeScript types throughout the codebase

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/{composables,components}/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Clean up subscriptions in state management to prevent memory leaks

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/{components,composables}/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Use vue-i18n for ALL user-facing strings by adding them to src/locales/en/main.json

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
🧠 Learnings (9)
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Write tests for new features

Applied to files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Follow existing test patterns in the codebase

Applied to files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
📚 Learning: 2025-11-24T19:47:22.909Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Test user workflows in browser tests

Applied to files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Use existing test utilities rather than writing custom utilities

Applied to files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Mock external dependencies in tests

Applied to files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
📚 Learning: 2025-11-24T19:47:22.909Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Check assets/ directory for test data when writing tests

Applied to files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
📚 Learning: 2025-11-24T19:47:22.909Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: browser_tests/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:22.909Z
Learning: Applies to browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx} : Test across multiple viewports

Applied to files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
📚 Learning: 2025-11-24T19:48:03.270Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: tests-ui/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:48:03.270Z
Learning: Applies to tests-ui/**/*.test.{js,ts,jsx,tsx} : Always prefer vitest mock functions over writing verbose manual mocks

Applied to files:

  • tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts
📚 Learning: 2025-11-24T19:47:34.324Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/{services,composables}/**/*.{ts,tsx} : Use `api.fileURL()` for static file access instead of constructing URLs directly

Applied to files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
🧬 Code graph analysis (2)
tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts (1)
src/platform/workflow/templates/composables/useTemplateUrlLoader.ts (1)
  • useTemplateUrlLoader (23-137)
src/platform/workflow/templates/composables/useTemplateUrlLoader.ts (1)
src/platform/navigation/preservedQueryNamespaces.ts (1)
  • PRESERVED_QUERY_NAMESPACES (1-3)
🪛 ESLint
src/platform/workflow/templates/composables/useTemplateUrlLoader.ts

[error] 7-7: Unable to resolve path to module '@/renderer/core/canvas/canvasStore'.

(import-x/no-unresolved)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: collect
  • GitHub Check: setup
  • GitHub Check: lint-and-format
  • GitHub Check: test
🔇 Additional comments (5)
src/platform/workflow/templates/composables/useTemplateUrlLoader.ts (3)

78-94: Good defensive validation for the mode parameter.

The validation logic correctly:

  • Checks type and format using the same pattern as template/source
  • Returns early for invalid formats to prevent injection
  • Warns about unsupported modes while allowing graceful degradation

113-116: Correct timing for linear mode activation.

Setting linear mode only after successful template load ensures the canvas state is only modified when the template is actually available.


7-7: Perfect! I now have enough information to verify the review comment. The TypeScript configuration shows that @/* maps to ./src/*, which means:

  • @/renderer/core/canvas/canvasStore resolves to src/renderer/core/canvas/canvasStore.ts
  • The file exists at this exact location
  • The import is actively used in the composable function

The ESLint error is indeed a configuration issue where ESLint is not properly picking up TypeScript's path alias configuration, but the import resolves correctly at runtime.


ESLint import resolution error is a configuration issue, not an actual path problem.

The path alias @/renderer/core/canvas/canvasStore correctly resolves to src/renderer/core/canvas/canvasStore.ts per the TypeScript configuration ("@/*": ["./src/*"]). The file exists and the import is actively used in the composable. ESLint's inability to resolve the path is a configuration oversight in ESLint's setup, not a genuine import issue—the import works correctly at runtime.

tests-ui/tests/platform/workflow/templates/composables/useTemplateUrlLoader.test.ts (2)

74-81: Well-structured mock for canvas store.

The mock setup follows the existing pattern used for other dependencies (toast, router) and correctly exposes the linearMode property needed for testing.


286-401: Excellent test coverage for the mode parameter.

The test suite comprehensively covers:

  • Successful linear mode activation
  • Failure scenarios (no mode set on template load failure)
  • Invalid input validation (special characters, arrays)
  • Unsupported mode handling (warns but continues)
  • Edge cases and integration with URL cleanup

The tests follow existing patterns and ensure the feature works correctly.

Based on learnings, the tests follow existing test patterns in the codebase and provide comprehensive coverage for the new feature.

@christian-byrne christian-byrne added the claude-review Add to trigger a PR code review from Claude Code label Nov 26, 2025
Copy link

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comprehensive PR Review

This review is generated by Claude. It may not always be accurate, as with human reviewers. If you believe that any of the comments are invalid or incorrect, please state why for each. For others, please implement the changes in one way or another.

Review Summary

PR: feat: open template via URL in linear mode (#6945)
Impact: 159 additions, 4 deletions across 3 files

Issue Distribution

  • Critical: 0
  • High: 0
  • Medium: 1
  • Low: 0

Category Breakdown

  • Architecture: 0 issues
  • Security: 0 issues
  • Performance: 0 issues
  • Code Quality: 1 issue

Key Findings

Architecture & Design

The implementation follows established patterns in the ComfyUI frontend codebase. The feature properly integrates with the existing template loading system, URL query parameter handling, and canvas state management. The separation of concerns is maintained with proper use of composables and the router's preserved query tracker system.

Security Considerations

The implementation includes robust input validation using regex patterns to prevent path traversal and injection attacks. All URL parameters (template, source, and mode) are properly validated before use. The validation approach is consistent with existing security patterns in the codebase.

Performance Impact

The changes have minimal performance impact. The new mode parameter validation adds minimal overhead, and the linear mode activation only occurs after successful template loading, preventing unnecessary state changes on failed loads.

Integration Points

The integration with the preserved query tracker ensures proper URL state management across navigation. The canvas store integration is clean and follows the established reactive patterns. The feature gracefully handles edge cases like unsupported modes without breaking existing functionality.

Positive Observations

  • Comprehensive Testing: The PR includes extensive unit tests covering all edge cases, validation scenarios, and error conditions
  • Documentation: Clear JSDoc comments explain the functionality and supported URL formats
  • Input Validation: Robust security measures prevent malicious input
  • Error Handling: Proper error handling with user-friendly toast notifications
  • Backward Compatibility: The feature is purely additive and doesn't break existing functionality
  • Code Style: Consistent with established patterns and formatting standards
  • Type Safety: Generally good TypeScript usage throughout the implementation

Next Steps

  1. Address the type safety issue in the inline comment to maintain strict TypeScript compliance
  2. Consider the suggested type predicate approach for better maintainability
  3. The implementation is otherwise ready for merge after addressing the minor type safety concern

This is a comprehensive automated review. For architectural decisions requiring human judgment, please request additional manual review.

@github-actions github-actions bot removed the claude-review Add to trigger a PR code review from Claude Code label Nov 26, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/platform/workflow/templates/composables/useTemplateUrlLoader.ts (2)

31-32: Tighten isSupportedMode to avoid type assertions (optional)

The SUPPORTED_MODES + SupportedMode pattern is good, but mode as SupportedMode in includes is still an assertion you can avoid while keeping the type guard.

You can slightly simplify and drop the cast like this:

-  const isSupportedMode = (mode: string): mode is SupportedMode => {
-    return SUPPORTED_MODES.includes(mode as SupportedMode)
-  }
+  const isSupportedMode = (mode: string): mode is SupportedMode => {
+    return SUPPORTED_MODES.some(supportedMode => supportedMode === mode)
+  }

This keeps the type predicate, avoids assertions on untrusted input, and still backs the console warning with the same SUPPORTED_MODES list.

Also applies to: 42-46, 98-102


86-97: Consider avoiding as string on route.query.mode and clarifying invalid/array handling

Current logic works at runtime, but const modeParam = route.query.mode as string | undefined weakens type safety and makes the typeof modeParam !== 'string' check misleading to TypeScript.

You could make this more explicit and avoid the assertion:

-    const modeParam = route.query.mode as string | undefined
-
-    if (
-      modeParam &&
-      (typeof modeParam !== 'string' || !isValidParameter(modeParam))
-    ) {
-      console.warn(
-        `[useTemplateUrlLoader] Invalid mode parameter format: ${modeParam}`
-      )
-      return
-    }
+    const rawModeParam = route.query.mode
+
+    if (Array.isArray(rawModeParam)) {
+      console.warn(
+        `[useTemplateUrlLoader] Invalid mode parameter format (array): ${rawModeParam}`
+      )
+      return
+    }
+
+    const modeParam =
+      typeof rawModeParam === 'string' ? rawModeParam : undefined
+
+    if (modeParam && !isValidParameter(modeParam)) {
+      console.warn(
+        `[useTemplateUrlLoader] Invalid mode parameter format: ${modeParam}`
+      )
+      return
+    }

Optionally, since mode is purely client‑side view state, you might also choose to ignore invalid mode values instead of aborting the template load (in contrast to template/source), depending on the product requirements.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d46b244 and 5cb928d.

📒 Files selected for processing (1)
  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts (6 hunks)
🧰 Additional context used
📓 Path-based instructions (15)
**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{vue,ts,tsx}: Leverage VueUse functions for performance-enhancing utilities
Use vue-i18n in Composition API for any string literals and place new translation entries in src/locales/en/main.json

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursorrules)

Use es-toolkit for utility functions

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

Use TypeScript for type safety

**/*.{ts,tsx}: Never use any type - use proper TypeScript types
Never use as any type assertions - fix the underlying type issue

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx,js,vue}

📄 CodeRabbit inference engine (.cursorrules)

Implement proper error handling in components and services

**/*.{ts,tsx,js,vue}: Use 2-space indentation, single quotes, no semicolons, and maintain 80-character line width as configured in .prettierrc
Organize imports by sorting and grouping by plugin, and run pnpm format before committing

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/*.{vue,ts}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.{vue,ts}: Leverage VueUse functions for performance-enhancing styles
Implement proper error handling
Use vue-i18n in composition API for any string literals. Place new translation entries in src/locales/en/main.json

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/*.ts

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

src/**/*.ts: Use es-toolkit for utility functions
Use TypeScript for type safety

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx,js,jsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

Use camelCase for variable and setting names in TypeScript/Vue files

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx,vue}: Use const settingStore = useSettingStore() and settingStore.get('Comfy.SomeSetting') to retrieve settings in TypeScript/Vue files
Use await settingStore.set('Comfy.SomeSetting', newValue) to update settings in TypeScript/Vue files
Check server capabilities using api.serverSupportsFeature('feature_name') before using enhanced features
Use api.getServerFeature('config_name', defaultValue) to retrieve server feature configuration

Enforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Define dynamic setting defaults using runtime context with functions in settings configuration
Use defaultsByInstallVersion property for gradual feature rollout based on version in settings configuration

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/{services,composables}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/{services,composables}/**/*.{ts,tsx}: Use api.apiURL() for backend endpoints instead of constructing URLs directly
Use api.fileURL() for static file access instead of constructing URLs directly

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/*.{ts,tsx,vue}: Sanitize HTML with DOMPurify to prevent XSS attacks
Avoid using @ts-expect-error; use proper TypeScript types instead
Use es-toolkit for utility functions instead of other utility libraries
Implement proper TypeScript types throughout the codebase

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/{composables,components}/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Clean up subscriptions in state management to prevent memory leaks

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
src/**/{components,composables}/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Use vue-i18n for ALL user-facing strings by adding them to src/locales/en/main.json

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
**/composables/use*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Name composables in the format useXyz.ts

Files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
🧠 Learnings (7)
📚 Learning: 2025-11-24T19:47:34.324Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/{services,composables}/**/*.{ts,tsx} : Use `api.fileURL()` for static file access instead of constructing URLs directly

Applied to files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
📚 Learning: 2025-11-24T19:47:14.779Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:14.779Z
Learning: Applies to **/*.{ts,tsx} : Never use `as any` type assertions - fix the underlying type issue

Applied to files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
📚 Learning: 2025-11-24T19:47:14.779Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:14.779Z
Learning: Applies to **/*.{ts,tsx} : Never use `any` type - use proper TypeScript types

Applied to files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
📚 Learning: 2025-11-24T19:47:34.324Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:34.324Z
Learning: Applies to src/**/*.{ts,tsx,vue} : Avoid using ts-expect-error; use proper TypeScript types instead

Applied to files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
📚 Learning: 2025-11-24T19:47:56.371Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/lib/litegraph/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:56.371Z
Learning: Applies to src/lib/litegraph/**/*.{ts,tsx} : Type assertions are an absolute last resort. In almost all cases, they are a crutch that leads to brittle code

Applied to files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
📚 Learning: 2025-11-24T19:46:52.279Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-24T19:46:52.279Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript for type safety

Applied to files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
📚 Learning: 2025-11-24T19:47:02.860Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-24T19:47:02.860Z
Learning: Applies to src/**/*.ts : Use TypeScript for type safety

Applied to files:

  • src/platform/workflow/templates/composables/useTemplateUrlLoader.ts
🧬 Code graph analysis (1)
src/platform/workflow/templates/composables/useTemplateUrlLoader.ts (1)
src/platform/navigation/preservedQueryNamespaces.ts (1)
  • PRESERVED_QUERY_NAMESPACES (1-3)
🪛 ESLint
src/platform/workflow/templates/composables/useTemplateUrlLoader.ts

[error] 7-7: Unable to resolve path to module '@/renderer/core/canvas/canvasStore'.

(import-x/no-unresolved)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: collect
  • GitHub Check: setup
  • GitHub Check: lint-and-format
  • GitHub Check: test
🔇 Additional comments (4)
src/platform/workflow/templates/composables/useTemplateUrlLoader.ts (4)

7-7: Verify canvas store import path resolution

The useCanvasStore integration itself looks fine, but ESLint reports import-x/no-unresolved for '@/renderer/core/canvas/canvasStore'. Please double‑check that:

  • src/renderer/core/canvas/canvasStore.ts exists and exports useCanvasStore
  • The '@' alias is configured for this path in both TS and ESLint

If the path is correct, this may be a lint config/path‑mapping issue rather than a code issue.

Also applies to: 29-29


17-21: JSDoc updates correctly document the new mode parameter

The extended examples and validation notes accurately reflect the new mode support and format constraints; nothing to change here.


48-49: URL/query cleanup extended to mode looks consistent

Removing mode alongside template and source, and then clearing the TEMPLATE preserved query namespace, keeps the URL state clean after handling template links; this matches the existing pattern.

Also applies to: 55-55, 137-139


121-123: Linear mode activation after successful template load is well‑placed

Enabling canvasStore.linearMode only when:

  • the template load succeeds, and
  • modeParam === 'linear'

is a clear and side‑effect‑scoped way to wire URL mode into the canvas store. No changes needed here.

@christian-byrne christian-byrne added the cloud/1.33 Backport PRs for cloud 1.33 label Nov 26, 2025
@christian-byrne christian-byrne merged commit c5fe617 into main Nov 26, 2025
31 checks passed
@christian-byrne christian-byrne deleted the linear-mode-url branch November 26, 2025 23:44
github-actions bot pushed a commit that referenced this pull request Nov 26, 2025
github-actions bot pushed a commit that referenced this pull request Nov 26, 2025
@comfy-pr-bot
Copy link
Member

@christian-byrne Successfully backported to #6967

@comfy-pr-bot
Copy link
Member

@christian-byrne Successfully backported to #6968

@github-actions github-actions bot removed the needs-backport Fix/change that needs to be cherry-picked to the current feature freeze branch label Nov 26, 2025
christian-byrne added a commit that referenced this pull request Nov 27, 2025
Backport of #6945 to `cloud/1.33`

Automatically created by backport workflow.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6968-backport-cloud-1-33-feat-open-template-via-URL-in-linear-mode-2b76d73d365081c4b5d5c0727106fc29)
by [Unito](https://www.unito.io)

Co-authored-by: Christian Byrne <cbyrne@comfy.org>
christian-byrne added a commit that referenced this pull request Nov 27, 2025
Backport of #6945 to `cloud/1.32`

Automatically created by backport workflow.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6967-backport-cloud-1-32-feat-open-template-via-URL-in-linear-mode-2b76d73d3650810aaf26efea68272ed0)
by [Unito](https://www.unito.io)

Co-authored-by: Christian Byrne <cbyrne@comfy.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cloud/1.32 cloud/1.33 Backport PRs for cloud 1.33 size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants