Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

@waleedlatif1 waleedlatif1 commented Jan 10, 2026

Summary

  • context menu for nav items in sidebar
  • context menu for blocks in toolbar
  • added missing docsLink for blocks/triggers that were missing it
  • added docsLink for subflows

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 10, 2026

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

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 10, 2026 1:50am

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 10, 2026

Greptile Overview

Greptile Summary

This PR adds right-click context menus for sidebar navigation items and toolbar blocks/triggers, along with missing documentation links across the codebase.

Key Changes

New Context Menu Components

  • NavItemContextMenu: Provides "Open in new tab" and "Copy link" options for footer navigation items (Logs, Templates, Knowledge Base)
  • ToolbarItemContextMenu: Provides "Add to canvas" and optional "View documentation" options for triggers and blocks in the toolbar

Implementation Pattern

Both new components follow the established context menu pattern in the codebase:

  • Use the existing useContextMenu hook for state management
  • Leverage EMCN Popover components with fixed positioning
  • Implement proper click-outside detection and cleanup
  • Follow consistent styling with variant='secondary', size='sm', and colorScheme='inverted'

Documentation Links

  • Added docsLink property to 10+ blocks and triggers (discord, fireflies, generic_webhook, grain, imap, router, rss, start_trigger, twilio, twilio_voice)
  • Added docsLink property to subflow configurations (Loop and Parallel)
  • Updated fireflies block to use internal docs instead of external Fireflies documentation
  • Enabled "View documentation" button for subflows in the editor panel

Consistency Improvements

Updated 10+ existing context menu components to use the consistent onOpenChange={(open) => !open && onClose()} pattern instead of directly passing onClose. This ensures the Radix UI Popover onOpenChange callback receives the boolean parameter correctly.

Minor Improvements

  • Updated hardcoded colors in tool-input.tsx to use CSS variables for better theme consistency
  • Removed unused imports (RepeatIcon, SplitIcon) from editor.tsx after refactoring to use config objects

Issues Found

Critical Issue: Domain Inconsistency

The subflow configurations (loop-config.ts and parallel-config.ts) use docs.simstudio.ai while all other blocks in the codebase use docs.sim.ai. This inconsistency should be resolved to maintain uniformity and prevent potential broken links if one domain becomes deprecated.

Confidence Score: 4/5

  • This PR is generally safe to merge with one domain inconsistency issue that needs fixing
  • Score reflects well-implemented context menu features following established patterns, with comprehensive docsLink additions across the codebase. However, the subflow configurations (loop and parallel) use an inconsistent domain (docs.simstudio.ai vs docs.sim.ai) which could lead to broken documentation links and should be corrected before merging.
  • Pay attention to loop-config.ts and parallel-config.ts - they contain inconsistent documentation URLs that need to be corrected to match the rest of the codebase

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/nav-item-context-menu/nav-item-context-menu.tsx 5/5 New context menu component for sidebar navigation items with "Open in new tab" and "Copy link" options. Implementation follows established patterns correctly.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/toolbar/components/toolbar-item-context-menu/toolbar-item-context-menu.tsx 5/5 New context menu component for toolbar items with "Add to canvas" and optional "View documentation" options. Implementation is correct and consistent.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx 5/5 Integrated NavItemContextMenu for footer navigation items. Context menu handlers properly manage state and execute navigation actions.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/toolbar/toolbar.tsx 5/5 Integrated ToolbarItemContextMenu for triggers and blocks. Context menu properly captures docsLink from block configs and subflow configs.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/subflows/loop/loop-config.ts 3/5 Added docsLink property, but uses inconsistent domain (docs.simstudio.ai instead of docs.sim.ai used by all other blocks).
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/subflows/parallel/parallel-config.ts 3/5 Added docsLink property, but uses inconsistent domain (docs.simstudio.ai instead of docs.sim.ai used by all other blocks).
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/editor.tsx 5/5 Updated to use subflow config objects (LoopTool, ParallelTool) for icon, bgColor, and docsLink. Enables "View documentation" button for subflows.

Sequence Diagram

sequenceDiagram
    participant User
    participant NavItem as Sidebar Nav Item
    participant Sidebar
    participant NavItemContextMenu
    participant Browser

    User->>NavItem: Right-click on nav item (Logs/Templates/Knowledge Base)
    NavItem->>Sidebar: onContextMenu event with href
    Sidebar->>Sidebar: handleNavItemContextMenu(e, href)
    Sidebar->>Sidebar: setActiveNavItemHref(href)
    Sidebar->>Sidebar: handleNavContextMenuBase(e)
    Note over Sidebar: useContextMenu hook updates state
    Sidebar->>NavItemContextMenu: Render with isOpen=true, position={x, y}
    
    alt User clicks "Open in new tab"
        User->>NavItemContextMenu: Click "Open in new tab"
        NavItemContextMenu->>Sidebar: onOpenInNewTab()
        Sidebar->>Browser: window.open(activeNavItemHref, '_blank')
        NavItemContextMenu->>Sidebar: onClose()
        Sidebar->>Sidebar: closeNavContextMenu(), setActiveNavItemHref(null)
    else User clicks "Copy link"
        User->>NavItemContextMenu: Click "Copy link"
        NavItemContextMenu->>Sidebar: onCopyLink()
        Sidebar->>Browser: navigator.clipboard.writeText(fullUrl)
        NavItemContextMenu->>Sidebar: onClose()
        Sidebar->>Sidebar: closeNavContextMenu(), setActiveNavItemHref(null)
    else User clicks outside
        User->>Browser: Click outside menu
        Browser->>Sidebar: Click event (via useContextMenu hook)
        Sidebar->>NavItemContextMenu: Popover onOpenChange(false)
        NavItemContextMenu->>Sidebar: onClose()
        Sidebar->>Sidebar: closeNavContextMenu(), setActiveNavItemHref(null)
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

6 files reviewed, 6 comments

Edit Code Review Agent Settings | Greptile

…text menus and added docs for missing blocks
@waleedlatif1
Copy link
Collaborator Author

@greptile

@waleedlatif1 waleedlatif1 changed the title feat(sidebar): context menu for nav items in sidebar feat(sidebar): context menu for nav items in sidebar, toolbar blocks, added missing docs for various blocks and triggers Jan 10, 2026
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit 1dbd161 into staging Jan 10, 2026
6 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/cm branch January 10, 2026 01:50
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