Skip to content

Conversation

@christian-byrne
Copy link
Contributor

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

Summary

Implement the new design for template library

Changes

  • What
    • New sort option: Popular and Recommended
    • New category: Popular, leverage the Popular sorting
    • Support add category stick to top of the side bar
    • Support template customized visible in different platform by includeOnDistributions field

How to make Popular and Recommended work

Add usage-based ordering to workflow templates with position bias correction, manual ranking (searchRank), and freshness boost.

New sort modes:

  • "Recommended" (default): usage × 0.5 + searchRank × 0.3 + freshness × 0.2
  • "Popular": usage × 0.9 + freshness × 0.1

Screenshots (if applicable)

New default ordering:

Selection_2485

┆Issue is synchronized with this Notion page by Unito

Popular category:

image

@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Nov 30, 2025
@github-actions
Copy link

github-actions bot commented Nov 30, 2025

🎨 Storybook Build Status

Build completed successfully!

⏰ Completed at: 01/06/2026, 01:13:24 PM UTC

🔗 Links


🎉 Your Storybook is ready for review!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 30, 2025

📝 Walkthrough

Walkthrough

Adds a usage-based template ranking system: new Pinia store that loads precomputed usage scores and computes freshness and composite scores; introduces 'recommended' and 'popular' sorts across schema, telemetry, composable, UI, docs; changes default sort to 'default' and adds distribution-based template visibility and nav↔sort coordination.

Changes

Cohort / File(s) Summary
Documentation
docs/TEMPLATE_RANKING.md
New document describing ranking design, sort modes, scoring formulas, freshness calc, position-bias correction, data format, update workflow, and searchRank guidance.
Ranking Store + Tests
src/stores/templateRankingStore.ts, tests-ui/stores/templateRankingStore.test.ts
New Pinia store that loads assets/template-usage-scores.json (axios, one-time), exposes loadScores, getUsageScore, computeFreshness, computeDefaultScore, computePopularScore; tests cover scoring, freshness, and edge cases with mocked axios and isolated Pinia.
Composable & Filtering
src/composables/useTemplateFiltering.ts, src/composables/useTemplateFiltering.test.ts
Integrates useTemplateRankingStore, extends sortBy with 'recommended' and 'popular', implements 'recommended'/'popular' sorts and default 'default' ordering, updates reset behavior, and adds test Pinia/mocks.
UI Component
src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
Adds distribution-based visibility (isTemplateVisibleOnDistribution), selectedNavItem and coordinateNavAndSort logic linking navigation and sort (popular ↔ popular sort), updates sortOptions to include 'recommended' and 'popular', and uses v-show for per-template rendering.
Types, Schema & Telemetry
src/platform/workflow/templates/types/template.ts, src/platform/telemetry/types.ts, src/schemas/apiSchema.ts
Adds optional searchRank?: number to TemplateInfo; extends telemetry TemplateFilterMetadata.sort_by and API zSettings enum to include 'recommended' and 'popular'.
Settings & Localization
src/platform/settings/constants/coreSettings.ts, src/locales/en/main.json
Default Comfy.Templates.SortBy changed from 'newest' to 'default'; locale label templateWorkflows.useCaseFilter changed to "Tasks" and templateWorkflows.sort.popular added.
Tests / Browser Tests
browser_tests/tests/templates.spec.ts
Updated navigation click target index for "Getting Started" (navigation path adjusted in test).

Sequence Diagram

sequenceDiagram
    participant User
    participant UI as WorkflowTemplateSelectorDialog
    participant Composable as useTemplateFiltering
    participant Store as templateRankingStore
    participant Assets as "assets/template-usage-scores.json"

    User->>UI: select nav/sort (e.g., "popular")
    UI->>Composable: request templates (apply nav↔sort coordination)
    Composable->>Store: ask for scores/freshness per template

    alt Store not loaded
        Store->>Assets: HTTP GET usage scores
        Assets-->>Store: return JSON scores
        Store->>Store: cache scores, set isLoaded
    end

    Store->>Composable: return getUsageScore/computeFreshness/compute{Default,Popular}Score
    Composable->>Composable: sort & filter templates (apply distribution visibility)
    Composable-->>UI: sorted template list
    UI->>User: render ranked templates
Loading

Possibly related PRs

  • Comfy-Org/ComfyUI_frontend#7377 — Touches src/composables/useTemplateFiltering.ts; related because it also modifies template filtering/sorting behavior and search weighting.
✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

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

@github-actions
Copy link

github-actions bot commented Nov 30, 2025

🎭 Playwright Test Results

⚠️ Tests passed with flaky tests

⏰ Completed at: 01/06/2026, 01:18:25 PM UTC

📈 Summary

  • Total Tests: 513
  • Passed: 504 ✅
  • Failed: 0
  • Flaky: 1 ⚠️
  • Skipped: 8 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 494 / ❌ 0 / ⚠️ 0 / ⏭️ 8
  • chromium-2x: View Report • ✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • chromium-0.5x: View Report • ✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • mobile-chrome: View Report • ✅ 7 / ❌ 0 / ⚠️ 1 / ⏭️ 0

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

@github-actions
Copy link

github-actions bot commented Nov 30, 2025

Bundle Size Report

Summary

  • Raw size: 17.4 MB baseline 17.4 MB — 🔴 +5.49 kB
  • Gzip: 3.57 MB baseline 3.57 MB — 🔴 +1.15 kB
  • Brotli: 2.72 MB baseline 2.72 MB — 🔴 +1.08 kB
  • Bundles: 99 current • 99 baseline • 43 added / 43 removed

Category Glance
Graph Workspace 🔴 +5.44 kB (1.01 MB) · App Entry Points 🔴 +53 B (3.23 MB) · Vendor & Third-Party ⚪ 0 B (9.19 MB) · Other ⚪ 0 B (3.5 MB) · Panels & Settings ⚪ 0 B (300 kB) · UI Components ⚪ 0 B (193 kB) · + 3 more

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

Main entry bundles and manifests

File Before After Δ Raw Δ Gzip Δ Brotli
assets/index-BZIlvHie.js (new) 3.03 MB 🔴 +3.03 MB 🔴 +637 kB 🔴 +484 kB
assets/index-0-ZRvV8_.js (removed) 3.03 MB 🟢 -3.03 MB 🟢 -637 kB 🟢 -484 kB
assets/index-BjQdrK0E.js (removed) 194 kB 🟢 -194 kB 🟢 -42.3 kB 🟢 -35.2 kB
assets/index-DaKCWou6.js (new) 194 kB 🔴 +194 kB 🔴 +42.3 kB 🔴 +35.2 kB
assets/index-1rddHREd.js (new) 345 B 🔴 +345 B 🔴 +242 B 🔴 +238 B
assets/index-DH4VRHwR.js (removed) 345 B 🟢 -345 B 🟢 -247 B 🟢 -200 B

Status: 3 added / 3 removed

Graph Workspace — 1.01 MB (baseline 1 MB) • 🔴 +5.44 kB

Graph editor runtime, canvas, workflow orchestration

File Before After Δ Raw Δ Gzip Δ Brotli
assets/GraphView-fwsQSdT5.js (new) 1.01 MB 🔴 +1.01 MB 🔴 +196 kB 🔴 +149 kB
assets/GraphView-CuxXpvx7.js (removed) 1 MB 🟢 -1 MB 🟢 -195 kB 🟢 -148 kB

Status: 1 added / 1 removed

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

Top-level views, pages, and routed surfaces

File Before After Δ Raw Δ Gzip Δ Brotli
assets/UserSelectView-DKBf3aDK.js (new) 6.63 kB 🔴 +6.63 kB 🔴 +2.14 kB 🔴 +1.9 kB
assets/UserSelectView-DRpEEECs.js (removed) 6.63 kB 🟢 -6.63 kB 🟢 -2.14 kB 🟢 -1.9 kB

Status: 1 added / 1 removed

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

Configuration panels, inspectors, and settings screens

File Before After Δ Raw Δ Gzip Δ Brotli
assets/LegacyCreditsPanel-CVh-D0Oc.js (removed) 22.7 kB 🟢 -22.7 kB 🟢 -5.25 kB 🟢 -4.61 kB
assets/LegacyCreditsPanel-hlomBi8D.js (new) 22.7 kB 🔴 +22.7 kB 🔴 +5.25 kB 🔴 +4.6 kB
assets/KeybindingPanel-BO2Gtnwf.js (removed) 14.8 kB 🟢 -14.8 kB 🟢 -3.57 kB 🟢 -3.13 kB
assets/KeybindingPanel-CppdSVBx.js (new) 14.8 kB 🔴 +14.8 kB 🔴 +3.57 kB 🔴 +3.13 kB
assets/ExtensionPanel-1RRU3MdT.js (removed) 11.1 kB 🟢 -11.1 kB 🟢 -2.62 kB 🟢 -2.29 kB
assets/ExtensionPanel-BMhD18Mc.js (new) 11.1 kB 🔴 +11.1 kB 🔴 +2.61 kB 🔴 +2.29 kB
assets/AboutPanel-B5Ewh2lQ.js (new) 9.16 kB 🔴 +9.16 kB 🔴 +2.46 kB 🔴 +2.2 kB
assets/AboutPanel-D8kwifgX.js (removed) 9.16 kB 🟢 -9.16 kB 🟢 -2.46 kB 🟢 -2.21 kB
assets/ServerConfigPanel-BDr_GGv1.js (new) 7.51 kB 🔴 +7.51 kB 🔴 +2.04 kB 🔴 +1.8 kB
assets/ServerConfigPanel-DiNEaCik.js (removed) 7.51 kB 🟢 -7.51 kB 🟢 -2.04 kB 🟢 -1.8 kB
assets/UserPanel-CuRUuVsv.js (removed) 6.88 kB 🟢 -6.88 kB 🟢 -1.79 kB 🟢 -1.57 kB
assets/UserPanel-USN8vWuh.js (new) 6.88 kB 🔴 +6.88 kB 🔴 +1.79 kB 🔴 +1.56 kB
assets/settings-BhbWhsRg.js 101 B 101 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-BIdKi-OT.js 26.2 kB 26.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-Bu3OR-lX.js 24.6 kB 24.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-ByL6gy5c.js 25.4 kB 25.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-CjlRFMdL.js 32.8 kB 32.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-DkGwvylK.js 26.9 kB 26.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-Dyd027Dx.js 24.7 kB 24.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-MzsBgiwB.js 21.7 kB 21.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-wwBxqLH5.js 21.3 kB 21.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/settings-xx2Yb6R2.js 23.8 kB 23.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 6 added / 6 removed

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

Reusable component library chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/LazyImage.vue_vue_type_script_setup_true_lang-BKxQ6wH6.js (new) 60.1 kB 🔴 +60.1 kB 🔴 +12.4 kB 🔴 +10.8 kB
assets/LazyImage.vue_vue_type_script_setup_true_lang-DMyG3Dc7.js (removed) 60.1 kB 🟢 -60.1 kB 🟢 -12.4 kB 🟢 -10.8 kB
assets/Load3D.vue_vue_type_script_setup_true_lang-B0dS9eNN.js (removed) 54.4 kB 🟢 -54.4 kB 🟢 -8.6 kB 🟢 -7.38 kB
assets/Load3D.vue_vue_type_script_setup_true_lang-C4cvLCDo.js (new) 54.4 kB 🔴 +54.4 kB 🔴 +8.6 kB 🔴 +7.37 kB
assets/WidgetSelect.vue_vue_type_script_setup_true_lang-9Pu23t8O.js (removed) 49 kB 🟢 -49 kB 🟢 -10.5 kB 🟢 -9.14 kB
assets/WidgetSelect.vue_vue_type_script_setup_true_lang-BPnzcanv.js (new) 49 kB 🔴 +49 kB 🔴 +10.5 kB 🔴 +9.13 kB
assets/WidgetInputNumber.vue_vue_type_script_setup_true_lang-7IDLE7r7.js (new) 10.9 kB 🔴 +10.9 kB 🔴 +2.9 kB 🔴 +2.55 kB
assets/WidgetInputNumber.vue_vue_type_script_setup_true_lang-BERQZ2NE.js (removed) 10.9 kB 🟢 -10.9 kB 🟢 -2.9 kB 🟢 -2.55 kB
assets/ComfyQueueButton-CNPxg51s.js (removed) 8.83 kB 🟢 -8.83 kB 🟢 -2.58 kB 🟢 -2.3 kB
assets/ComfyQueueButton-DXpKgNRJ.js (new) 8.83 kB 🔴 +8.83 kB 🔴 +2.58 kB 🔴 +2.3 kB
assets/WidgetWithControl.vue_vue_type_script_setup_true_lang-Cj1RHLr9.js (removed) 3.72 kB 🟢 -3.72 kB 🟢 -1.46 kB 🟢 -1.32 kB
assets/WidgetWithControl.vue_vue_type_script_setup_true_lang-CJ3bNxIv.js (new) 3.72 kB 🔴 +3.72 kB 🔴 +1.45 kB 🔴 +1.32 kB
assets/WidgetButton-8kXjRWp7.js (removed) 2.21 kB 🟢 -2.21 kB 🟢 -997 B 🟢 -870 B
assets/WidgetButton-DQoEAJTN.js (new) 2.21 kB 🔴 +2.21 kB 🔴 +996 B 🔴 +894 B
assets/WidgetLayoutField.vue_vue_type_script_setup_true_lang-Dfs8yo_h.js (removed) 2.14 kB 🟢 -2.14 kB 🟢 -890 B 🟢 -774 B
assets/WidgetLayoutField.vue_vue_type_script_setup_true_lang-Xj8C38-k.js (new) 2.14 kB 🔴 +2.14 kB 🔴 +890 B 🔴 +774 B
assets/MediaTitle.vue_vue_type_script_setup_true_lang-BRLbcC4n.js (removed) 897 B 🟢 -897 B 🟢 -501 B 🟢 -442 B
assets/MediaTitle.vue_vue_type_script_setup_true_lang-CZHSPWbg.js (new) 897 B 🔴 +897 B 🔴 +502 B 🔴 +433 B
assets/UserAvatar.vue_vue_type_script_setup_true_lang-Btc-ocVv.js 1.34 kB 1.34 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 9 added / 9 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-DE06TnMx.js (new) 7.51 kB 🔴 +7.51 kB 🔴 +1.83 kB 🔴 +1.57 kB
assets/keybindingService-DOCJK-GQ.js (removed) 7.51 kB 🟢 -7.51 kB 🟢 -1.83 kB 🟢 -1.57 kB
assets/audioService-BZr6JR7B.js (new) 2.2 kB 🔴 +2.2 kB 🔴 +963 B 🔴 +832 B
assets/audioService-DkEYooJ8.js (removed) 2.2 kB 🟢 -2.2 kB 🟢 -963 B 🟢 -829 B
assets/serverConfigStore-CLS4uKu9.js 2.83 kB 2.83 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 2 added / 2 removed

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

