Skip to content

feat: add per-app component search#361

Open
Kateřina Beňová (KatBen-Make) wants to merge 5 commits into
masterfrom
feat/app-component-search
Open

feat: add per-app component search#361
Kateřina Beňová (KatBen-Make) wants to merge 5 commits into
masterfrom
feat/app-component-search

Conversation

@KatBen-Make

@KatBen-Make Kateřina Beňová (KatBen-Make) commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Jira: https://make.atlassian.net/browse/IEN-15704

Summary

Adds a per-app component search. Right-click an app in the Custom apps tree → Search components... opens a Quick Pick listing that app's connections, webhooks, modules, RPCs and functions, filterable by label or name (handy when a component's internal name differs from its label). Selecting a result reveals and selects the component in the tree.

Details

  • New shared helper src/libs/app-component-search.ts:
    • fetchAppComponentsSummary() fetches all five component types, faithfully mirroring the level-2 logic in AppsProvider.getChildren (v1/v2 response unwrap, unversioned connection/webhook URIs, tree label fallbacks). Each type is fetched independently so one failing/missing endpoint doesn't break the rest, and failedGroups lets the caller tell a genuinely empty app from a failed load.
    • buildComponentTreeItem() rebuilds a node with deterministic ids matching the lazy tree, so TreeView.reveal resolves it.
  • AppsProvider exposes thin delegating methods (logic kept in src/libs/ to avoid duplication across tree providers, per repo convention).
  • New command apps-sdk.app.search-components (in extension.ts): withProgress fetch → Quick Pick (matchOnDescription/matchOnDetail) → reveal. Wrapped in catchError, guarded by contextGuard. Does not call refresh() (preserves the background icon cache).
  • package.json: command contribution + view/item/context entry (viewItem =~ /^app/) so it appears on every app variant.

Test plan

  • Right-click an app → Search components...; verify the Quick Pick lists modules, RPCs, connections, webhooks and functions.
  • Search by a component name that differs from its label → it still matches.
  • Select a result → the component is revealed and selected in the tree (app/group auto-expand).
  • App with no components → "No components found in this app."
  • Unit tests: src/libs/app-component-search.test.ts (id contract, v1/v2 unwrap, label fallback) run in CI.

Notes

  • Hover-to-open navigation for rpc:// / IML function references is intentionally out of scope; planned as a follow-up branch that will reuse this helper.

Right-click an app in the Custom apps tree -> "Search components..." opens a
Quick Pick listing the app's connections, webhooks, modules, RPCs and functions,
filterable by label or name (useful when a component's name differs from its
label). Selecting a result reveals and selects the component in the tree.

Shared fetch/build logic lives in src/libs/app-component-search.ts and is consumed
by AppsProvider to avoid duplicating it across tree providers. A failed component
fetch is distinguished from a genuinely empty app so the "no components" message
is not shown on top of an error.

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings June 26, 2026 14:59
@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown
Messages
Your PR title & description are valid

Generated 26. 6. 2026 18:55:21 GMT+2 for f79a094

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a per-app “Search components…” action in the Custom apps tree, enabling a Quick Pick search across an app’s connections/webhooks/modules/RPCs/functions (matching by label or internal name) and revealing the selected component in the tree.

Changes:

  • Introduces a shared src/libs/app-component-search.ts helper to fetch component summaries across multiple endpoints and rebuild reveal-compatible tree items.
  • Exposes thin delegation methods on AppsProvider and wires a new command (apps-sdk.app.search-components) into extension activation.
  • Adds unit tests for response unwrapping, label fallback, and the deterministic tree-id contract; contributes the command + context menu entry in package.json.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/providers/AppsProvider.js Adds delegating methods to fetch per-app component summaries and rebuild tree items for reveal.
src/libs/app-component-search.ts New shared helper implementing multi-group fetch + summary mapping + reveal-compatible Item reconstruction.
src/libs/app-component-search.test.ts Unit tests covering id contract, v1/v2 unwrap behavior, and label/type mapping.
src/extension.ts Registers the new app context-menu command: progress fetch → Quick Pick → TreeView.reveal.
package.json Contributes the new command and adds it to the Custom apps view item context menu.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/libs/app-component-search.ts Outdated
Connections use a string type (e.g. 'oauth') in the tree model (Item.type),
not just a numeric module type id. Widen the type and clarify the JSDoc so the
summary faithfully mirrors Item.type and connection type info is not misrepresented.

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread src/libs/app-component-search.ts
Comment thread src/libs/app-component-search.ts
The label fallback (`name + args`) in toComponentSummary is not gated on
component type; it applies to any type and in practice only functions lack a
label. Reword the interface JSDoc and function comment to match the behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread src/libs/app-component-search.ts
buildComponentTreeItem used the API plural (e.g. "modules") as the Group label,
whereas the real tree humanizes it ("Modules", "Remote procedures"). reveal may
render the passed parent chain, so this could show the wrong label/casing. Map
groupPlural to the same labels as AppsProvider.getChildren while keeping the
deterministic id (groupPlural) reveal matches on.

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread src/libs/app-component-search.ts Outdated
Comment thread src/libs/app-component-search.ts
- fetchAppComponentsSummary: rpGet already logs the failure at error level via
  showAndLogError before throwing, so downgrade the per-group catch to warn and
  guard against non-Error throws (String(err)).
- buildComponentTreeItem: rebuild the group/item pending-change subsets from
  appNode.changes (same group normalization + item filter as getChildren) so a
  revealed node renders the "changed" marker like the lazily-built tree, instead
  of always passing changes = [].

Co-authored-by: Cursor <cursoragent@cursor.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@KUSTIKs Artem Khvostyk (KUSTIKs) 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.

In general I see a lot of any types. Is it possible to define them more strictly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants