improvement(sidebar): interleave folders and workflows by sort order in all resource pickers#4215
Conversation
…in all resource pickers - Merge folder/workflow submenus into a single Workflows tree sorted by sortOrder in both the @ plus-menu and add-resource dropdowns - Widen both dropdowns from 240px to 320px and remove type labels from search results - Fix isOpen/onSwitch regression: WorkflowFolderTreeItems now forwards node.isOpen so already-open tabs are switched to rather than duplicated - Apply same interleaved sortOrder ordering to the collapsed sidebar's root-level folder+workflow list
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview Both dropdowns are widened to In the collapsed sidebar workflow flyout, root-level folders and workflows are now merged and sorted together (using Reviewed by Cursor Bugbot for commit 91da7df. Configure here. |
Greptile SummaryThis PR merges the separate Folders and Workflows submenus into a single interleaved tree (sorted by Previous review concerns have been fully addressed: the empty-folder omission is now documented with a comment, and the intentional Confidence Score: 5/5Safe to merge — no P0 or P1 issues found; all prior review concerns are resolved. The tree-building logic is a pure function with correct sorting and tie-breaking. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["useAvailableResources()\n(workflowItems + folderItems with folderId/sortOrder)"] --> B["buildWorkflowFolderTree()"]
B --> C["WorkflowTreeNode[]\n(interleaved by sortOrder)"]
C --> D["AddResourceDropdown\nworkflowTree useMemo"]
C --> E["PlusMenuDropdown\nworkflowTree useMemo"]
D --> F["WorkflowFolderTreeItems\nonSelect = select()\n(handles isOpen → onSwitch)"]
E --> G["WorkflowFolderTreeItems\nonSelect = handleSelect()\n(isOpen ignored — chat context)"]
F --> H["DropdownMenuSub (folder)\nor DropdownMenuItem (workflow)"]
G --> H
subgraph "Sidebar (collapsed flyout)"
I["folderTree + workflowsByFolder.root"] --> J["collapsedRootItems useMemo\n.sort(compareByOrder)"]
J --> K["CollapsedFolderItems nodes=[item.node]\nor CollapsedWorkflowFlyoutItem"]
end
Reviews (2): Last reviewed commit: "chore: remove extraneous inline comment" | Re-trigger Greptile |
…, document empty-folder omission Use id.localeCompare as the sort tiebreaker in buildWorkflowFolderTree to match the sidebar's compareByOrder fallback (sortOrder → id) instead of name. Add a comment clarifying that empty folders are intentionally omitted from the tree view.
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 91da7df. Configure here.
Summary
sortOrder-based ordering) in both the@plus-menu dropdown and the add-resource dropdownisOpen/onSwitchregression:WorkflowFolderTreeItemsnow forwardsnode.isOpenso clicking an already-open workflow switches to its existing tab instead of creating a duplicatesortOrderordering to the collapsed sidebar's root-level folder+workflow flyout listTest plan
@plus-menu in Mothership — Workspace submenu shows a single Workflows tree with folders and workflows interleaved by sort order+in resource tabs) — same Workflows tree structure and ordering