Helpers, composables, and utility bundles

File Before After Δ Raw Δ Gzip Δ Brotli
assets/audioUtils-B3VdaLdt.js (removed) 1.41 kB 🟢 -1.41 kB 🟢 -651 B 🟢 -552 B
assets/audioUtils-CPDeYG7c.js (new) 1.41 kB 🔴 +1.41 kB 🔴 +652 B 🔴 +548 B

Status: 1 added / 1 removed

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

External libraries and shared vendor chunks

File Before After Δ Raw Δ Gzip Δ Brotli
assets/vendor-chart-vIZEp4HX.js 452 kB 452 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-other-fFl5a9Y4.js 3.9 MB 3.9 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-primevue-woBPd4cb.js 1.95 MB 1.95 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-three-r9r5tF_O.js 2.08 MB 2.08 MB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-tiptap-C79JtMXE.js 232 kB 232 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-vue-BXnt3M34.js 160 kB 160 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/vendor-xterm-BF8peZ5_.js 420 kB 420 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
Other — 3.5 MB (baseline 3.5 MB) • ⚪ 0 B

Bundles that do not match a named category

File Before After Δ Raw Δ Gzip Δ Brotli
assets/SubscriptionRequiredDialogContent-DfaTdV1i.js (removed) 29 kB 🟢 -29 kB 🟢 -6.42 kB 🟢 -5.59 kB
assets/SubscriptionRequiredDialogContent-DyoQSk9f.js (new) 29 kB 🔴 +29 kB 🔴 +6.42 kB 🔴 +5.58 kB
assets/WidgetRecordAudio-B9F3AIGP.js (new) 20.4 kB 🔴 +20.4 kB 🔴 +5.24 kB 🔴 +4.63 kB
assets/WidgetRecordAudio-Bs2z5zui.js (removed) 20.4 kB 🟢 -20.4 kB 🟢 -5.23 kB 🟢 -4.64 kB
assets/AudioPreviewPlayer-D48eIG9s.js (removed) 13.3 kB 🟢 -13.3 kB 🟢 -3.35 kB 🟢 -2.99 kB
assets/AudioPreviewPlayer-IlQ4ktcD.js (new) 13.3 kB 🔴 +13.3 kB 🔴 +3.35 kB 🔴 +2.99 kB
assets/ValueControlPopover-D97Ulq1d.js (removed) 5.49 kB 🟢 -5.49 kB 🟢 -1.7 kB 🟢 -1.52 kB
assets/ValueControlPopover-DWOAfji_.js (new) 5.49 kB 🔴 +5.49 kB 🔴 +1.7 kB 🔴 +1.51 kB
assets/WidgetGalleria-CWhKuoei.js (removed) 4.1 kB 🟢 -4.1 kB 🟢 -1.44 kB 🟢 -1.3 kB
assets/WidgetGalleria-D_Y6oCxF.js (new) 4.1 kB 🔴 +4.1 kB 🔴 +1.45 kB 🔴 +1.3 kB
assets/WidgetColorPicker-BQHaRUyK.js (removed) 3.41 kB 🟢 -3.41 kB 🟢 -1.38 kB 🟢 -1.24 kB
assets/WidgetColorPicker-DSXtP_vF.js (new) 3.41 kB 🔴 +3.41 kB 🔴 +1.38 kB 🔴 +1.23 kB
assets/WidgetTextarea-CsvSnSbT.js (removed) 3.08 kB 🟢 -3.08 kB 🟢 -1.22 kB 🟢 -1.07 kB
assets/WidgetTextarea-D03pVz5L.js (new) 3.08 kB 🔴 +3.08 kB 🔴 +1.21 kB 🔴 +1.09 kB
assets/WidgetMarkdown-BccmcMa2.js (removed) 3.08 kB 🟢 -3.08 kB 🟢 -1.28 kB 🟢 -1.12 kB
assets/WidgetMarkdown-DGkAiBU-.js (new) 3.08 kB 🔴 +3.08 kB 🔴 +1.28 kB 🔴 +1.13 kB
assets/WidgetAudioUI-CQdxlYr2.js (removed) 2.89 kB 🟢 -2.89 kB 🟢 -1.17 kB 🟢 -1.06 kB
assets/WidgetAudioUI-G8U29-Bb.js (new) 2.89 kB 🔴 +2.89 kB 🔴 +1.17 kB 🔴 +1.06 kB
assets/WidgetInputText-3pW72iaX.js (new) 1.99 kB 🔴 +1.99 kB 🔴 +919 B 🔴 +845 B
assets/WidgetInputText-mb74WK_5.js (removed) 1.99 kB 🟢 -1.99 kB 🟢 -920 B 🟢 -846 B
assets/WidgetToggleSwitch-NNBOmTPV.js (new) 1.76 kB 🔴 +1.76 kB 🔴 +835 B 🔴 +733 B
assets/WidgetToggleSwitch-PIAmZhSn.js (removed) 1.76 kB 🟢 -1.76 kB 🟢 -833 B 🟢 -728 B
assets/MediaImageBottom-DzlcEFcu.js (removed) 1.55 kB 🟢 -1.55 kB 🟢 -733 B 🟢 -641 B
assets/MediaImageBottom-PHhcQaM6.js (new) 1.55 kB 🔴 +1.55 kB 🔴 +735 B 🔴 +637 B
assets/MediaAudioBottom-C3lgr33a.js (new) 1.51 kB 🔴 +1.51 kB 🔴 +732 B 🔴 +647 B
assets/MediaAudioBottom-DtPIypXI.js (removed) 1.51 kB 🟢 -1.51 kB 🟢 -731 B 🟢 -647 B
assets/Media3DBottom-BAZla0Tm.js (new) 1.5 kB 🔴 +1.5 kB 🔴 +729 B 🔴 +647 B
assets/Media3DBottom-HMtw74hi.js (removed) 1.5 kB 🟢 -1.5 kB 🟢 -730 B 🟢 -646 B
assets/MediaVideoBottom-Bqeh_mIl.js (new) 1.5 kB 🔴 +1.5 kB 🔴 +729 B 🔴 +649 B
assets/MediaVideoBottom-CIVQKp4J.js (removed) 1.5 kB 🟢 -1.5 kB 🟢 -730 B 🟢 -646 B
assets/Media3DTop-DUIV8MdT.js (new) 1.49 kB 🔴 +1.49 kB 🔴 +764 B 🔴 +653 B
assets/Media3DTop-QqSFBALO.js (removed) 1.49 kB 🟢 -1.49 kB 🟢 -763 B 🟢 -651 B
assets/WidgetSelect-BlsTQwgI.js (new) 733 B 🔴 +733 B 🔴 +361 B 🔴 +319 B
assets/WidgetSelect-C4Ae-26T.js (removed) 733 B 🟢 -733 B 🟢 -364 B 🟢 -325 B
assets/WidgetInputNumber-BPTTEWE2.js (removed) 673 B 🟢 -673 B 🟢 -351 B 🟢 -288 B
assets/WidgetInputNumber-BQ0SEopl.js (new) 673 B 🔴 +673 B 🔴 +349 B 🔴 +289 B
assets/Load3D-BF9vF42L.js (new) 424 B 🔴 +424 B 🔴 +264 B 🔴 +224 B
assets/Load3D-DpiNpDU3.js (removed) 424 B 🟢 -424 B 🟢 -265 B 🟢 -223 B
assets/WidgetLegacy-BuntN69X.js (new) 364 B 🔴 +364 B 🔴 +235 B 🔴 +196 B
assets/WidgetLegacy-C8biUcWj.js (removed) 364 B 🟢 -364 B 🟢 -236 B 🟢 -196 B
assets/commands-09qoDJrw.js 13.8 kB 13.8 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-BWp4HdfU.js 101 B 101 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CcfGaui5.js 14.4 kB 14.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CisfgZf5.js 13.7 kB 13.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CkU12Foh.js 13 kB 13 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-CoH2DJa6.js 14.2 kB 14.2 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-COSt-Bjx.js 14.9 kB 14.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DalfIW5f.js 15.9 kB 15.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DfTl0eCm.js 13.5 kB 13.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/commands-DwSJL865.js 13.7 kB 13.7 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Ba_fO77I.js 91.3 kB 91.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Bdc58rJq.js 97.1 kB 97.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-C9ZJBRdI.js 81.5 kB 81.5 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-CAL83XT3.js 84.6 kB 84.6 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-CHLLfvpG.js 82.4 kB 82.4 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-Cw9RZWRY.js 89 B 89 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-DDqR5EuX.js 71.3 kB 71.3 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-DLHyaEcz.js 92.1 kB 92.1 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-O7KfJeMO.js 79.9 kB 79.9 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/main-OzGsrlqJ.js 112 kB 112 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaAudioTop-DrF_Vdi7.js 1.46 kB 1.46 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaImageTop-DmgiGEEz.js 1.75 kB 1.75 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/MediaVideoTop-BXyavTZf.js 2.65 kB 2.65 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-aW9En70v.js 260 kB 260 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-BIckSVgU.js 273 kB 273 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-BiYpVi7D.js 263 kB 263 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-Bw_Jitw_.js 101 B 101 B ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CCEXtYfM.js 243 kB 243 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-CvmVDWYd.js 323 kB 323 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-D_wreoPJ.js 267 kB 267 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-Dz-0ZIBN.js 297 kB 297 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-VZsNmhG7.js 264 kB 264 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/nodeDefs-Zy145v5w.js 279 kB 279 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/OBJLoader2Worker-GDlTeC1j.js 4.69 kB 4.69 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetChart-dhwVJAgU.js 2.48 kB 2.48 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/WidgetImageCompare-C2io158s.js 3.18 kB 3.18 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B
assets/widgetPropFilter-BIbGSUAt.js 1.28 kB 1.28 kB ⚪ 0 B ⚪ 0 B ⚪ 0 B

Status: 20 added / 20 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: 3

🧹 Nitpick comments (8)
scripts/generate-template-scores.ts (3)

246-253: Handle edge case when correctedScores is empty.

If rawData is empty (which shouldn't happen given the earlier check in parseCSV, but could occur if computeNormalizedScores is called directly), Math.max(...correctedScores.map(...)) returns -Infinity, causing all normalized scores to become NaN.

Consider a defensive check:

   // Normalize to 0-1
   const maxScore = Math.max(...correctedScores.map((s) => s.score))
+  if (maxScore <= 0 || !Number.isFinite(maxScore)) {
+    console.warn('No valid scores to normalize')
+    return {}
+  }
   const normalized: Record<string, number> = {}

157-176: CSV parsing doesn't handle escaped quotes.

The parseCSVLine function doesn't handle RFC 4180-compliant escaped quotes (e.g., "value with ""escaped"" quotes"). This may cause parsing errors with template names containing quotes.

For a dev tool, this is likely acceptable. If robustness is needed later, consider using a CSV parsing library or handling doubled quotes:

   for (const char of line) {
-    if (char === '"' && !inQuotes) {
+    if (char === '"' && !inQuotes) {
       inQuotes = true
-    } else if (char === '"' && inQuotes) {
-      inQuotes = false
+    } else if (char === '"' && inQuotes) {
+      // Check for escaped quote ""
+      const nextIdx = line.indexOf(char) + 1
+      if (line[nextIdx] === '"') {
+        current += '"'
+        // Skip next quote (would need different iteration approach)
+      } else {
+        inQuotes = false
+      }

275-283: Minor: Negative count displayed when fewer than 20 scores.

In dry-run mode, if there are fewer than 20 templates, line 281 displays a negative number (e.g., "... and -5 more").

-    console.log(`  ... and ${Object.keys(usageScores).length - 20} more`)
+    const remaining = Object.keys(usageScores).length - 20
+    if (remaining > 0) {
+      console.log(`  ... and ${remaining} more`)
+    }
docs/TEMPLATE_RANKING.md (2)

22-24: Add language specifier to fenced code block.

Per markdownlint, fenced code blocks should have a language specified for proper rendering and syntax highlighting.

-```
+```text
 public/assets/template-usage-scores.json  # { "template_name": 0.95, ... } normalized 0-1
-```
+```

47-50: Add language specifier to fenced code block.

Same issue as above - add a language specifier for the formula block.

-```
+```text
 correction = 1 + (position - 1) / (maxPosition - 1)
 normalizedUsage = rawUsage × correction
-```
+```
tests-ui/stores/templateRankingStore.test.ts (1)

91-97: Test could be more meaningful.

This test calls computePopularScore twice with identical arguments and verifies they're equal, which is trivially true. Consider comparing against computeDefaultScore to demonstrate that popular truly ignores searchRank.

   describe('computePopularScore', () => {
     it('does not use searchRank', () => {
       const store = useTemplateRankingStore()
-      // Popular score ignores searchRank - just usage + freshness
-      const score1 = store.computePopularScore('template', '2024-01-01')
-      const score2 = store.computePopularScore('template', '2024-01-01')
-      expect(score1).toBe(score2)
+      // Popular score ignores searchRank - verify same result regardless of what
+      // searchRank would be if it were used
+      const popularScore = store.computePopularScore('template', '2024-01-01')
+      const defaultScoreLowRank = store.computeDefaultScore('template', '2024-01-01', 1)
+      const defaultScoreHighRank = store.computeDefaultScore('template', '2024-01-01', 10)
+      // Default scores differ due to searchRank, but popular is consistent
+      expect(defaultScoreHighRank).toBeGreaterThan(defaultScoreLowRank)
+      // Popular score should be deterministic (no searchRank influence)
+      expect(store.computePopularScore('template', '2024-01-01')).toBe(popularScore)
     })
src/stores/templateRankingStore.ts (1)

53-63: Consider documenting or clamping out-of-range searchRank values.

The normalization (searchRank ?? 5) / 10 allows values outside the documented 1-10 range (e.g., 0 or 15), resulting in scores outside 0-1. If this is intentional flexibility, add a comment; otherwise, consider clamping:

const internal = Math.max(0, Math.min(1, (searchRank ?? 5) / 10))
src/components/custom/widget/WorkflowTemplateSelectorDialog.vue (1)

649-658: Validate new sort options (default/popular) and i18n entries

The new sort options:

  • 'default't('templateWorkflows.sort.default', 'Recommended')
  • 'popular't('templateWorkflows.sort.popular', 'Popular')
  • 'newest' → unchanged but now listed after the new modes

Look good, but please double-check that:

  1. useTemplateFiltering (and any related telemetry) supports the new sortBy values 'default' and 'popular' consistently, including default initialization.
  2. The i18n keys templateWorkflows.sort.default and templateWorkflows.sort.popular are defined in src/locales/en/main.json so we don’t rely on the fallback English strings at runtime. As per coding guidelines, new user-facing strings should be registered in the locale JSON.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b50b34a and 9fab901.

📒 Files selected for processing (13)
  • docs/TEMPLATE_RANKING.md (1 hunks)
  • package.json (1 hunks)
  • public/assets/template-usage-scores.json (1 hunks)
  • scripts/generate-template-scores.ts (1 hunks)
  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue (4 hunks)
  • src/composables/useTemplateFiltering.ts (5 hunks)
  • src/locales/en/main.json (1 hunks)
  • src/platform/settings/constants/coreSettings.ts (1 hunks)
  • src/platform/telemetry/types.ts (1 hunks)
  • src/platform/workflow/templates/types/template.ts (1 hunks)
  • src/schemas/apiSchema.ts (1 hunks)
  • src/stores/templateRankingStore.ts (1 hunks)
  • tests-ui/stores/templateRankingStore.test.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (25)
**/*.{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/types/template.ts
  • src/platform/settings/constants/coreSettings.ts
  • tests-ui/stores/templateRankingStore.test.ts
  • src/platform/telemetry/types.ts
  • src/schemas/apiSchema.ts
  • src/stores/templateRankingStore.ts
  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
  • src/composables/useTemplateFiltering.ts
  • scripts/generate-template-scores.ts
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursorrules)

Use es-toolkit for utility functions

Files:

  • src/platform/workflow/templates/types/template.ts
  • src/platform/settings/constants/coreSettings.ts
  • tests-ui/stores/templateRankingStore.test.ts
  • src/platform/telemetry/types.ts
  • src/schemas/apiSchema.ts
  • src/stores/templateRankingStore.ts
  • src/composables/useTemplateFiltering.ts
  • scripts/generate-template-scores.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/types/template.ts
  • src/platform/settings/constants/coreSettings.ts
  • tests-ui/stores/templateRankingStore.test.ts
  • src/platform/telemetry/types.ts
  • src/schemas/apiSchema.ts
  • src/stores/templateRankingStore.ts
  • src/composables/useTemplateFiltering.ts
  • scripts/generate-template-scores.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/types/template.ts
  • src/platform/settings/constants/coreSettings.ts
  • tests-ui/stores/templateRankingStore.test.ts
  • src/platform/telemetry/types.ts
  • src/schemas/apiSchema.ts
  • src/stores/templateRankingStore.ts
  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
  • src/composables/useTemplateFiltering.ts
  • scripts/generate-template-scores.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/types/template.ts
  • src/platform/settings/constants/coreSettings.ts
  • src/platform/telemetry/types.ts
  • src/schemas/apiSchema.ts
  • src/stores/templateRankingStore.ts
  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
  • src/composables/useTemplateFiltering.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/types/template.ts
  • src/platform/settings/constants/coreSettings.ts
  • src/platform/telemetry/types.ts
  • src/schemas/apiSchema.ts
  • src/stores/templateRankingStore.ts
  • src/composables/useTemplateFiltering.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/types/template.ts
  • src/platform/settings/constants/coreSettings.ts
  • tests-ui/stores/templateRankingStore.test.ts
  • src/platform/telemetry/types.ts
  • src/schemas/apiSchema.ts
  • src/stores/templateRankingStore.ts
  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
  • src/composables/useTemplateFiltering.ts
  • scripts/generate-template-scores.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/types/template.ts
  • src/platform/settings/constants/coreSettings.ts
  • tests-ui/stores/templateRankingStore.test.ts
  • src/platform/telemetry/types.ts
  • src/schemas/apiSchema.ts
  • src/stores/templateRankingStore.ts
  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
  • src/composables/useTemplateFiltering.ts
  • scripts/generate-template-scores.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/types/template.ts
  • src/platform/settings/constants/coreSettings.ts
  • tests-ui/stores/templateRankingStore.test.ts
  • src/platform/telemetry/types.ts
  • src/schemas/apiSchema.ts
  • src/stores/templateRankingStore.ts
  • src/composables/useTemplateFiltering.ts
  • scripts/generate-template-scores.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/types/template.ts
  • src/platform/settings/constants/coreSettings.ts
  • src/platform/telemetry/types.ts
  • src/schemas/apiSchema.ts
  • src/stores/templateRankingStore.ts
  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
  • src/composables/useTemplateFiltering.ts
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/platform/workflow/templates/types/template.ts
  • src/platform/settings/constants/coreSettings.ts
  • src/platform/telemetry/types.ts
  • src/schemas/apiSchema.ts
  • src/stores/templateRankingStore.ts
  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
  • src/composables/useTemplateFiltering.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/stores/templateRankingStore.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/stores/templateRankingStore.test.ts
src/**/stores/**/*.{ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

src/**/stores/**/*.{ts,tsx}: Maintain clear public interfaces and restrict extension access in stores
Use TypeScript for type safety in state management stores

Files:

  • src/stores/templateRankingStore.ts
**/stores/*Store.ts

📄 CodeRabbit inference engine (AGENTS.md)

Name Pinia stores with the *Store.ts suffix

Files:

  • src/stores/templateRankingStore.ts
**/*.vue

📄 CodeRabbit inference engine (.cursorrules)

**/*.vue: Use setup() function for component logic in Vue 3 Composition API
Utilize ref and reactive for reactive state in Vue 3
Implement computed properties with computed() function
Use watch and watchEffect for side effects in Vue 3
Implement lifecycle hooks with onMounted, onUpdated, etc.
Utilize provide/inject for dependency injection in Vue 3
Use Vue 3.5 style of default prop declaration with defineProps()
Organize Vue components in <script> <style> order
Use Tailwind CSS for styling Vue components
Implement responsive design with Tailwind CSS
Do not use deprecated PrimeVue components (Dropdown, OverlayPanel, Calendar, InputSwitch, Sidebar, Chips, TabMenu, Steps, InlineMessage). Use replacements: Select, Popover, DatePicker, ToggleSwitch, Drawer, AutoComplete, Tabs, Stepper, Message respectively
Implement proper props and emits definitions in Vue components
Utilize Vue 3's Teleport component when needed
Use Suspense for async components in Vue 3
Follow Vue 3 style guide and naming conventions
Never use deprecated PrimeVue components (Dropdown, OverlayPanel, Calendar, InputSwitch, Sidebar, Chips, TabMenu, Steps, InlineMessage)

Never use :class="[]" to merge class names - always use import { cn } from '@/utils/tailwindUtil' for class merging in Vue templates

**/*.vue: Use TypeScript with Vue 3 Single File Components (.vue files)
Name Vue components in PascalCase (e.g., MenuHamburger.vue)

Files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
src/**/*.vue

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

src/**/*.vue: Use the Vue 3 Composition API instead of the Options API when writing Vue components (exception: when overriding or extending PrimeVue components for compatibility)
Use setup() function for component logic
Utilize ref and reactive for reactive state
Implement computed properties with computed()
Use watch and watchEffect for side effects
Implement lifecycle hooks with onMounted, onUpdated, etc.
Utilize provide/inject for dependency injection
Use vue 3.5 style of default prop declaration
Use Tailwind CSS for styling
Implement proper props and emits definitions
Utilize Vue 3's Teleport component when needed
Use Suspense for async components
Follow Vue 3 style guide and naming conventions

Files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
**/*.{vue,html}

📄 CodeRabbit inference engine (CLAUDE.md)

Never use dark: or dark-theme: Tailwind variants - instead use semantic values from style.css theme, e.g. bg-node-component-surface

Files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
src/**/{composables,components}/**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Clean up subscriptions in state management to prevent memory leaks

Files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
  • src/composables/useTemplateFiltering.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/components/custom/widget/WorkflowTemplateSelectorDialog.vue
  • src/composables/useTemplateFiltering.ts
src/components/**/*.vue

📄 CodeRabbit inference engine (src/components/CLAUDE.md)

src/components/**/*.vue: Use setup() function in Vue 3 Composition API
Destructure props using Vue 3.5 style in Vue components
Use ref/reactive for state management in Vue 3 Composition API
Implement computed() for derived state in Vue 3 Composition API
Use provide/inject for dependency injection in Vue components
Prefer emit/@event-name for state changes over other communication patterns
Use defineExpose only for imperative operations (such as form.validate(), modal.open())
Replace PrimeVue Dropdown component with Select
Replace PrimeVue OverlayPanel component with Popover
Replace PrimeVue Calendar component with DatePicker
Replace PrimeVue InputSwitch component with ToggleSwitch
Replace PrimeVue Sidebar component with Drawer
Replace PrimeVue Chips component with AutoComplete with multiple enabled
Replace PrimeVue TabMenu component with Tabs without panels
Replace PrimeVue Steps component with Stepper without panels
Replace PrimeVue InlineMessage component with Message
Extract complex conditionals to computed properties
Implement cleanup for async operations in Vue components
Use lifecycle hooks: onMounted, onUpdated in Vue 3 Composition API
Use Teleport/Suspense when needed for component rendering
Define proper props and emits definitions in Vue components

Files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
src/components/**/*.{vue,css}

📄 CodeRabbit inference engine (src/components/CLAUDE.md)

src/components/**/*.{vue,css}: Use Tailwind CSS only for styling (no custom CSS)
Use the correct tokens from style.css in the design system package

Files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
src/components/**/*.{vue,ts,js}

📄 CodeRabbit inference engine (src/components/CLAUDE.md)

src/components/**/*.{vue,ts,js}: Use existing VueUse composables (such as useElementHover) instead of manually managing event listeners
Use useIntersectionObserver for visibility detection instead of custom scroll handlers
Use vue-i18n for ALL UI strings

Files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
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/composables/useTemplateFiltering.ts
**/composables/use*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Name composables in the format useXyz.ts

Files:

  • src/composables/useTemplateFiltering.ts
🧠 Learnings (16)
📚 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,js} : Use es-toolkit for utility functions

Applied to files:

  • package.json
📚 Learning: 2025-11-24T19:48:23.088Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Applies to **/*.{ts,tsx,js,vue} : Use 2-space indentation, single quotes, no semicolons, and maintain 80-character line width as configured in `.prettierrc`

Applied to files:

  • package.json
📚 Learning: 2025-11-24T19:48:23.088Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Applies to **/*.{ts,tsx,js,vue} : Organize imports by sorting and grouping by plugin, and run `pnpm format` before committing

Applied to files:

  • package.json
📚 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/**/*.{js,ts,jsx,tsx} : Run ESLint instead of manually figuring out whitespace fixes or other trivial style concerns using the `pnpm lint:fix` command

Applied to files:

  • package.json
📚 Learning: 2025-11-24T19:48:23.088Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Applies to **/*.{ts,tsx,vue} : Enforce ESLint rules for Vue + TypeScript including: no floating promises, no unused imports, and i18n raw text restrictions in templates

Applied to files:

  • package.json
📚 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 `await settingStore.set('Comfy.SomeSetting', newValue)` to update settings in TypeScript/Vue files

Applied to files:

  • src/platform/settings/constants/coreSettings.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} : Write tests for new features

Applied to files:

  • tests-ui/stores/templateRankingStore.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/stores/templateRankingStore.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/stores/templateRankingStore.test.ts
📚 Learning: 2025-11-24T19:48:23.088Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Applies to **/stores/*Store.ts : Name Pinia stores with the `*Store.ts` suffix

Applied to files:

  • tests-ui/stores/templateRankingStore.test.ts
  • src/stores/templateRankingStore.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/stores/templateRankingStore.test.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/**/*.{test,spec}.{ts,tsx} : Use provided test helpers `createTestSubgraph` and `createTestSubgraphNode` from `./fixtures/subgraphHelpers` for consistent subgraph test setup

Applied to files:

  • tests-ui/stores/templateRankingStore.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/**/stores/**/*.{ts,tsx} : Maintain clear public interfaces and restrict extension access in stores

Applied to files:

  • tests-ui/stores/templateRankingStore.test.ts
  • src/stores/templateRankingStore.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/stores/templateRankingStore.test.ts
📚 Learning: 2025-11-24T19:48:23.088Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Use Vitest (with happy-dom) for unit and component tests, and Playwright for E2E tests

Applied to files:

  • tests-ui/stores/templateRankingStore.test.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/stores/templateRankingStore.ts
  • src/composables/useTemplateFiltering.ts
🧬 Code graph analysis (3)
tests-ui/stores/templateRankingStore.test.ts (1)
src/stores/templateRankingStore.ts (1)
  • useTemplateRankingStore (12-87)
src/composables/useTemplateFiltering.ts (2)
src/platform/workflow/templates/types/template.ts (1)
  • TemplateInfo (1-40)
src/stores/templateRankingStore.ts (1)
  • useTemplateRankingStore (12-87)
scripts/generate-template-scores.ts (1)
src/platform/workflow/templates/types/template.ts (2)
  • TemplateInfo (1-40)
  • WorkflowTemplates (42-51)
🪛 ESLint
tests-ui/stores/templateRankingStore.test.ts

[error] 1-1: Resolve error: EACCES: permission denied, open '/fPPvRFUvUi'
at Object.writeFileSync (node:fs:2409:20)
at l (file:///home/jailuser/git/node_modules/.pnpm/get-tsconfig@4.10.1/node_modules/get-tsconfig/dist/index.mjs:7:13670)
at createFilesMatcher (file:///home/jailuser/git/node_modules/.pnpm/get-tsconfig@4.10.1/node_modules/get-tsconfig/dist/index.mjs:7:14422)
at resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-import-resolver-typescript@4.4.4_eslint-plugin-import-x@4.16.1_@typescript-eslin_da4796079dab5a32abf73f9910d12370/node_modules/eslint-import-resolver-typescript/lib/index.js:70:65)
at Object.resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-import-resolver-typescript@4.4.4_eslint-plugin-import-x@4.16.1_@typescript-eslin_da4796079dab5a32abf73f9910d12370/node_modules/eslint-import-resolver-typescript/lib/index.js:147:20)
at file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:170:69
at setRuleContext (/home/jailuser/git/node_modules/.pnpm/eslint-import-context@0.1.9_unrs-resolver@1.11.1/node_modules/eslint-import-context/lib/index.js:23:20)
at fullResolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:170:30)
at relative (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:215:12)
at resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:220:16)

(import-x/namespace)


[error] 1-1: Resolve error: EACCES: permission denied, open '/slcyuLISSN'
at Object.writeFileSync (node:fs:2409:20)
at l (file:///home/jailuser/git/node_modules/.pnpm/get-tsconfig@4.10.1/node_modules/get-tsconfig/dist/index.mjs:7:13670)
at createFilesMatcher (file:///home/jailuser/git/node_modules/.pnpm/get-tsconfig@4.10.1/node_modules/get-tsconfig/dist/index.mjs:7:14422)
at resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-import-resolver-typescript@4.4.4_eslint-plugin-import-x@4.16.1_@typescript-eslin_da4796079dab5a32abf73f9910d12370/node_modules/eslint-import-resolver-typescript/lib/index.js:70:65)
at Object.resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-import-resolver-typescript@4.4.4_eslint-plugin-import-x@4.16.1_@typescript-eslin_da4796079dab5a32abf73f9910d12370/node_modules/eslint-import-resolver-typescript/lib/index.js:147:20)
at file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:170:69
at setRuleContext (/home/jailuser/git/node_modules/.pnpm/eslint-import-context@0.1.9_unrs-resolver@1.11.1/node_modules/eslint-import-context/lib/index.js:23:20)
at fullResolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:170:30)
at relative (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:215:12)
at resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:220:16)

(import-x/no-unresolved)


[error] 1-1: Resolve error: EACCES: permission denied, open '/DVbwyMrubx'
at Object.writeFileSync (node:fs:2409:20)
at l (file:///home/jailuser/git/node_modules/.pnpm/get-tsconfig@4.10.1/node_modules/get-tsconfig/dist/index.mjs:7:13670)
at createFilesMatcher (file:///home/jailuser/git/node_modules/.pnpm/get-tsconfig@4.10.1/node_modules/get-tsconfig/dist/index.mjs:7:14422)
at resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-import-resolver-typescript@4.4.4_eslint-plugin-import-x@4.16.1_@typescript-eslin_da4796079dab5a32abf73f9910d12370/node_modules/eslint-import-resolver-typescript/lib/index.js:70:65)
at Object.resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-import-resolver-typescript@4.4.4_eslint-plugin-import-x@4.16.1_@typescript-eslin_da4796079dab5a32abf73f9910d12370/node_modules/eslint-import-resolver-typescript/lib/index.js:147:20)
at file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:170:69
at setRuleContext (/home/jailuser/git/node_modules/.pnpm/eslint-import-context@0.1.9_unrs-resolver@1.11.1/node_modules/eslint-import-context/lib/index.js:23:20)
at fullResolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:170:30)
at relative (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:215:12)
at resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:220:16)

