Skip to content

[FE Feat] Tools catalog category sections#5062

Merged
ardaerzin merged 5 commits into
big-agentsfrom
feat/tools-catalog-category-sections
Jul 3, 2026
Merged

[FE Feat] Tools catalog category sections#5062
ardaerzin merged 5 commits into
big-agentsfrom
feat/tools-catalog-category-sections

Conversation

@ardaerzin

Copy link
Copy Markdown
Contributor

Summary

tba

Testing

tba

QA follow-up

Checklist

  • I have included a video or screen recording for UI changes, or marked Demo as N/A
  • Relevant tests pass locally
  • Relevant linting and formatting pass locally
  • I have signed the CLA, or I will sign it when the bot prompts me

Contributor Resources

Add a "Browse by category" rail to the tool catalog: connections pinned at the
top, an independently-scrolling category list below, and a single-select filter
(all / category / connection) driving the grid. Full-bleed recessed rail, and
per-context loading / empty / error states.

Backend: the shared gateway catalog gains a category filter on list_integrations
(passed to Composio /toolkits?category=) plus a new list_categories that derives
a focused, results-guaranteed nav from the most-used toolkits' own tags —
Composio's /toolkits/categories returns ~800 raw tags, most matching nothing.
New /catalog/providers/{provider}/categories/ route.

Frontend: category atom + categories hook (atomWithQuery), category pass-through
on the Fern integrations call, dedupe of integrations/categories to keep React
keys unique across pagination, and search that flattens across categories.
@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jul 3, 2026 7:41pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 540d84bb-fcb9-4419-b4ed-e09f354499b8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds tool-catalog category listing and category-based filtering across the backend API, gateway/service layers, frontend data access, and the shared catalog chooser UI.

Changes

Tool catalog categories

Layer / File(s) Summary
Catalog category contracts
api/oss/src/core/gateway/catalog/dtos.py, api/oss/src/core/gateway/catalog/interfaces.py, api/oss/src/core/tools/dtos.py
Adds CatalogCategory, ToolCatalogCategory, and ToolCatalogCategoriesResponse, and extends the gateway interface with list_categories() and a category filter on list_integrations.
Catalog adapter and service flow
api/oss/src/core/gateway/catalog/providers/composio/adapter.py, api/oss/src/core/gateway/catalog/service.py, api/oss/src/core/tools/service.py
Implements category derivation in the Composio adapter and wires category through catalog and tools service calls, plus category DTO mapping.
FastAPI categories endpoint
api/oss/src/apis/fastapi/tools/models.py, api/oss/src/apis/fastapi/tools/router.py
Adds the categories response model, a cached categories route, and category query support on the integrations listing endpoint.
Frontend catalog API and schemas
web/packages/agenta-entities/src/gatewayTool/api/*, web/packages/agenta-entities/src/gatewayTool/core/*
Adds frontend category schemas, manual categories fetching, category-aware integrations requests, deduplication helpers, and related barrel exports.
Frontend hooks and atoms
web/packages/agenta-entities/src/gatewayTool/hooks/*, web/packages/agenta-entities/src/gatewayTool/index.ts
Adds the categories query atom and hook, extends integration state with category selection, and re-exports the new hook surface.
CatalogChooser category rail
web/packages/agenta-entity-ui/src/drawers/shared/CatalogChooser.tsx, web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/AgentIntegrationDrawer.tsx
Reworks the shared chooser and drawer wiring to show categories, filter integrations by category, and adjust loading, empty, and selection states.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CatalogChooser
  participant useToolCatalogIntegrations
  participant fetchToolIntegrations
  participant ToolsRouter
  participant ToolsService
  participant CatalogService
  participant ComposioCatalogAdapter

  User->>CatalogChooser: select category
  CatalogChooser->>useToolCatalogIntegrations: setCategory(id)
  useToolCatalogIntegrations->>fetchToolIntegrations: request(category)
  fetchToolIntegrations->>ToolsRouter: GET /catalog/providers/{key}/integrations?category=
  ToolsRouter->>ToolsService: list_integrations(category)
  ToolsService->>CatalogService: list_integrations(category)
  CatalogService->>ComposioCatalogAdapter: list_integrations(category)
  ComposioCatalogAdapter-->>CatalogService: filtered integrations
  CatalogService-->>ToolsService: filtered integrations
  ToolsService-->>ToolsRouter: filtered integrations
  ToolsRouter-->>fetchToolIntegrations: response
  fetchToolIntegrations-->>useToolCatalogIntegrations: page data
  useToolCatalogIntegrations-->>CatalogChooser: deduplicated integrations
  CatalogChooser-->>User: render filtered grid
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is mostly placeholders and does not meaningfully describe the changes. Replace the placeholders with a brief summary of the implementation, testing performed, and any QA follow-up needed.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding tools catalog category sections.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/tools-catalog-category-sections

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.

@ardaerzin ardaerzin changed the base branch from main to big-agents July 3, 2026 17:08
@ardaerzin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 3, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
web/packages/agenta-entities/src/gatewayTool/hooks/useToolCatalogIntegrations.ts (1)

60-74: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Add regression tests for the duplicate-key dedup logic.

This dedup-by-key logic (and its sibling dedup-by-id in useToolCatalogCategories.ts) exists specifically to prevent a documented React duplicate-key render crash. Neither has test coverage, so a future refactor to pagination or the category filter could silently reintroduce the crash.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: abe13313-5c7c-4810-b07f-07ca7ebaa7c8

📥 Commits

Reviewing files that changed from the base of the PR and between cd633b5 and d30987f.

📒 Files selected for processing (18)
  • api/oss/src/apis/fastapi/tools/models.py
  • api/oss/src/apis/fastapi/tools/router.py
  • api/oss/src/core/gateway/catalog/dtos.py
  • api/oss/src/core/gateway/catalog/interfaces.py
  • api/oss/src/core/gateway/catalog/providers/composio/adapter.py
  • api/oss/src/core/gateway/catalog/service.py
  • api/oss/src/core/tools/dtos.py
  • api/oss/src/core/tools/service.py
  • web/packages/agenta-entities/src/gatewayTool/api/api.ts
  • web/packages/agenta-entities/src/gatewayTool/api/index.ts
  • web/packages/agenta-entities/src/gatewayTool/core/index.ts
  • web/packages/agenta-entities/src/gatewayTool/core/types.ts
  • web/packages/agenta-entities/src/gatewayTool/hooks/index.ts
  • web/packages/agenta-entities/src/gatewayTool/hooks/useToolCatalogCategories.ts
  • web/packages/agenta-entities/src/gatewayTool/hooks/useToolCatalogIntegrations.ts
  • web/packages/agenta-entities/src/gatewayTool/index.ts
  • web/packages/agenta-entity-ui/src/DrillInView/SchemaControls/agentTemplate/AgentIntegrationDrawer.tsx
  • web/packages/agenta-entity-ui/src/drawers/shared/CatalogChooser.tsx

Comment thread web/packages/agenta-entities/src/gatewayTool/api/api.ts
Comment on lines +651 to +670
// Picking any rail filter clears an active search (search and filter are mutually exclusive).
const clearSearch = () => {
setSearchInput("")
setSearch("")
}
const pickAll = () => {
setSelected(null)
setCategoryState(null)
setCategory?.(null)
clearSearch()
}
const pickCategory = (cat: {id: string; name: string}) => {
setSelected(null)
setCategoryState(cat)
setCategory?.(cat.id)
clearSearch()
}
const pickConn = (id: string) => {
setSelected({kind: "conn", id})
clearSearch()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Clear category state when search or connection selection takes over.

After selecting a category, typing in search only updates searchInput, so the upstream category filter remains active while the header says “Results”. pickConn also leaves the prior category active, so returning from a pinned connection can restore a stale category view and can make byKey miss app metadata for connections outside that category.

Suggested fix
+    const clearCategory = () => {
+        setCategoryState(null)
+        setCategory?.(null)
+    }
+
     const clearSearch = () => {
         setSearchInput("")
         setSearch("")
     }
     const pickAll = () => {
         setSelected(null)
-        setCategoryState(null)
-        setCategory?.(null)
+        clearCategory()
         clearSearch()
     }
@@
     const pickConn = (id: string) => {
         setSelected({kind: "conn", id})
+        clearCategory()
         clearSearch()
     }
@@
-                            onChange={(e) => setSearchInput(e.target.value)}
+                            onChange={(e) => {
+                                const next = e.target.value
+                                setSearchInput(next)
+                                if (next.trim()) clearCategory()
+                            }}

Also applies to: 881-889

- Validate fetchToolCategories at the boundary via zod (only non-Fern call);
  derive the category types from the schema so type and validator can't drift.
- Clear the category filter when a connection is picked so the browse query
  isn't left filtered behind the detail view or restored stale on Back.
- Resolve connection integration metadata from a monotonic union of loaded
  integrations so a category/search filter no longer drops name+logo.
- Extract the catalog dedup crash-guard into a shared dedupeBy helper used by
  both catalog hooks and cover it with unit tests.
@ardaerzin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
web/packages/agenta-entities/src/gatewayTool/core/types.ts (1)

41-45: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Comment block exceeds one-line guideline.

This 5-line comment exceeds the repo's comment-length convention. Consider trimming to a single concise line, or keep only if the constraint truly needs the extra context.

As per coding guidelines, "Keep in-code comments to one short line maximum unless a genuinely surprising constraint requires a brief exception."

Source: Coding guidelines

web/packages/agenta-entities/tests/unit/gatewayTool-dedupe.test.ts (1)

1-7: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Comment block exceeds one-line guideline.

This 7-line file-header comment exceeds the repo's comment-length convention.

As per coding guidelines, "Keep in-code comments to one short line maximum unless a genuinely surprising constraint requires a brief exception."

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4c6bba2c-59c5-4b4f-84c0-5a95cb6abcaf

📥 Commits

Reviewing files that changed from the base of the PR and between d30987f and 458c5ce.

📒 Files selected for processing (8)
  • web/packages/agenta-entities/src/gatewayTool/api/api.ts
  • web/packages/agenta-entities/src/gatewayTool/core/dedupe.ts
  • web/packages/agenta-entities/src/gatewayTool/core/index.ts
  • web/packages/agenta-entities/src/gatewayTool/core/types.ts
  • web/packages/agenta-entities/src/gatewayTool/hooks/useToolCatalogCategories.ts
  • web/packages/agenta-entities/src/gatewayTool/hooks/useToolCatalogIntegrations.ts
  • web/packages/agenta-entities/tests/unit/gatewayTool-dedupe.test.ts
  • web/packages/agenta-entity-ui/src/drawers/shared/CatalogChooser.tsx
✅ Files skipped from review due to trivial changes (2)
  • web/packages/agenta-entities/src/gatewayTool/core/dedupe.ts
  • web/packages/agenta-entities/src/gatewayTool/core/index.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • web/packages/agenta-entities/src/gatewayTool/hooks/useToolCatalogCategories.ts
  • web/packages/agenta-entities/src/gatewayTool/hooks/useToolCatalogIntegrations.ts
  • web/packages/agenta-entities/src/gatewayTool/api/api.ts
  • web/packages/agenta-entity-ui/src/drawers/shared/CatalogChooser.tsx

…hold

The header flipped to "Results" and un-highlighted the category at 1 typed
char, but the browse query only treats a search as active at >=3 chars, so a
1-2 char query still showed category-filtered results under a "Results" label.
Gate the searching state on a searchMinChars prop (default 3, matching the
consumer hooks) so the UI reflects when the search actually applies and the
category context is preserved until then.
@ardaerzin

ardaerzin commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ardaerzin ardaerzin marked this pull request as ready for review July 3, 2026 19:40
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. feature Frontend labels Jul 3, 2026
@ardaerzin ardaerzin merged commit 0b7cbad into big-agents Jul 3, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Frontend lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants