Skip to content

fix(node-search): add API Nodes category to v2 search#9257

Open
Ni-zav wants to merge 2 commits intoComfy-Org:mainfrom
Ni-zav:fix/node-search-api-nodes-category
Open

fix(node-search): add API Nodes category to v2 search#9257
Ni-zav wants to merge 2 commits intoComfy-Org:mainfrom
Ni-zav:fix/node-search-api-nodes-category

Conversation

@Ni-zav
Copy link

@Ni-zav Ni-zav commented Feb 26, 2026

Summary

  • Add explicit API Nodes source category to V2 Node Search sidebar when API nodes are present.
  • Add category filtering logic so selecting API Nodes shows only nodes with api_node = true.
  • Add tests for sidebar visibility and API category filtering behavior.

Why

The bounty list includes a task where API Nodes do not appear in the Node Search Bar. This change provides an explicit and discoverable path in V2 node search.

Changes

  • src/components/searchbox/v2/NodeSearchCategorySidebar.vue
    • Add hasApiNodes computed.
    • Add api category entry (g.API Nodes) when API nodes exist.
  • src/components/searchbox/v2/NodeSearchContent.vue
    • Add case 'api' filter branch (n.api_node).
  • Tests:
    • src/components/searchbox/v2/NodeSearchCategorySidebar.test.ts
    • src/components/searchbox/v2/NodeSearchContent.test.ts
    • src/components/searchbox/v2/__test__/testUtils.ts

Validation Notes

  • Environment had local runtime/tooling constraints during vitest execution (Node/toolchain mismatch and local hook issues).
  • Type-level editor diagnostics show no errors in modified files.
  • Test cases were added/updated to cover the new behavior.

┆Issue is synchronized with this Notion page by Unito

@Ni-zav Ni-zav requested a review from a team as a code owner February 26, 2026 19:45
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 26, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 26, 2026

📝 Walkthrough

Walkthrough

A new "API Nodes" category is introduced to the node search functionality. Changes include conditional rendering of the API Nodes category in the sidebar, filtering logic to display only nodes with the api_node flag set to true, corresponding test coverage, and localization support.

Changes

Cohort / File(s) Summary
Sidebar Category
src/components/searchbox/v2/NodeSearchCategorySidebar.vue, src/components/searchbox/v2/NodeSearchCategorySidebar.test.ts
Added hasApiNodes computed property to detect nodes with the api_node flag and conditionally include an API Nodes category in the sidebar. Test validates the category appears when API nodes are present.
Search Content Filtering
src/components/searchbox/v2/NodeSearchContent.vue, src/components/searchbox/v2/NodeSearchContent.test.ts
Introduced a new filter case for the api category that displays only nodes where api_node is truthy. Test confirms filtering works correctly when the API Nodes category is selected.
Localization
src/components/searchbox/v2/__test__/testUtils.ts
Added i18n message entry for "API Nodes" label in English messages.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 With whiskers twitching at API's call,
A new category blooms in search's hall,
Filtering nodes by flag so true,
The rabbit hops through features new! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description includes summary, changes, and reasoning but deviates from the repository's template structure which requires specific sections with standardized formatting. Restructure the description to match the template format: use 'What', 'Breaking', and 'Dependencies' subsections under Changes; add 'Review Focus' section; and consider adding issue reference and screenshots sections as applicable.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title clearly and concisely summarizes the main change: adding an API Nodes category to the v2 node search feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 Feb 26, 2026

🎨 Storybook: loading Building...

@github-actions
Copy link

github-actions bot commented Feb 26, 2026

🎭 Playwright: ⏳ Running...

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.

🧹 Nitpick comments (1)
src/components/searchbox/v2/__test__/testUtils.ts (1)

42-42: Consider using camelCase for i18n key consistency.

The key 'API Nodes' uses a space, while other keys in this object use camelCase (e.g., mostRelevant, filterBy, noResults). For consistency, consider renaming to apiNodes.

This would require updating the reference in NodeSearchCategorySidebar.vue from t('g.API Nodes') to t('g.apiNodes').

♻️ Suggested change
-        'API Nodes': 'API Nodes',
+        apiNodes: 'API Nodes',
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/searchbox/v2/__test__/testUtils.ts` at line 42, Rename the
i18n key 'API Nodes' in the translations object in testUtils.ts to use camelCase
(apiNodes) and update all usages to match; specifically change the key in the
object and update the lookup in NodeSearchCategorySidebar.vue from t('g.API
Nodes') to t('g.apiNodes') so keys are consistent with others like
mostRelevant/filterBy/noResults.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/searchbox/v2/__test__/testUtils.ts`:
- Line 42: Rename the i18n key 'API Nodes' in the translations object in
testUtils.ts to use camelCase (apiNodes) and update all usages to match;
specifically change the key in the object and update the lookup in
NodeSearchCategorySidebar.vue from t('g.API Nodes') to t('g.apiNodes') so keys
are consistent with others like mostRelevant/filterBy/noResults.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9fb93a5 and 0845fe3.

📒 Files selected for processing (5)
  • src/components/searchbox/v2/NodeSearchCategorySidebar.test.ts
  • src/components/searchbox/v2/NodeSearchCategorySidebar.vue
  • src/components/searchbox/v2/NodeSearchContent.test.ts
  • src/components/searchbox/v2/NodeSearchContent.vue
  • src/components/searchbox/v2/__test__/testUtils.ts

@christian-byrne christian-byrne added the Design Used to request Product feedback on design decisions label Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Design Used to request Product feedback on design decisions size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants