Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • added operations to search modal in main app
    • when the selected option maps to an operation for a tool, then it adds that block to the canvas with that operation pre-selected
  • updated retrieval in docs to use RRF, fixed some broken links because of it appending index.ts after the base URL

Type of Change

  • New Feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Jan 19, 2026

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

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Jan 19, 2026 9:55pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 19, 2026

Greptile Summary

This PR enhances the search modal with operation-level discovery and improves documentation search using Reciprocal Rank Fusion (RRF).

Main app search enhancements:

  • Added tool operations to search modal, enabling users to search for specific operations like "Slack: Send Message" or "Gmail: Read Email"
  • Implemented alias matching system with synonym support (e.g., "post" matches "send", "fetch" matches "get")
  • When selecting a tool operation from search, the block is added to canvas with that operation pre-selected

Documentation search improvements:

  • Replaced simple result interleaving with RRF algorithm for better hybrid search ranking
  • Added title boost scoring to prioritize exact filename matches
  • Improved locale filtering and breadcrumb formatting (filters out index and locale prefixes)
  • Fixed URL generation to handle index.mdx files correctly (e.g., triggers/index.mdx/triggers not /triggers/index)

All changes follow established patterns and integrate cleanly with existing architecture.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Well-structured implementation with proper error handling, follows project patterns, and includes thorough documentation. The changes are additive and don't modify critical existing logic.
  • No files require special attention

Important Files Changed

Filename Overview
apps/sim/lib/search/tool-operations.ts New file that builds searchable index of tool operations from block configurations with synonym aliases
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.tsx Integrated tool-operation search type and dispatches preset operations when selected
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx Added presetSubBlockValues parameter to apply preset operation values from search
apps/docs/app/api/search/route.ts Replaced simple interleaving with RRF algorithm, improved locale filtering and breadcrumb formatting

Sequence Diagram

sequenceDiagram
    participant User
    participant SearchModal
    participant ToolOpsIndex as tool-operations.ts
    participant SearchUtils as search-utils.ts
    participant Workflow
    participant Canvas

    Note over User,Canvas: Tool Operation Search Flow

    User->>SearchModal: Opens search modal (Cmd+K)
    SearchModal->>ToolOpsIndex: getToolOperationsIndex()
    ToolOpsIndex->>ToolOpsIndex: buildToolOperationsIndex()<br/>(if not cached)
    ToolOpsIndex-->>SearchModal: Return tool operations with aliases

    User->>SearchModal: Types search query (e.g., "post message")
    SearchModal->>SearchUtils: searchItems(query, allItems)
    SearchUtils->>SearchUtils: calculateAliasScore()<br/>("post" matches "send")
    SearchUtils-->>SearchModal: Sorted results with scores

    SearchModal->>User: Display "Slack: Send Message"<br/>(matched via alias)

    User->>SearchModal: Selects tool operation
    SearchModal->>SearchModal: handleItemClick(item)
    SearchModal->>Workflow: dispatchEvent('add-block-from-toolbar',<br/>{type, presetOperation})

    Workflow->>Workflow: addBlock(..., presetSubBlockValues)
    Workflow->>Canvas: collaborativeBatchAddBlocks()<br/>with operation preset

    Canvas->>User: Block added with<br/>operation pre-selected
Loading

@waleedlatif1 waleedlatif1 merged commit 3c43779 into staging Jan 19, 2026
11 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/search branch January 19, 2026 21:57
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.

2 participants