fix(search): disambiguate tables and knowledge bases by folder - #6192
Conversation
The Cmd-K search modal listed tables and knowledge bases without the folder breadcrumb workflows and files already showed, and the table, knowledge base, and search-and-replace pickers in the workflow editor rendered bare names -- so two resources sharing a name in different folders were indistinguishable. Extracts the disambiguation the workflow selector already did into shared collectDuplicateNames + disambiguateLabelByFolder, and shares the search row's folder breadcrumb and its memo comparator, which were duplicated between the workflow and file rows. Also routes folder text through filterAndCap's secondary-rank parameter rather than concatenating it into the name, so an exact name match can no longer be outranked by a folder that happens to fuzzy-match.
The icon was a generic headset placeholder drawn in currentColor, so it never resembled Zoho at all. Replaces it with the mark from Zoho's official logo -- wordmark stripped, viewBox set to the mark's own bounding box so it centers -- and moves the tile to white, matching the other brand-mark integrations.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview Cmd-K search shows folder breadcrumbs for tables and knowledge bases (like workflows/files), and folder segments are searchable via Table selector still lowercases labels but detects collisions on the lowercased form so Zoho Desk branding: Reviewed by Cursor Bugbot for commit c3e6070. Configure here. |
Greptile SummaryThe PR makes tables and knowledge bases folder-aware across Cmd-K search, workflow selectors, and search-and-replace pickers while consolidating shared folder-label utilities. It also corrects fuzzy-search ranking inputs and replaces the Zoho Desk placeholder icon with its branded mark.
Confidence Score: 5/5The PR appears safe to merge with no concrete blocking or independently actionable non-blocking issues identified. The folder maps are keyed by resource type, hidden-resource queries and rows are gated consistently, folder paths are propagated through each intended surface, and shared disambiguation preserves the prior workflow-selector behavior while extending it to tables and knowledge bases.
|
| Filename | Overview |
|---|---|
| apps/sim/hooks/queries/utils/folder-tree.ts | Adds tested shared primitives for detecting duplicate labels and appending resource folder paths. |
| apps/sim/hooks/queries/workflow-search-replace.ts | Enriches table and knowledge-base replacement labels with resource-specific folder context. |
| apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx | Loads permission-gated table and knowledge-base folder maps and supplies resolved paths to search rows. |
| apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/search-modal.tsx | Routes folder names through the secondary fuzzy-search field to preserve primary-name ranking. |
| apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/components/command-items/command-items.tsx | Consolidates folder breadcrumb rendering and memo comparison across folder-aware search rows. |
| apps/sim/hooks/selectors/providers/sim/selectors.ts | Replaces private workflow-label helpers with the shared folder disambiguation primitives. |
| apps/sim/components/icons.tsx | Replaces the generic Zoho Desk placeholder with a fixed-color branded SVG mark. |
| apps/docs/components/icons.tsx | Mirrors the branded Zoho Desk icon update in the documentation application. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
F[Resource-specific folder maps] --> P[Resolve folder paths]
R[Workflows, tables, knowledge bases, files] --> P
P --> S[Cmd-K searchable breadcrumbs]
P --> D[Duplicate-name disambiguation]
D --> E[Editor selectors]
D --> X[Search-and-replace pickers]
Reviews (1): Last reviewed commit: "fix(zoho-desk): use the real Zoho Desk m..." | Re-trigger Greptile
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c3e6070. Configure here.

Summary
Follow-up to #6190, which made the chat resource menus folder-aware. Same gap, three more surfaces:
Shared abstraction
Rather than a fourth copy of the logic:
collectDuplicateNames+disambiguateLabelByFoldermoved intohooks/queries/utils/folder-tree.ts. The workflow selector's privatebuildDisambiguatedLabel/collectDuplicateNamesare deleted — workflows, tables, KBs, and search-replace now share one ruleFolderPathSuffix+sameFolderPathextracted in the search modal — that breadcrumb markup and its memo comparator were already duplicated between the workflow and file rowsgetFolderPathNamesadded next to the array-returninggetFolderPath, collapsing three copies of the same "names, or undefined at root" dance insidebar.tsxFolderedItemis now the single declaration of the foldered-row shape;WorkflowItemextends it andFileItemaliases itBugs found while reviewing
filterAndCap's existingtoExtraparameter, which exists for exactly this. Fixed for all four groups, not just the new twoLeadsandleadsrender identically but were not detected as a collision — neither got a folder suffix. Collisions are now detected on the lowercased form; the folder path keeps its authored casingfont-base(weight 420) while every other row inherits 400. Unified at 400 and the component now owns it, rather than a consumer passing aclassNameZoho Desk icon (second commit)
Separate commit in the same PR. The existing
ZohoDeskIconwas a generic headset placeholder incurrentColor— it never resembled Zoho. Replaced with the mark from Zoho's official logo (wordmark stripped, viewBox set to the mark's computed bounding box so it centers), and the tile moved#E42527→#FFFFFFto match other brand-mark integrations. Docs regenerated.Type of Change
Testing
tsc,bun run lint:check,check:react-query,check:api-validation,check:bare-icons,check:icon-pathsall passNotes
jira.mdx(deletes 126 lines of trigger Configuration tables) andfile.mdx(stalefile_compressdescription). Both are pre-existing drift unrelated to this change, andwebhookSecret/jqlFilterstill exist intriggers/jira/utils.ts— so that deletion looks like a generator regression, not a legitimate update. Excluded from this PR; worth a separate look before someone regenerates and loses it@-mention KB section (needsfolderIdthreaded through its fetch layer), the markdown editor@-menu, and the Recently Deleted restore listChecklist