Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • add the ability to create a folder within a folder in popover

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 Dec 10, 2025

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

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Dec 10, 2025 6:58pm

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 10, 2025

Greptile Overview

Greptile Summary

Implemented the ability to create sub-folders within folders through the context menu popover. The change extends the existing ContextMenu component with new props (onCreateFolder, showCreateFolder, disableCreateFolder) following the same pattern as the existing "Create workflow" feature. The FolderItem component was updated to use the useCreateFolder hook and wire up the new handler, properly disabling the option based on user permissions and pending state.

  • Added "Create folder" option to folder context menu
  • Implemented handleCreateFolderInFolder handler following established patterns
  • Properly integrated with optimistic updates via useCreateFolder hook
  • Applied correct permission checks and loading state handling

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation follows established patterns in the codebase, properly reuses existing hooks (useCreateFolder), applies correct permission checks, handles loading states appropriately, and maintains consistency with the existing "Create workflow" feature. The changes are well-structured, type-safe, and include proper error handling.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workflow-list/components/context-menu/context-menu.tsx 5/5 Added onCreateFolder, showCreateFolder, and disableCreateFolder props to support creating sub-folders in the context menu
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workflow-list/components/folder-item/folder-item.tsx 5/5 Added handleCreateFolderInFolder function using useCreateFolder hook to enable nested folder creation from context menu

Sequence Diagram

sequenceDiagram
    participant User
    participant FolderItem
    participant ContextMenu
    participant useCreateFolder
    participant API
    participant FolderStore

    User->>FolderItem: Right-click on folder
    FolderItem->>ContextMenu: Opens context menu
    User->>ContextMenu: Clicks "Create folder"
    ContextMenu->>FolderItem: Calls onCreateFolder()
    ContextMenu->>ContextMenu: Closes menu
    FolderItem->>useCreateFolder: mutateAsync({workspaceId, name, parentId})
    useCreateFolder->>FolderStore: Apply optimistic update
    FolderStore-->>FolderItem: UI updates immediately
    useCreateFolder->>API: POST /api/folders
    API-->>useCreateFolder: Returns new folder data
    useCreateFolder->>FolderStore: Replace temp ID with real ID
    FolderStore-->>FolderItem: UI updates with real data
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.

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit bbbb13a into staging Dec 10, 2025
9 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/folders branch December 10, 2025 19:20
waleedlatif1 added a commit that referenced this pull request Dec 10, 2025
* feat(folders): add the ability to create a folder within a folder in popover (#2287)

* fix(agent): filter out empty params to ensure LLM can set tool params at runtime (#2288)

* fix(mcp): added backfill effect to add missing descriptions for mcp tools (#2290)

* fix(redis): cleanup access pattern across callsites (#2289)

* fix(redis): cleanup access pattern across callsites

* swap redis command to be non blocking

* improvement(log-details): polling, trace spans (#2292)

---------

Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com>
Co-authored-by: Emir Karabeg <78010029+emir-karabeg@users.noreply.github.com>
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