(import-x/no-relative-packages)


[error] 1-1: Unable to resolve path to module 'pinia'.

(import-x/no-unresolved)


[error] 2-2: Unable to resolve path to module 'vitest'.

(import-x/no-unresolved)


[error] 4-4: Unable to resolve path to module '@/stores/templateRankingStore'.

(import-x/no-unresolved)

src/stores/templateRankingStore.ts

[error] 1-1: Resolve error: EACCES: permission denied, open '/isJetaxmCl'
at Object.writeFileSync (node:fs:2409:20)
at l (file:///home/jailuser/git/node_modules/.pnpm/get-tsconfig@4.10.1/node_modules/get-tsconfig/dist/index.mjs:7:13670)
at createFilesMatcher (file:///home/jailuser/git/node_modules/.pnpm/get-tsconfig@4.10.1/node_modules/get-tsconfig/dist/index.mjs:7:14422)
at resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-import-resolver-typescript@4.4.4_eslint-plugin-import-x@4.16.1_@typescript-eslin_da4796079dab5a32abf73f9910d12370/node_modules/eslint-import-resolver-typescript/lib/index.js:70:65)
at Object.resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-import-resolver-typescript@4.4.4_eslint-plugin-import-x@4.16.1_@typescript-eslin_da4796079dab5a32abf73f9910d12370/node_modules/eslint-import-resolver-typescript/lib/index.js:147:20)
at file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:170:69
at setRuleContext (/home/jailuser/git/node_modules/.pnpm/eslint-import-context@0.1.9_unrs-resolver@1.11.1/node_modules/eslint-import-context/lib/index.js:23:20)
at fullResolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:170:30)
at relative (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:215:12)
at resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:220:16)
at ExportMap.get (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:88:22)
at processBodyStatement (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/rules/namespace.js:9:31)
at Program (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/rules/namespace.js:100:21)
at ruleErrorHandler (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:1173:33)
at /home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/source-code-visitor.js:76:46
at Array.forEach ()
at SourceCodeVisitor.callSync (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/source-code-visitor.js:76:30)
at /home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/source-code-traverser.js:291:18
at Array.forEach ()
at SourceCodeTraverser.traverseSync (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/source-code-traverser.js:290:10)
at runRules (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:1214:12)
at #flatVerifyWithoutProcessors (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:2101:4)
at Linter._verifyWithFlatConfigArrayAndWithoutProcessors (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:2189:43)
at Linter._verifyWithFlatConfigArray (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:2292:15)
at Linter.verify (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:1677:10)
at Linter.verifyAndFix (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:2557:20)
at verifyText (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/eslint/eslint-helpers.js:1179:45)
at readAndVerifyFile (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/eslint/eslint-helpers.js:1320:10)

(import-x/namespace)


[error] 1-1: Resolve error: EACCES: permission denied, open '/qdlfAaOIvB'
at Object.writeFileSync (node:fs:2409:20)
at l (file:///home/jailuser/git/node_modules/.pnpm/get-tsconfig@4.10.1/node_modules/get-tsconfig/dist/index.mjs:7:13670)
at createFilesMatcher (file:///home/jailuser/git/node_modules/.pnpm/get-tsconfig@4.10.1/node_modules/get-tsconfig/dist/index.mjs:7:14422)
at resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-import-resolver-typescript@4.4.4_eslint-plugin-import-x@4.16.1_@typescript-eslin_da4796079dab5a32abf73f9910d12370/node_modules/eslint-import-resolver-typescript/lib/index.js:70:65)
at Object.resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-import-resolver-typescript@4.4.4_eslint-plugin-import-x@4.16.1_@typescript-eslin_da4796079dab5a32abf73f9910d12370/node_modules/eslint-import-resolver-typescript/lib/index.js:147:20)
at file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:170:69
at setRuleContext (/home/jailuser/git/node_modules/.pnpm/eslint-import-context@0.1.9_unrs-resolver@1.11.1/node_modules/eslint-import-context/lib/index.js:23:20)
at fullResolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:170:30)
at relative (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:215:12)
at resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:220:16)
at checkSourceValue (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/rules/no-unresolved.js:31:34)
at checkSourceValue (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/module-visitor.js:14:9)
at checkSource (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/module-visitor.js:17:9)
at ruleErrorHandler (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:1173:33)
at /home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/source-code-visitor.js:76:46
at Array.forEach ()
at SourceCodeVisitor.callSync (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/source-code-visitor.js:76:30)
at /home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/source-code-traverser.js:291:18
at Array.forEach ()
at SourceCodeTraverser.traverseSync (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/source-code-traverser.js:290:10)
at runRules (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:1214:12)
at #flatVerifyWithoutProcessors (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:2101:4)
at Linter._verifyWithFlatConfigArrayAndWithoutProcessors (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:2189:43)
at Linter._verifyWithFlatConfigArray (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:2292:15)
at Linter.verify (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:1677:10)
at Linter.verifyAndFix (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:2557:20)
at verifyText (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/eslint/eslint-helpers.js:1179:45)
at readAndVerifyFile (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/eslint/eslint-helpers.js:1320:10)

(import-x/no-unresolved)


[error] 1-1: Resolve error: EACCES: permission denied, open '/RqqBNdcyHj'
at Object.writeFileSync (node:fs:2409:20)
at l (file:///home/jailuser/git/node_modules/.pnpm/get-tsconfig@4.10.1/node_modules/get-tsconfig/dist/index.mjs:7:13670)
at createFilesMatcher (file:///home/jailuser/git/node_modules/.pnpm/get-tsconfig@4.10.1/node_modules/get-tsconfig/dist/index.mjs:7:14422)
at resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-import-resolver-typescript@4.4.4_eslint-plugin-import-x@4.16.1_@typescript-eslin_da4796079dab5a32abf73f9910d12370/node_modules/eslint-import-resolver-typescript/lib/index.js:70:65)
at Object.resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-import-resolver-typescript@4.4.4_eslint-plugin-import-x@4.16.1_@typescript-eslin_da4796079dab5a32abf73f9910d12370/node_modules/eslint-import-resolver-typescript/lib/index.js:147:20)
at file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:170:69
at setRuleContext (/home/jailuser/git/node_modules/.pnpm/eslint-import-context@0.1.9_unrs-resolver@1.11.1/node_modules/eslint-import-context/lib/index.js:23:20)
at fullResolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:170:30)
at relative (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:215:12)
at resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:220:16)
at ExportMap.get (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/export-map.js:88:22)
at checkDefault (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/rules/default.js:22:39)
at ruleErrorHandler (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:1173:33)
at /home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/source-code-visitor.js:76:46
at Array.forEach ()
at SourceCodeVisitor.callSync (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/source-code-visitor.js:76:30)
at /home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/source-code-traverser.js:291:18
at Array.forEach ()
at SourceCodeTraverser.traverseSync (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/source-code-traverser.js:290:10)
at runRules (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:1214:12)
at #flatVerifyWithoutProcessors (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:2101:4)
at Linter._verifyWithFlatConfigArrayAndWithoutProcessors (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:2189:43)
at Linter._verifyWithFlatConfigArray (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:2292:15)
at Linter.verify (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:1677:10)
at Linter.verifyAndFix (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:2557:20)
at verifyText (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/eslint/eslint-helpers.js:1179:45)
at readAndVerifyFile (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/eslint/eslint-helpers.js:1320:10)

(import-x/default)


[error] 1-1: Resolve error: EACCES: permission denied, open '/JtSqhijzTP'
at Object.writeFileSync (node:fs:2409:20)
at l (file:///home/jailuser/git/node_modules/.pnpm/get-tsconfig@4.10.1/node_modules/get-tsconfig/dist/index.mjs:7:13670)
at createFilesMatcher (file:///home/jailuser/git/node_modules/.pnpm/get-tsconfig@4.10.1/node_modules/get-tsconfig/dist/index.mjs:7:14422)
at resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-import-resolver-typescript@4.4.4_eslint-plugin-import-x@4.16.1_@typescript-eslin_da4796079dab5a32abf73f9910d12370/node_modules/eslint-import-resolver-typescript/lib/index.js:70:65)
at Object.resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-import-resolver-typescript@4.4.4_eslint-plugin-import-x@4.16.1_@typescript-eslin_da4796079dab5a32abf73f9910d12370/node_modules/eslint-import-resolver-typescript/lib/index.js:147:20)
at file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:170:69
at setRuleContext (/home/jailuser/git/node_modules/.pnpm/eslint-import-context@0.1.9_unrs-resolver@1.11.1/node_modules/eslint-import-context/lib/index.js:23:20)
at fullResolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:170:30)
at relative (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:215:12)
at resolve (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/resolve.js:220:16)
at importType (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/import-type.js:126:63)
at checkImportForRelativePackage (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/rules/no-relative-packages.js:15:38)
at file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/rules/no-relative-packages.js:59:40
at checkSourceValue (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/module-visitor.js:14:9)
at checkSource (file:///home/jailuser/git/node_modules/.pnpm/eslint-plugin-import-x@4.16.1_@typescript-eslint+utils@8.44.0_eslint@9.35.0_jiti@2.5.1__d4b6b79e6f12f59d34d55ebbf27dc73f/node_modules/eslint-plugin-import-x/lib/utils/module-visitor.js:17:9)
at ruleErrorHandler (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:1173:33)
at /home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/source-code-visitor.js:76:46
at Array.forEach ()
at SourceCodeVisitor.callSync (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/source-code-visitor.js:76:30)
at /home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/source-code-traverser.js:291:18
at Array.forEach ()
at SourceCodeTraverser.traverseSync (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/source-code-traverser.js:290:10)
at runRules (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:1214:12)
at #flatVerifyWithoutProcessors (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:2101:4)
at Linter._verifyWithFlatConfigArrayAndWithoutProcessors (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:2189:43)
at Linter._verifyWithFlatConfigArray (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:2292:15)
at Linter.verify (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:1677:10)
at Linter.verifyAndFix (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/linter/linter.js:2557:20)
at verifyText (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/eslint/eslint-helpers.js:1179:45)
at readAndVerifyFile (/home/jailuser/git/node_modules/.pnpm/eslint@9.35.0_jiti@2.5.1/node_modules/eslint/lib/eslint/eslint-helpers.js:1320:10)

(import-x/no-relative-packages)


[error] 8-8: Unable to resolve path to module 'axios'.

(import-x/no-unresolved)


[error] 9-9: Unable to resolve path to module 'pinia'.

(import-x/no-unresolved)


[error] 10-10: Unable to resolve path to module 'vue'.

(import-x/no-unresolved)

src/components/custom/widget/WorkflowTemplateSelectorDialog.vue

[error] 408-408: Unable to resolve path to module '@/stores/templateRankingStore'.

(import-x/no-unresolved)

src/composables/useTemplateFiltering.ts

[error] 9-9: Unable to resolve path to module '@/stores/templateRankingStore'.

(import-x/no-unresolved)


[error] 10-10: Unable to resolve path to module 'es-toolkit/compat'.

(import-x/no-unresolved)

🪛 markdownlint-cli2 (0.18.1)
docs/TEMPLATE_RANKING.md

22-22: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


47-47: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ 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: setup
  • GitHub Check: lint-and-format
  • GitHub Check: test
  • GitHub Check: collect
🔇 Additional comments (17)
package.json (1)

28-28: LGTM!

The new script follows the existing pattern of using tsx to run TypeScript scripts directly, consistent with other scripts like json-schema.

src/schemas/apiSchema.ts (1)

514-521: LGTM!

The enum additions for 'popular' and 'model-size-low-to-high' sort options are well-placed and align with the new ranking-based sorting feature. The schema correctly reflects the expanded sort options used by the UI and ranking logic.

src/platform/workflow/templates/types/template.ts (1)

35-39: LGTM!

The searchRank property is well-documented with clear scale semantics (1-10, default 5). The optional typing is appropriate since not all templates will have manual ranking overrides.

scripts/generate-template-scores.ts (1)

178-209: LGTM!

The loadUIOrder function handles both local file and remote GitHub fetch cleanly, with proper error handling for HTTP failures. Supporting both WorkflowTemplates[] and { modules: [...] } formats provides good flexibility.

src/platform/settings/constants/coreSettings.ts (1)

1079-1084: LGTM! Default sort changed to "Recommended".

The default value change from 'newest' to 'default' (which maps to "Recommended" in the UI) aligns with the PR objectives. Existing users who have previously saved a preference will retain their choice since this only affects the initial default.

src/locales/en/main.json (1)

853-859: LGTM!

The new "popular" sort option and the renaming of "default" to "Recommended" are consistent with the PR objectives. The labels clearly communicate the sorting behavior to users.

public/assets/template-usage-scores.json (1)

1-188: LGTM!

The pre-computed usage scores are properly normalized (0-1 range) and structured as expected by templateRankingStore. The data aligns with the documented position bias correction methodology.

src/platform/telemetry/types.ts (1)

196-203: LGTM!

The sort_by union type correctly includes the new 'popular' option, maintaining type safety for telemetry tracking.

docs/TEMPLATE_RANKING.md (1)

1-95: Documentation is comprehensive and well-structured.

The ranking system documentation clearly explains the formulas, data files, position bias correction, and update workflow. This will help future maintainers understand and update the ranking system.

tests-ui/stores/templateRankingStore.test.ts (2)

122-127: Consider adding a note about unclamped searchRank behavior.

The test documents that values above 10 aren't clamped. If this is intentional (allowing power users to boost templates beyond the documented scale), consider adding a comment in the store. If unintentional, the store should clamp values to 1-10.


1-136: Good test coverage for the new ranking store.

The tests comprehensively cover freshness calculations, default/popular scoring, usage score retrieval, and edge cases. Following learnings, the tests use Vitest mocks appropriately and follow existing patterns.

src/stores/templateRankingStore.ts (2)

1-87: Well-structured Pinia store with clear public interface.

The store follows project conventions (naming, TypeScript types, composition API pattern). The scoring functions are well-documented with formulas matching the documentation.


19-26: Use api.fileURL() for static asset access.

Replace the direct URL string with api.fileURL('assets/template-usage-scores.json') to ensure assets resolve correctly across all deployment contexts. This aligns with the pattern used throughout the codebase in services and composables for static file access.

    try {
      const response = await axios.get(api.fileURL('assets/template-usage-scores.json'))
      usageScores.value = response.data
      isLoaded.value = true
    } catch (error) {
      console.error('Error loading template ranking scores:', error)
    }
  }
⛔ Skipped due to learnings
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T19:48:23.088Z
Learning: Applies to **/stores/*Store.ts : Name Pinia stores with the `*Store.ts` suffix
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/**/stores/**/*.{ts,tsx} : Maintain clear public interfaces and restrict extension access in stores
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
src/composables/useTemplateFiltering.ts (4)

161-182: LGTM!

The new 'default' and 'popular' sort cases correctly integrate with the ranking store, using computeDefaultScore and computePopularScore respectively. The descending sort order (scoreB - scoreA) correctly ranks higher scores first.


212-212: Good improvement - removed implicit any.

Removing the explicit (a: any, b: any) type annotation improves type safety. TypeScript will now correctly infer TemplateInfo types for the sort callback parameters.


232-232: Default sort reset aligns with new "Recommended" behavior.

Changing resetFilters to set sortBy.value = 'default' is consistent with making "Recommended" the default sorting mode.


16-16: Verify loadScores() is called before filtering.

The composable uses rankingStore but doesn't call loadScores(). Ensure the scores are loaded before this composable computes sorted templates, otherwise all usage scores will be 0.

