fix(chat): show table and knowledge base folders in the resource menus - #6190
Conversation
Tables and knowledge bases gained folder support, but the chat attachment menu and the embedded resource menu still listed them flat. Both now render the same hierarchy the Tables and Knowledge pages show. Unifies the two near-duplicate workflow/file tree builders into one shared buildResourceFolderTree plus a spec-driven useResourceTreeSections, so all four foldered families go through one code path. Items whose folder no longer resolves now surface at the root instead of vanishing.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Duplicate workflow/file tree logic is replaced by a shared Items whose folder no longer exists surface at the root instead of disappearing (including a latent files-menu case). Ten unit tests cover nesting, orphan healing, pruning, sort order, and parent cycles. Reviewed by Cursor Bugbot for commit 48f1da4. Configure here. |
Greptile SummaryThe PR adds folder-aware table and knowledge-base browsing to both resource menus while consolidating all foldered resource families onto a shared tree builder and renderer.
Confidence Score: 5/5The PR appears safe to merge, with no concrete changed-code defect identified. The shared hierarchy preserves existing rendering and selection contracts, handles unresolved parents safely, updates reactively as folder queries resolve, and is exercised by focused tree-builder tests.
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/add-resource-dropdown/add-resource-dropdown.tsx | Consolidates foldered resource fetching, section construction, rendering, and flat-list suppression without an identified contract break. |
| apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/add-resource-dropdown/resource-folder-tree.ts | Adds a generic deterministic tree builder with orphan recovery, empty-folder pruning, and optional sort-order handling. |
| apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/add-resource-dropdown/resource-folder-tree.test.ts | Covers the shared builder’s nesting, source preservation, orphan, pruning, ordering, and cycle behavior. |
| apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/plus-menu-dropdown/plus-menu-dropdown.tsx | Replaces duplicated workflow and file rendering with shared foldered sections, adding table and knowledge-base hierarchy support. |
| apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/add-resource-dropdown/index.ts | Updates the module’s public exports to expose the shared tree-section APIs. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Resources[Resource groups] --> Specs[FOLDERED_SECTION_SPECS]
Folders[Workflow, file, table, and KB folders] --> Specs
Specs --> Builder[buildResourceFolderTree]
Builder --> Sections[ResourceTreeSections]
Sections --> Embedded[Embedded resource dropdown]
Sections --> Chat[Chat attachment and mention menu]
Reviews (1): Last reviewed commit: "fix(chat): show table and knowledge base..." | Re-trigger Greptile
Summary
+/@) and the embedded resource menu still listed them flat — both now show the same hierarchy as the Tables and Knowledge pagesbuildResourceFolderTree/ResourceFolderTreeItems/ResourceTreeSections, so all four foldered families (workflows, files, tables, KBs) go through one code pathFOLDERED_SECTION_SPECStable now drives display order, folder source, ordering, and folder selectability — the skip-set is derived from it, so a new family can't be added in one place and missed in the other (which would render it twice)Type of Change
Testing
tsc -p apps/simclean,bun run lint:checkcleanNotes / follow-ups (not in this PR)
folderPath, while workflows and files include it — the receiving UI already renders the breadcrumbtables/andknowledgebases/are flat namespaces — that's the reason the "not attachable" call above is a deferral rather than a resolutioncalc(100vw-32px)) arguably belongs in emcn'sDropdownMenuSubContentfor every submenu, not as a consumer overrideChecklist