Comment on lines 56 to 78
for (let i = 0; i < args.length; i++) {
const arg = args[i]
switch (arg) {
case '--input':
case '-i':
config.inputPath = args[++i]
break
case '--ui-order':
case '-u':
config.uiOrderPath = args[++i]
break
case '--output':
case '-o':
config.outputDir = args[++i]
break
case '--dry-run':
config.dryRun = true
break
case '--help':
case '-h':
printHelp()
process.exit(0)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Missing bounds check when accessing argument values.

When parsing --input, --ui-order, or --output, the code increments i and accesses args[i] without verifying the value exists. If a user runs pnpm generate:template-scores --input without a path, this returns undefined silently.

Consider adding validation:

       case '--input':
       case '-i':
+        if (!args[i + 1] || args[i + 1].startsWith('-')) {
+          console.error('Error: --input requires a path argument')
+          process.exit(1)
+        }
         config.inputPath = args[++i]
         break
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for (let i = 0; i < args.length; i++) {
const arg = args[i]
switch (arg) {
case '--input':
case '-i':
config.inputPath = args[++i]
break
case '--ui-order':
case '-u':
config.uiOrderPath = args[++i]
break
case '--output':
case '-o':
config.outputDir = args[++i]
break
case '--dry-run':
config.dryRun = true
break
case '--help':
case '-h':
printHelp()
process.exit(0)
}
for (let i = 0; i < args.length; i++) {
const arg = args[i]
switch (arg) {
case '--input':
case '-i':
if (!args[i + 1] || args[i + 1].startsWith('-')) {
console.error('Error: --input requires a path argument')
process.exit(1)
}
config.inputPath = args[++i]
break
case '--ui-order':
case '-u':
config.uiOrderPath = args[++i]
break
case '--output':
case '-o':
config.outputDir = args[++i]
break
case '--dry-run':
config.dryRun = true
break
case '--help':
case '-h':
printHelp()
process.exit(0)
}
🤖 Prompt for AI Agents
In scripts/generate-template-scores.ts around lines 56 to 78, the switch
increments i and reads args[i] for --input, --ui-order and --output without
checking bounds; add a check after incrementing (or before assigning) to ensure
args[i] exists and is not an empty string, and if missing log a clear error
(include which flag is missing its value) and exit with a non‑zero code (or call
printHelp()) so the script doesn't silently set undefined; update tests or usage
message accordingly.

Comment on lines 215 to 222
function computePositionCorrection(
position: number,
maxPosition: number
): number {
// Linear interpolation: position 1 = 1.0×, position max = 2.0×
// Buried templates get proportionally stronger boost
return 1 + (position - 1) / (maxPosition - 1)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Potential division by zero when maxPosition is 1.

If there's only one template in the UI order, maxPosition - 1 equals zero, causing division by zero.

Consider adding a guard:

 function computePositionCorrection(
   position: number,
   maxPosition: number
 ): number {
   // Linear interpolation: position 1 = 1.0×, position max = 2.0×
   // Buried templates get proportionally stronger boost
+  if (maxPosition <= 1) return 1
   return 1 + (position - 1) / (maxPosition - 1)
 }
🤖 Prompt for AI Agents
In scripts/generate-template-scores.ts around lines 215 to 222,
computePositionCorrection divides by (maxPosition - 1) which will be zero when
maxPosition is 1; add a guard at the top that returns 1 (no boost) when
maxPosition <= 1 (or when maxPosition - 1 === 0) to avoid the division by zero,
otherwise proceed with the existing linear interpolation; ensure the function
signature and any callers still expect a number and update any unit tests if
present.

import { useTemplateWorkflows } from '@/platform/workflow/templates/composables/useTemplateWorkflows'
import { useWorkflowTemplatesStore } from '@/platform/workflow/templates/repositories/workflowTemplatesStore'
import type { TemplateInfo } from '@/platform/workflow/templates/types/template'
import { useTemplateRankingStore } from '@/stores/templateRankingStore'
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix unresolved useTemplateRankingStore import and consider robustness of loadScores

  • ESLint reports import-x/no-unresolved on @/stores/templateRankingStore. That will break lint/build. Please verify the store file path (e.g. src/stores/templateRankingStore.ts) and either:
    • Adjust the import to match the actual location/name, or
    • Move/rename the store file so it matches this path.
  • templateRankingStore.loadScores() is now part of the Promise.all in useAsyncState. If score loading is non-critical for showing the dialog, consider making this more defensive so a failure to fetch ranking data doesn’t block the whole template selector (e.g. wrap loadScores in an internal try/catch or switch to Promise.allSettled and only treat template-loading failures as fatal).

Also applies to: 447-447, 759-764

🧰 Tools
🪛 ESLint

[error] 408-408: Unable to resolve path to module '@/stores/templateRankingStore'.

(import-x/no-unresolved)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd like this to rather be a github workflow on the templates repo and the usage scores to also come from there.
If we want to have it here, then it will be nice to have this workflow communicate with mixpanel on some regular basis and update the json like we have with snapshots

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, good point - most of this should go in Comfy-Org/workflow_templates

@christian-byrne christian-byrne marked this pull request as draft December 1, 2025 22:28
@socket-security
Copy link

socket-security bot commented Dec 24, 2025

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

@Yourz Yourz force-pushed the templates/usage-based-ordering branch 3 times, most recently from 282136a to b236a80 Compare December 29, 2025 16:16
@Yourz Yourz changed the title feat: usage-based template ordering feat: New Template Library Dec 29, 2025
@Yourz Yourz marked this pull request as ready for review December 29, 2025 16:27
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: 3

📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9fab901 and b236a80.

📒 Files selected for processing (1)
  • docs/TEMPLATE_RANKING.md
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
docs/TEMPLATE_RANKING.md

22-22: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


47-47: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (1)
docs/TEMPLATE_RANKING.md (1)

1-95: Overall documentation quality is strong.

The documentation clearly explains the ranking system, formulas, data sources, position bias correction, and update workflow. It aligns well with the PR objectives and provides actionable guidance for updating scores. The structure is logical and easy to follow.


| Mode | Formula | Description |
| -------------- | ------------------------------------------------ | ---------------------- |
| `default` | `usage × 0.5 + internal × 0.3 + freshness × 0.2` | Curated recommendation |
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Clarify terminology for consistency with data files section.

Line 11 uses "internal" to describe the formula parameter, but the "Data Files" section (line 26 onwards) refers to this as "searchRank". For clarity and consistency, update the formula column to use "searchRank" instead of "internal".

🔎 Proposed fix
-| `default`      | `usage × 0.5 + internal × 0.3 + freshness × 0.2` | Curated recommendation |
+| `default`      | `usage × 0.5 + searchRank × 0.3 + freshness × 0.2` | Curated recommendation |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| `default` | `usage × 0.5 + internal × 0.3 + freshness × 0.2` | Curated recommendation |
| `default` | `usage × 0.5 + searchRank × 0.3 + freshness × 0.2` | Curated recommendation |
🤖 Prompt for AI Agents
In docs/TEMPLATE_RANKING.md around line 11, the formula column uses the term
"internal" while the Data Files section uses "searchRank"; update the formula to
replace "internal" with "searchRank" so the row reads `usage × 0.5 + searchRank
× 0.3 + freshness × 0.2`, ensuring terminology is consistent across the
document.

@benceruleanlu
Copy link
Member

@christian-byrne are you peer programming this out with @Yourz? If not I will review this later today

@christian-byrne
Copy link
Contributor Author

@christian-byrne are you peer programming this out with @Yourz? If not I will review this later today

No I am not, please review

@comfyui-wiki
Copy link
Member

@Yourz synced with me during the update, and at least these changes meet the PRD requirements.

@comfyui-wiki
Copy link
Member

Oh, wait. The default sorting has been affected.

This PR

image image

Previous

image image

It seems this branch is outdated when updating. The recommended should be default, and the default ordering has been changed in this PR.

image

@Yourz
Copy link
Collaborator

Yourz commented Dec 31, 2025

@christian-byrne are you peer programming this out with @Yourz? If not I will review this later today

Not exactly peer programming.

@dosubot dosubot bot removed the size:XL This PR changes 500-999 lines, ignoring generated files. label Dec 31, 2025
Myestery
Myestery previously approved these changes Jan 5, 2026
Copy link
Collaborator

@Myestery Myestery left a comment

Choose a reason for hiding this comment

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

Overall logic Looks good to me
I like the way popularity and freshness were calculated

export const useTemplateRankingStore = defineStore('templateRanking', () => {
const largestUsageScore = ref<number>()

const normalizeUsageScore = (usage: number): number => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

usage here could be undefined as per api spec

Copy link
Collaborator

Choose a reason for hiding this comment

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

normalizeUsageScore are only used at computeDefaultScore and computePopularScore function in templateRankingScore.ts, and they both passed 0 when the usage is undefined to normalizeUsageScore

@christian-byrne
Copy link
Contributor Author

@Yourz Can you help updating this Playwright test? Might need to just the conditions https://2040cb51.comfyui-playwright-chromium.pages.dev/#?testId=35f0453d615a452757ca-f5a1a01280744a8a5cd7

christian-byrne and others added 11 commits January 6, 2026 18:36
Add usage-based ordering to workflow templates with position bias
correction, manual ranking (searchRank), and freshness boost.

New sort modes:
- "Recommended" (default): usage × 0.5 + searchRank × 0.3 + freshness × 0.2
- "Popular": usage × 0.9 + freshness × 0.1

Includes generation script for refreshing scores from Mixpanel data.
@Yourz Yourz force-pushed the templates/usage-based-ordering branch from 2e9f0cb to 9c1fe8c Compare January 6, 2026 11:41
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

🤖 Fix all issues with AI Agents
In @src/composables/useTemplateFiltering.test.ts:
- Around line 23-29: The tests currently mock defaultRankingStore with identical
scores so sorting behavior for 'recommended' and 'popular' isn't validated;
update the test suite in useTemplateFiltering.test.ts to add cases that set
computeDefaultScore and computePopularScore (and/or
getUsageScore/computeFreshness) to return different values per template, then
assert that sortTemplates (or the hook using sortMode 'recommended' and
'popular') orders templates accordingly; target the defaultRankingStore mock
object and the functions computeDefaultScore, computePopularScore,
getUsageScore, and computeFreshness to simulate distinct scores and add
assertions for expected ordering.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 189e0e9 and 9c1fe8c.

📒 Files selected for processing (5)
  • docs/TEMPLATE_RANKING.md
  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
  • src/composables/useTemplateFiltering.test.ts
  • src/composables/useTemplateFiltering.ts
  • src/locales/en/main.json
🧰 Additional context used
📓 Path-based instructions (17)
**/*.{ts,tsx,vue,js,jsx,json,css}

📄 CodeRabbit inference engine (AGENTS.md)

Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, and 80-character line width

Files:

  • src/locales/en/main.json
  • src/composables/useTemplateFiltering.ts
  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
  • src/composables/useTemplateFiltering.test.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/composables/useTemplateFiltering.ts
  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
  • src/composables/useTemplateFiltering.test.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/composables/useTemplateFiltering.ts
  • src/composables/useTemplateFiltering.test.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/composables/useTemplateFiltering.ts
  • src/composables/useTemplateFiltering.test.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/composables/useTemplateFiltering.ts
  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
  • src/composables/useTemplateFiltering.test.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/composables/useTemplateFiltering.ts
  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
  • src/composables/useTemplateFiltering.test.ts
src/**/*.{vue,ts,tsx}

📄 CodeRabbit inference engine (src/CLAUDE.md)

Follow Vue 3 composition API style guide

Files:

  • src/composables/useTemplateFiltering.ts
  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
  • src/composables/useTemplateFiltering.test.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/composables/useTemplateFiltering.ts
  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
  • src/composables/useTemplateFiltering.test.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,vue}: Use TypeScript exclusively; do not write new JavaScript code
Use sorted and grouped imports organized by plugin/source
Enforce ESLint rules including Vue + TypeScript rules, disallow floating promises, disallow unused imports, and restrict i18n raw text in templates
Do not use any type or as any type assertions; fix the underlying type issue instead
Write code that is expressive and self-documenting; avoid redundant comments and clean as you go
Keep functions short and functional; minimize nesting and follow the arrow anti-pattern
Avoid mutable state; prefer immutability and assignment at point of declaration
Use function declarations instead of function expressions when possible
Use es-toolkit for utility functions
Implement proper error handling in code

Files:

  • src/composables/useTemplateFiltering.ts
  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
  • src/composables/useTemplateFiltering.test.ts
**/**/use[A-Z]*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Name composables using the pattern useXyz.ts

Files:

  • src/composables/useTemplateFiltering.ts
  • src/composables/useTemplateFiltering.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Minimize the surface area (exported values) of each module and composable

Files:

  • src/composables/useTemplateFiltering.ts
  • src/composables/useTemplateFiltering.test.ts
src/**/*.vue

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

src/**/*.vue: Use the Vue 3 Composition API instead of the Options API when writing Vue components (exception: when overriding or extending PrimeVue components for compatibility)
Use setup() function for component logic
Utilize ref and reactive for reactive state
Implement computed properties with computed()
Use watch and watchEffect for side effects
Implement lifecycle hooks with onMounted, onUpdated, etc.
Utilize provide/inject for dependency injection
Use vue 3.5 style of default prop declaration
Use Tailwind CSS for styling
Implement proper props and emits definitions
Utilize Vue 3's Teleport component when needed
Use Suspense for async components
Follow Vue 3 style guide and naming conventions

Files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
src/components/**/*.vue

📄 CodeRabbit inference engine (src/components/CLAUDE.md)

src/components/**/*.vue: Use setup() function in Vue 3 Composition API
Destructure props using Vue 3.5 style in Vue components
Use ref/reactive for state management in Vue 3 Composition API
Implement computed() for derived state in Vue 3 Composition API
Use provide/inject for dependency injection in Vue components
Prefer emit/@event-name for state changes over other communication patterns
Use defineExpose only for imperative operations (such as form.validate(), modal.open())
Replace PrimeVue Dropdown component with Select
Replace PrimeVue OverlayPanel component with Popover
Replace PrimeVue Calendar component with DatePicker
Replace PrimeVue InputSwitch component with ToggleSwitch
Replace PrimeVue Sidebar component with Drawer
Replace PrimeVue Chips component with AutoComplete with multiple enabled
Replace PrimeVue TabMenu component with Tabs without panels
Replace PrimeVue Steps component with Stepper without panels
Replace PrimeVue InlineMessage component with Message
Extract complex conditionals to computed properties
Implement cleanup for async operations in Vue components
Use lifecycle hooks: onMounted, onUpdated in Vue 3 Composition API
Use Teleport/Suspense when needed for component rendering
Define proper props and emits definitions in Vue components

Files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
src/components/**/*.{vue,css}

📄 CodeRabbit inference engine (src/components/CLAUDE.md)

src/components/**/*.{vue,css}: Use Tailwind CSS only for styling (no custom CSS)
Use the correct tokens from style.css in the design system package

Files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
src/components/**/*.{vue,ts,js}

📄 CodeRabbit inference engine (src/components/CLAUDE.md)

src/components/**/*.{vue,ts,js}: Use existing VueUse composables (such as useElementHover) instead of manually managing event listeners
Use useIntersectionObserver for visibility detection instead of custom scroll handlers
Use vue-i18n for ALL UI strings

Files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
**/*.vue

📄 CodeRabbit inference engine (AGENTS.md)

**/*.vue: Use Vue 3.5+ with TypeScript in .vue files, exclusively using Composition API with <script setup lang="ts"> syntax
Use Tailwind 4 for styling in Vue components; avoid <style> blocks
Name Vue components using PascalCase (e.g., MenuHamburger.vue)
Use Vue 3.5 TypeScript-style default prop declaration with reactive props destructuring; do not use withDefaults or runtime props declaration
Prefer computed() over ref with watch when deriving values
Prefer useModel over separately defining prop and emit for two-way binding
Use vue-i18n in composition API for string literals; place new translation entries in src/locales/en/main.json
Use cn() utility function from @/utils/tailwindUtil for merging Tailwind class names; do not use :class="[]" syntax
Do not use the dark: Tailwind variant; use semantic values from the style.css theme instead (e.g., bg-node-component-surface)
Do not use !important or the ! important prefix for Tailwind classes; find and correct interfering !important classes instead
Avoid new usage of PrimeVue components; use VueUse, shadcn/vue, or Reka UI instead
Leverage VueUse functions for performance-enhancing styles in Vue components
Implement proper props and emits definitions in Vue components
Utilize Vue 3's Teleport component when needed
Use Suspense for async components
Follow Vue 3 style guide and naming conventions

Files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
**/*.test.ts

📄 CodeRabbit inference engine (AGENTS.md)

**/*.test.ts: Use unit/component tests in tests-ui/ or src/**/*.test.ts with Vitest framework
For mocking in tests, leverage Vitest utilities; keep module mocks contained and avoid global mutable state within test files
Do not write change detector tests or tests dependent on non-behavioral features like utility classes or styles
Aim for behavioral coverage of critical and new features in unit tests

Files:

  • src/composables/useTemplateFiltering.test.ts
🧠 Learnings (30)
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.vue : Prefer `computed()` over `ref` with `watch` when deriving values

Applied to files:

  • src/composables/useTemplateFiltering.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.{ts,tsx,vue} : Avoid mutable state; prefer immutability and assignment at point of declaration

Applied to files:

  • src/composables/useTemplateFiltering.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/**/{composables,components}/**/*.{ts,tsx,vue} : Clean up subscriptions in state management to prevent memory leaks

Applied to files:

  • src/composables/useTemplateFiltering.ts
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.vue : Implement computed() for derived state in Vue 3 Composition API

Applied to files:

  • src/composables/useTemplateFiltering.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/**/*.vue : Implement computed properties with computed()

Applied to files:

  • src/composables/useTemplateFiltering.ts
📚 Learning: 2025-12-09T03:39:54.501Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7169
File: src/platform/remote/comfyui/jobs/jobTypes.ts:1-107
Timestamp: 2025-12-09T03:39:54.501Z
Learning: In the ComfyUI_frontend project, Zod is on v3.x. Do not suggest Zod v4 standalone validators (z.uuid, z.ulid, z.cuid2, z.nanoid) until an upgrade to Zod 4 is performed. When reviewing TypeScript files (e.g., src/platform/remote/comfyui/jobs/jobTypes.ts) validate against Zod 3 capabilities and avoid introducing v4-specific features; flag any proposal to upgrade or incorporate v4-only validators and propose staying with compatible 3.x patterns.

Applied to files:

  • src/composables/useTemplateFiltering.ts
  • src/composables/useTemplateFiltering.test.ts
📚 Learning: 2025-12-13T11:03:11.264Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7416
File: src/stores/imagePreviewStore.ts:5-7
Timestamp: 2025-12-13T11:03:11.264Z
Learning: In the ComfyUI_frontend repository, lint rules require keeping 'import type' statements separate from non-type imports, even if importing from the same module. Do not suggest consolidating them into a single import statement. Ensure type imports remain on their own line (import type { ... } from 'module') and regular imports stay on separate lines.

Applied to files:

  • src/composables/useTemplateFiltering.ts
  • src/composables/useTemplateFiltering.test.ts
📚 Learning: 2025-12-17T00:40:09.635Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7537
File: src/components/ui/button/Button.stories.ts:45-55
Timestamp: 2025-12-17T00:40:09.635Z
Learning: Prefer pure function declarations over function expressions (e.g., use function foo() { ... } instead of const foo = () => { ... }) for pure functions in the repository. Function declarations are more functional-leaning, offer better hoisting clarity, and can improve readability and tooling consistency. Apply this guideline across TypeScript files in Comfy-Org/ComfyUI_frontend, including story and UI component code, except where a function expression is semantically required (e.g., callbacks, higher-order functions with closures).

Applied to files:

  • src/composables/useTemplateFiltering.ts
  • src/composables/useTemplateFiltering.test.ts
📚 Learning: 2025-12-30T22:22:33.836Z
Learnt from: kaili-yang
Repo: Comfy-Org/ComfyUI_frontend PR: 7805
File: src/composables/useCoreCommands.ts:439-439
Timestamp: 2025-12-30T22:22:33.836Z
Learning: When accessing reactive properties from Pinia stores in TypeScript files, avoid using .value on direct property access (e.g., useStore().isOverlayExpanded). Pinia auto-wraps refs when accessed directly, returning the primitive value. The .value accessor is only needed when destructuring store properties or when using storeToRefs().

Applied to files:

  • src/composables/useTemplateFiltering.ts
  • src/composables/useTemplateFiltering.test.ts
📚 Learning: 2025-12-11T12:25:15.470Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7358
File: src/components/dialog/content/signin/SignUpForm.vue:45-54
Timestamp: 2025-12-11T12:25:15.470Z
Learning: This repository uses CI automation to format code (pnpm format). Do not include manual formatting suggestions in code reviews for Comfy-Org/ComfyUI_frontend. If formatting issues are detected, rely on the CI formatter or re-run pnpm format. Focus reviews on correctness, readability, performance, accessibility, and maintainability rather than style formatting.

Applied to files:

  • src/composables/useTemplateFiltering.ts
  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
  • src/composables/useTemplateFiltering.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/**/stores/**/*.{ts,tsx} : Use TypeScript for type safety in state management stores

Applied to files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
📚 Learning: 2025-11-24T19:47:45.616Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: src/components/CLAUDE.md:0-0
Timestamp: 2025-11-24T19:47:45.616Z
Learning: Applies to src/components/**/*.vue : Extract complex conditionals to computed properties

Applied to files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.{ts,tsx,vue} : Keep functions short and functional; minimize nesting and follow the arrow anti-pattern

Applied to files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
📚 Learning: 2025-12-09T03:49:52.828Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 6300
File: src/platform/updates/components/WhatsNewPopup.vue:5-13
Timestamp: 2025-12-09T03:49:52.828Z
Learning: In Vue files across the ComfyUI_frontend repo, when a button is needed, prefer the repo's common button components from src/components/button/ (IconButton.vue, TextButton.vue, IconTextButton.vue) over plain HTML <button> elements. These components wrap PrimeVue with the project’s design system styling. Use only the common button components for consistency and theming, and import them from src/components/button/ as needed.

Applied to files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
📚 Learning: 2025-12-09T21:40:12.361Z
Learnt from: benceruleanlu
Repo: Comfy-Org/ComfyUI_frontend PR: 7297
File: src/components/actionbar/ComfyActionbar.vue:33-43
Timestamp: 2025-12-09T21:40:12.361Z
Learning: In Vue single-file components, allow inline Tailwind CSS class strings for static classes and avoid extracting them into computed properties solely for readability. Prefer keeping static class names inline for simplicity and performance. For dynamic or conditional classes, use Vue bindings (e.g., :class) to compose classes.

Applies to all Vue files in the repository (e.g., src/**/*.vue) where Tailwind utilities are used for static styling.

Applied to files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
📚 Learning: 2025-12-16T22:26:49.463Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7537
File: src/components/ui/button/Button.vue:17-17
Timestamp: 2025-12-16T22:26:49.463Z
Learning: In Vue 3.5+ with <script setup>, when using defineProps<Props>() with partial destructuring (e.g., const { as = 'button', class: customClass = '' } = defineProps<Props>() ), props that are not destructured (e.g., variant, size) stay accessible by name in the template scope. This pattern is valid: you can destructure only a subset of props for convenience while referencing the remaining props directly in template expressions. Apply this guideline to Vue components across the codebase (all .vue files).

Applied to files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
📚 Learning: 2025-12-22T21:36:08.369Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7649
File: src/platform/cloud/subscription/components/PricingTable.vue:185-201
Timestamp: 2025-12-22T21:36:08.369Z
Learning: In Vue components, avoid creating single-use variants for common UI components (e.g., Button and other shared components). Aim for reusable variants that cover multiple use cases. It’s acceptable to temporarily mix variant props with inline Tailwind classes when a styling need is unique to one place, but plan and consolidate into shared, reusable variants as patterns emerge across the codebase.

Applied to files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
📚 Learning: 2025-12-18T02:07:38.870Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7598
File: src/components/sidebar/tabs/AssetsSidebarTab.vue:131-131
Timestamp: 2025-12-18T02:07:38.870Z
Learning: Tailwind CSS v4 safe utilities (e.g., items-center-safe, justify-*-safe, place-*-safe) are allowed in Vue components under src/ and in story files. Do not flag these specific safe variants as invalid when reviewing code in src/**/*.vue or related stories.

Applied to files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
📚 Learning: 2025-12-18T21:15:46.862Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7603
File: src/components/queue/QueueOverlayHeader.vue:49-59
Timestamp: 2025-12-18T21:15:46.862Z
Learning: In the ComfyUI_frontend repository, for Vue components, do not add aria-label to buttons that have visible text content (e.g., buttons containing <span> text). The visible text provides the accessible name. Use aria-label only for elements without visible labels (e.g., icon-only buttons). If a button has no visible label, provide a clear aria-label or associate with an aria-labelledby describing its action.

Applied to files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
📚 Learning: 2025-12-21T01:06:02.786Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7649
File: src/components/graph/selectionToolbox/ColorPickerButton.vue:15-18
Timestamp: 2025-12-21T01:06:02.786Z
Learning: In Comfy-Org/ComfyUI_frontend, in Vue component files, when a filled icon is required (e.g., 'pi pi-circle-fill'), you may mix PrimeIcons with Lucide icons since Lucide lacks filled variants. This mixed usage is acceptable when one icon library does not provide an equivalent filled icon. Apply consistently across Vue components in the src directory where icons are used, and document the rationale when a mixed approach is chosen.

Applied to files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
📚 Learning: 2025-12-18T16:03:02.066Z
Learnt from: henrikvilhelmberglund
Repo: Comfy-Org/ComfyUI_frontend PR: 7617
File: src/components/actionbar/ComfyActionbar.vue:301-308
Timestamp: 2025-12-18T16:03:02.066Z
Learning: In the ComfyUI frontend queue system, useQueuePendingTaskCountStore().count indicates the number of tasks in the queue, where count = 1 means a single active/running task and count > 1 means there are pending tasks in addition to the active task. Therefore, in src/components/actionbar/ComfyActionbar.vue, enable the 'Clear Pending Tasks' button only when count > 1 to avoid clearing the currently running task. The active task should be canceled using the 'Cancel current run' button instead. This rule should be enforced via a conditional check on the queue count, with appropriate disabled/aria-disabled states for accessibility, and tests should verify behavior for count = 1 and count > 1.

Applied to files:

  • src/components/custom/widget/WorkflowTemplateSelectorDialog.vue
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*Store.ts : Name Pinia stores using the pattern `*Store.ts`

Applied to files:

  • src/composables/useTemplateFiltering.test.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/**/*.{test,spec}.{ts,tsx} : Use provided test helpers `createTestSubgraph` and `createTestSubgraphNode` from `./fixtures/subgraphHelpers` for consistent subgraph test setup

Applied to files:

  • src/composables/useTemplateFiltering.test.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.test.ts : For mocking in tests, leverage Vitest utilities; keep module mocks contained and avoid global mutable state within test files

Applied to files:

  • src/composables/useTemplateFiltering.test.ts
📚 Learning: 2025-11-24T19:48:09.318Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursor/rules/unit-test.mdc:0-0
Timestamp: 2025-11-24T19:48:09.318Z
Learning: Applies to test/**/*.{test,spec}.{js,ts,jsx,tsx} : Use `vitest` for unit testing in this project

Applied to files:

  • src/composables/useTemplateFiltering.test.ts
📚 Learning: 2025-11-24T19:48:09.318Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursor/rules/unit-test.mdc:0-0
Timestamp: 2025-11-24T19:48:09.318Z
Learning: Applies to test/**/*.{test,spec}.{js,ts,jsx,tsx} : Use `test` instead of `it` for defining test cases in vitest

Applied to files:

  • src/composables/useTemplateFiltering.test.ts
📚 Learning: 2025-11-24T19:48:09.318Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: .cursor/rules/unit-test.mdc:0-0
Timestamp: 2025-11-24T19:48:09.318Z
Learning: Applies to test/**/*.{test,spec}.{js,ts,jsx,tsx} : Prefer the use of `test.extend` over loose variables; import `test as baseTest` from `vitest`

Applied to files:

  • src/composables/useTemplateFiltering.test.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.test.ts : Use unit/component tests in `tests-ui/` or `src/**/*.test.ts` with Vitest framework

Applied to files:

  • src/composables/useTemplateFiltering.test.ts
📚 Learning: 2025-12-10T03:09:13.807Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7303
File: src/components/topbar/CurrentUserPopover.test.ts:199-205
Timestamp: 2025-12-10T03:09:13.807Z
Learning: In test files, prefer selecting or asserting on accessible properties (text content, aria-label, role, accessible name) over data-testid attributes. This ensures tests validate actual user-facing behavior and accessibility, reducing reliance on implementation details like test IDs.

Applied to files:

  • src/composables/useTemplateFiltering.test.ts
📚 Learning: 2025-12-30T01:31:04.927Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7797
File: tests-ui/tests/lib/litegraph/src/widgets/ComboWidget.test.ts:648-648
Timestamp: 2025-12-30T01:31:04.927Z
Learning: In Vitest v4, when mocking functions that may be called as constructors (using new), the mock implementation must use function() or class syntax rather than an arrow function. Arrow mocks can cause '<anonymous> is not a constructor' errors. This is a breaking change from Vitest v3 where mocks could use an arrow function. Apply this guideline to test files that mock constructor-like calls (e.g., in tests under tests-ui, such as ComboWidget.test.ts) and ensure mock implementations are defined with function() { ... } or class { ... } to preserve constructor behavior.

Applied to files:

  • src/composables/useTemplateFiltering.test.ts
🪛 markdownlint-cli2 (0.18.1)
docs/TEMPLATE_RANKING.md

52-52: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ 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: lint-and-format
  • GitHub Check: collect
🔇 Additional comments (9)
src/composables/useTemplateFiltering.test.ts (1)

48-52: LGTM!

The Pinia setup with setActivePinia(createPinia()) in beforeEach correctly initializes the store context for each test, ensuring isolation between test cases.

src/composables/useTemplateFiltering.ts (3)

158-166: LGTM! Good refactor addressing the computed side-effect issue.

Moving the largestUsageScore mutation from the computed property to a dedicated watcher correctly separates concerns and maintains Vue's reactivity guidelines.


172-193: LGTM!

The new ranking-based sorting for 'recommended' and 'popular' modes correctly delegates score computation to the ranking store and sorts in descending order. The formulas align with the documented weights in TEMPLATE_RANKING.md.


222-230: LGTM! Type safety improvement.

Removing the explicit as any cast and using proper type checking for the size property is a good improvement.

src/locales/en/main.json (1)

876-886: LGTM!

Localization updates appropriately support the new "Popular" sort option and the renamed "Tasks" filter label.

src/components/custom/widget/WorkflowTemplateSelectorDialog.vue (3)

569-597: LGTM! Clean state coordination between navigation and sort.

The bidirectional coordination logic is well-structured and avoids infinite loops through careful condition checks. The function clearly documents its purpose and the watchers appropriately trigger coordination from both sources.


831-837: LGTM!

Clean extraction of the distribution visibility logic into a helper function improves template readability.


709-717: LGTM!

New sort options for 'recommended' and 'popular' are properly integrated with localization support.

docs/TEMPLATE_RANKING.md (1)

9-15: Clarify terminology for consistency with data files section.

Line 11 uses "internal" to describe the formula parameter, but the "Data Files" section (line 31 onwards) refers to this as "searchRank". For clarity and consistency, update the formula column to use "searchRank" instead of "internal".

🔎 Proposed fix
-| `recommended`  | `usage × 0.5 + internal × 0.3 + freshness × 0.2` | Curated recommendation |
+| `recommended`  | `usage × 0.5 + searchRank × 0.3 + freshness × 0.2` | Curated recommendation |

Likely an incorrect or invalid review comment.

Comment on lines +23 to +29
const defaultRankingStore = {
computeDefaultScore: vi.fn(() => 0),
computePopularScore: vi.fn(() => 0),
getUsageScore: vi.fn(() => 0),
computeFreshness: vi.fn(() => 0.5),
isLoaded: { value: false }
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Consider adding test coverage for 'recommended' and 'popular' sort modes.

The mock always returns constant values (0 for scores, 0.5 for freshness), which means templates will have identical scores. While this works for basic testing, there's no dedicated test coverage verifying the 'recommended' and 'popular' sorting behavior actually uses the ranking store correctly.

Consider adding tests that configure the mock to return different scores for different templates to verify sorting order.

🤖 Prompt for AI Agents
In @src/composables/useTemplateFiltering.test.ts around lines 23 - 29, The tests
currently mock defaultRankingStore with identical scores so sorting behavior for
'recommended' and 'popular' isn't validated; update the test suite in
useTemplateFiltering.test.ts to add cases that set computeDefaultScore and
computePopularScore (and/or getUsageScore/computeFreshness) to return different
values per template, then assert that sortTemplates (or the hook using sortMode
'recommended' and 'popular') orders templates accordingly; target the
defaultRankingStore mock object and the functions computeDefaultScore,
computePopularScore, getUsageScore, and computeFreshness to simulate distinct
scores and add assertions for expected ordering.

@Yourz Yourz enabled auto-merge (squash) January 6, 2026 12:54
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

🤖 Fix all issues with AI Agents
In @browser_tests/tests/templates.spec.ts:
- Around line 84-86: The locator using comfyPage.page.locator('nav >
div:nth-child(1) > div > span:has-text("All Templates")') is fragile; replace it
with a more robust selector by updating the app to add a stable identifier
(e.g., data-testid="nav-all-templates") and then use
comfyPage.page.getByTestId('nav-all-templates') or, if the element is a
button/link, use comfyPage.page.getByRole('button' or 'link', { name: 'All
Templates' }) or comfyPage.page.getByText('All Templates', { exact: true })
scoped to the nav; update the test to reference the chosen selector and remove
the nth-child usage in the comfyPage.page locator call.
📜 Review details

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9c1fe8c and 476de50.

📒 Files selected for processing (1)
  • browser_tests/tests/templates.spec.ts
🧰 Additional context used
📓 Path-based instructions (5)
browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (browser_tests/CLAUDE.md)

browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx}: Test user workflows in browser tests
Use Playwright fixtures for browser tests
Follow naming conventions for browser tests
Check assets/ directory for test data when writing tests
Prefer specific selectors in browser tests
Test across multiple viewports

Files:

  • browser_tests/tests/templates.spec.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,vue}: Use TypeScript exclusively; do not write new JavaScript code
Use sorted and grouped imports organized by plugin/source
Enforce ESLint rules including Vue + TypeScript rules, disallow floating promises, disallow unused imports, and restrict i18n raw text in templates
Do not use any type or as any type assertions; fix the underlying type issue instead
Write code that is expressive and self-documenting; avoid redundant comments and clean as you go
Keep functions short and functional; minimize nesting and follow the arrow anti-pattern
Avoid mutable state; prefer immutability and assignment at point of declaration
Use function declarations instead of function expressions when possible
Use es-toolkit for utility functions
Implement proper error handling in code

Files:

  • browser_tests/tests/templates.spec.ts
**/*.{ts,tsx,vue,js,jsx,json,css}

📄 CodeRabbit inference engine (AGENTS.md)

Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, and 80-character line width

Files:

  • browser_tests/tests/templates.spec.ts
browser_tests/**/*.spec.ts

📄 CodeRabbit inference engine (AGENTS.md)

browser_tests/**/*.spec.ts: Use E2E tests in browser_tests/**/*.spec.ts with Playwright framework
Do not use waitForTimeout in Playwright tests; use Locator actions and retrying assertions instead
Use tags like @mobile and @2x in Playwright tests for relevant test variations; tags are respected by config

Files:

  • browser_tests/tests/templates.spec.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Minimize the surface area (exported values) of each module and composable

Files:

  • browser_tests/tests/templates.spec.ts
🧠 Learnings (13)
📚 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:

  • browser_tests/tests/templates.spec.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} : Prefer specific selectors in browser tests

Applied to files:

  • browser_tests/tests/templates.spec.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} : Follow naming conventions for browser tests

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-13T05:54:35.779Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7415
File: browser_tests/tests/mobileBaseline.spec.ts:17-22
Timestamp: 2025-12-13T05:54:35.779Z
Learning: In browser_tests tests for the Comfy-Org/ComfyUI_frontend repository, the `comfyPage.loadWorkflow()` method already handles all necessary synchronization and waiting. No additional `await comfyPage.nextFrame()` call is needed before taking screenshots after loading a workflow.

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to browser_tests/**/*.spec.ts : Use E2E tests in `browser_tests/**/*.spec.ts` with Playwright framework

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.test.ts : Do not write change detector tests or tests dependent on non-behavioral features like utility classes or styles

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.test.ts : Aim for behavioral coverage of critical and new features in unit tests

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-09T03:39:54.501Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7169
File: src/platform/remote/comfyui/jobs/jobTypes.ts:1-107
Timestamp: 2025-12-09T03:39:54.501Z
Learning: In the ComfyUI_frontend project, Zod is on v3.x. Do not suggest Zod v4 standalone validators (z.uuid, z.ulid, z.cuid2, z.nanoid) until an upgrade to Zod 4 is performed. When reviewing TypeScript files (e.g., src/platform/remote/comfyui/jobs/jobTypes.ts) validate against Zod 3 capabilities and avoid introducing v4-specific features; flag any proposal to upgrade or incorporate v4-only validators and propose staying with compatible 3.x patterns.

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-13T11:03:11.264Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7416
File: src/stores/imagePreviewStore.ts:5-7
Timestamp: 2025-12-13T11:03:11.264Z
Learning: In the ComfyUI_frontend repository, lint rules require keeping 'import type' statements separate from non-type imports, even if importing from the same module. Do not suggest consolidating them into a single import statement. Ensure type imports remain on their own line (import type { ... } from 'module') and regular imports stay on separate lines.

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-17T00:40:09.635Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7537
File: src/components/ui/button/Button.stories.ts:45-55
Timestamp: 2025-12-17T00:40:09.635Z
Learning: Prefer pure function declarations over function expressions (e.g., use function foo() { ... } instead of const foo = () => { ... }) for pure functions in the repository. Function declarations are more functional-leaning, offer better hoisting clarity, and can improve readability and tooling consistency. Apply this guideline across TypeScript files in Comfy-Org/ComfyUI_frontend, including story and UI component code, except where a function expression is semantically required (e.g., callbacks, higher-order functions with closures).

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-30T22:22:33.836Z
Learnt from: kaili-yang
Repo: Comfy-Org/ComfyUI_frontend PR: 7805
File: src/composables/useCoreCommands.ts:439-439
Timestamp: 2025-12-30T22:22:33.836Z
Learning: When accessing reactive properties from Pinia stores in TypeScript files, avoid using .value on direct property access (e.g., useStore().isOverlayExpanded). Pinia auto-wraps refs when accessed directly, returning the primitive value. The .value accessor is only needed when destructuring store properties or when using storeToRefs().

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-11T12:25:15.470Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7358
File: src/components/dialog/content/signin/SignUpForm.vue:45-54
Timestamp: 2025-12-11T12:25:15.470Z
Learning: This repository uses CI automation to format code (pnpm format). Do not include manual formatting suggestions in code reviews for Comfy-Org/ComfyUI_frontend. If formatting issues are detected, rely on the CI formatter or re-run pnpm format. Focus reviews on correctness, readability, performance, accessibility, and maintainability rather than style formatting.

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-13T05:34:15.488Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7415
File: browser_tests/tests/mobileBaseline.spec.ts:7-15
Timestamp: 2025-12-13T05:34:15.488Z
Learning: In Playwright tests for the ComfyUI frontend, the toPass() assertion uses incremental backoff during retries. When a test may involve async operations, increasing the timeout (e.g., to 5000 ms) can be sufficient instead of aggressively extending timeouts. Apply this understanding to tests under browser_tests/tests/; if not resolved, review the toPass() backoff behavior and ensure timeouts align with expected async completion without masking issues.

Applied to files:

  • browser_tests/tests/templates.spec.ts
⏰ 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: setup
  • GitHub Check: test
  • GitHub Check: lint-and-format
  • GitHub Check: collect

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: Organization UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 476de50 and 74eb2d2.

📒 Files selected for processing (1)
  • browser_tests/tests/templates.spec.ts
🧰 Additional context used
📓 Path-based instructions (5)
browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (browser_tests/CLAUDE.md)

browser_tests/**/*.{e2e,spec}.{ts,tsx,js,jsx}: Test user workflows in browser tests
Use Playwright fixtures for browser tests
Follow naming conventions for browser tests
Check assets/ directory for test data when writing tests
Prefer specific selectors in browser tests
Test across multiple viewports

Files:

  • browser_tests/tests/templates.spec.ts
**/*.{ts,tsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,vue}: Use TypeScript exclusively; do not write new JavaScript code
Use sorted and grouped imports organized by plugin/source
Enforce ESLint rules including Vue + TypeScript rules, disallow floating promises, disallow unused imports, and restrict i18n raw text in templates
Do not use any type or as any type assertions; fix the underlying type issue instead
Write code that is expressive and self-documenting; avoid redundant comments and clean as you go
Keep functions short and functional; minimize nesting and follow the arrow anti-pattern
Avoid mutable state; prefer immutability and assignment at point of declaration
Use function declarations instead of function expressions when possible
Use es-toolkit for utility functions
Implement proper error handling in code

Files:

  • browser_tests/tests/templates.spec.ts
**/*.{ts,tsx,vue,js,jsx,json,css}

📄 CodeRabbit inference engine (AGENTS.md)

Apply Prettier formatting with 2-space indentation, single quotes, no trailing semicolons, and 80-character line width

Files:

  • browser_tests/tests/templates.spec.ts
browser_tests/**/*.spec.ts

📄 CodeRabbit inference engine (AGENTS.md)

browser_tests/**/*.spec.ts: Use E2E tests in browser_tests/**/*.spec.ts with Playwright framework
Do not use waitForTimeout in Playwright tests; use Locator actions and retrying assertions instead
Use tags like @mobile and @2x in Playwright tests for relevant test variations; tags are respected by config

Files:

  • browser_tests/tests/templates.spec.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

Minimize the surface area (exported values) of each module and composable

Files:

  • browser_tests/tests/templates.spec.ts
🧠 Learnings (19)
📚 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} : Prefer specific selectors in browser tests

Applied to files:

  • browser_tests/tests/templates.spec.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:

  • browser_tests/tests/templates.spec.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} : Follow naming conventions for browser tests

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to browser_tests/**/*.spec.ts : Use E2E tests in `browser_tests/**/*.spec.ts` with Playwright framework

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.test.ts : Do not write change detector tests or tests dependent on non-behavioral features like utility classes or styles

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to browser_tests/**/*.spec.ts : Do not use `waitForTimeout` in Playwright tests; use Locator actions and retrying assertions instead

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to browser_tests/**/*.spec.ts : Use tags like `mobile` and `2x` in Playwright tests for relevant test variations; tags are respected by config

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-10T03:09:19.636Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7303
File: src/components/topbar/CurrentUserPopover.test.ts:199-205
Timestamp: 2025-12-10T03:09:19.636Z
Learning: For test files in the Comfy-Org/ComfyUI_frontend repository: When writing tests, prefer selecting elements by accessible properties (text content, aria-label, role, accessible name) over data-testid attributes. This ensures tests verify actual user-facing behavior and accessibility compliance.

Applied to files:

  • browser_tests/tests/templates.spec.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:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-21T06:04:12.562Z
Learnt from: CR
Repo: Comfy-Org/ComfyUI_frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-21T06:04:12.562Z
Learning: Applies to **/*.test.ts : Aim for behavioral coverage of critical and new features in unit tests

Applied to files:

  • browser_tests/tests/templates.spec.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} : Use Playwright fixtures for browser tests

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-13T05:54:35.779Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7415
File: browser_tests/tests/mobileBaseline.spec.ts:17-22
Timestamp: 2025-12-13T05:54:35.779Z
Learning: In browser_tests tests for the Comfy-Org/ComfyUI_frontend repository, the `comfyPage.loadWorkflow()` method already handles all necessary synchronization and waiting. No additional `await comfyPage.nextFrame()` call is needed before taking screenshots after loading a workflow.

Applied to files:

  • browser_tests/tests/templates.spec.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:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-09T03:39:54.501Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7169
File: src/platform/remote/comfyui/jobs/jobTypes.ts:1-107
Timestamp: 2025-12-09T03:39:54.501Z
Learning: In the ComfyUI_frontend project, Zod is on v3.x. Do not suggest Zod v4 standalone validators (z.uuid, z.ulid, z.cuid2, z.nanoid) until an upgrade to Zod 4 is performed. When reviewing TypeScript files (e.g., src/platform/remote/comfyui/jobs/jobTypes.ts) validate against Zod 3 capabilities and avoid introducing v4-specific features; flag any proposal to upgrade or incorporate v4-only validators and propose staying with compatible 3.x patterns.

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-13T11:03:11.264Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7416
File: src/stores/imagePreviewStore.ts:5-7
Timestamp: 2025-12-13T11:03:11.264Z
Learning: In the ComfyUI_frontend repository, lint rules require keeping 'import type' statements separate from non-type imports, even if importing from the same module. Do not suggest consolidating them into a single import statement. Ensure type imports remain on their own line (import type { ... } from 'module') and regular imports stay on separate lines.

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-17T00:40:09.635Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7537
File: src/components/ui/button/Button.stories.ts:45-55
Timestamp: 2025-12-17T00:40:09.635Z
Learning: Prefer pure function declarations over function expressions (e.g., use function foo() { ... } instead of const foo = () => { ... }) for pure functions in the repository. Function declarations are more functional-leaning, offer better hoisting clarity, and can improve readability and tooling consistency. Apply this guideline across TypeScript files in Comfy-Org/ComfyUI_frontend, including story and UI component code, except where a function expression is semantically required (e.g., callbacks, higher-order functions with closures).

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-30T22:22:33.836Z
Learnt from: kaili-yang
Repo: Comfy-Org/ComfyUI_frontend PR: 7805
File: src/composables/useCoreCommands.ts:439-439
Timestamp: 2025-12-30T22:22:33.836Z
Learning: When accessing reactive properties from Pinia stores in TypeScript files, avoid using .value on direct property access (e.g., useStore().isOverlayExpanded). Pinia auto-wraps refs when accessed directly, returning the primitive value. The .value accessor is only needed when destructuring store properties or when using storeToRefs().

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-11T12:25:15.470Z
Learnt from: christian-byrne
Repo: Comfy-Org/ComfyUI_frontend PR: 7358
File: src/components/dialog/content/signin/SignUpForm.vue:45-54
Timestamp: 2025-12-11T12:25:15.470Z
Learning: This repository uses CI automation to format code (pnpm format). Do not include manual formatting suggestions in code reviews for Comfy-Org/ComfyUI_frontend. If formatting issues are detected, rely on the CI formatter or re-run pnpm format. Focus reviews on correctness, readability, performance, accessibility, and maintainability rather than style formatting.

Applied to files:

  • browser_tests/tests/templates.spec.ts
📚 Learning: 2025-12-13T05:34:15.488Z
Learnt from: DrJKL
Repo: Comfy-Org/ComfyUI_frontend PR: 7415
File: browser_tests/tests/mobileBaseline.spec.ts:7-15
Timestamp: 2025-12-13T05:34:15.488Z
Learning: In Playwright tests for the ComfyUI frontend, the toPass() assertion uses incremental backoff during retries. When a test may involve async operations, increasing the timeout (e.g., to 5000 ms) can be sufficient instead of aggressively extending timeouts. Apply this understanding to tests under browser_tests/tests/; if not resolved, review the toPass() backoff behavior and ensure timeouts align with expected async completion without masking issues.

Applied to files:

  • browser_tests/tests/templates.spec.ts
⏰ 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). (7)
  • GitHub Check: playwright-tests-chromium-sharded (1, 8)
  • GitHub Check: playwright-tests-chromium-sharded (4, 8)
  • GitHub Check: playwright-tests-chromium-sharded (6, 8)
  • GitHub Check: playwright-tests-chromium-sharded (8, 8)
  • GitHub Check: test
  • GitHub Check: lint-and-format
  • GitHub Check: collect

Comment on lines 84 to 88
await comfyPage.page
.locator(
'nav > div:nth-child(2) > div > span:has-text("Getting Started")'
'nav > div:nth-child(3) > div > span:has-text("Getting Started")'
)
.click()
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

The fragile selector remains unresolved.

Changing nth-child(2) to nth-child(3) fixes the immediate breakage but perpetuates the same maintenance issue. When navigation structure changes again, this test will break again. The previous review already suggested robust alternatives (data-testid, role-based selectors, or scoped getByText), which would prevent this class of breakage.

Based on learnings, prefer specific selectors in browser tests and favor accessible properties over structural selectors like nth-child.

@Yourz
Copy link
Collaborator

Yourz commented Jan 6, 2026

@Yourz Can you help updating this Playwright test? Might need to just the conditions https://2040cb51.comfyui-playwright-chromium.pages.dev/#?testId=35f0453d615a452757ca-f5a1a01280744a8a5cd7

fixed @christian-byrne

@Yourz Yourz requested a review from Myestery January 6, 2026 15:59
@Yourz
Copy link
Collaborator

Yourz commented Jan 6, 2026

@Myestery I updated the PR with correcting playwright test

@Yourz Yourz merged commit fbdaf5d into main Jan 6, 2026
28 checks passed
@Yourz Yourz deleted the templates/usage-based-ordering branch January 6, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:templates preview size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants