Skip to content

fix(chat): disambiguate folder mentions - #6804

Open
BillLeoutsakosvl346 wants to merge 3 commits into
stagingfrom
fix/disambiguate-folder-mentions
Open

fix(chat): disambiguate folder mentions#6804
BillLeoutsakosvl346 wants to merge 3 commits into
stagingfrom
fix/disambiguate-folder-mentions

Conversation

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor

Summary

  • show the resource family on workflow-folder and file-folder rows in flat @ mention results
  • reuse existing folder ancestry data to show root-first parent paths with middle truncation
  • keep nested browse menus, selection behavior, APIs, and persisted mentions unchanged

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other

Testing

  • targeted resource mention tests: 8 passed
  • bun run lint:check: 24/24 tasks passed
  • bun run type-check: 24/24 tasks passed
  • git diff --check
  • manually verified on localhost that same-named Enterprise folders render as Files and Workflows

Reviewers should focus on the flat @ autocomplete and filtered + menu at narrow widths; nested browsing is intentionally unchanged.

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)

Screenshots/Videos

Manually verified in localhost using same-named workflow and file folders; the right-side labels display Files and Workflows.

@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 18, 2026 1:53am

Request Review

@cursor

cursor Bot commented Aug 18, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Display-only UI in autocomplete and search results; logic is covered by new unit tests and does not touch APIs or persisted mentions.

Overview
Flat @ mention rows for workflow and file folders now show a right-aligned family label (Workflows / Files) and root-first parent path, so same-named folders (e.g. two “Enterprise” folders) are distinguishable without changing nested browse, selection, or persisted mentions.

buildFolderMentionLocationMap derives display-only locations from existing folder ancestry (handles missing parents and cycles). MentionRowContent applies that only when a location exists: it caps the name width and renders FolderPathLabel; rows without a location stay unwrapped so trailing ml-auto content (e.g. log timestamps) still pins to the row edge. Mention dropdown width is increased slightly for the extra column.

FolderPathLabel (with collapseFolderPath) centralizes path rendering: deep paths collapse to root / … / leaf instead of mid-word clipping. The sidebar search command-items swap their local folder-path UI to this shared component.

Reviewed by Cursor Bugbot for commit a9a5c7f. Configure here.

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author
image

@greptile-apps

greptile-apps Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds display-only folder-family and ancestry labels to flat resource mentions while preserving nested browsing and persisted mention behavior.

  • Builds root-first folder-location metadata from visible workflow and file folder groups.
  • Introduces a shared folder-path label with middle truncation.
  • Reuses the label in workspace search results and adjusts mention-menu sizing.
  • Adds focused tests for ancestry, cyclic and missing parents, path collapsing, and row layout.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/plus-menu-dropdown/resource-mention-items.ts Builds display-only family and ancestor metadata for folder mention rows, including guarded handling of missing and cyclic ancestry.
apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/plus-menu-dropdown/mention-row-content.tsx Adds folder location labels while preserving direct flex children for resource rows without location metadata.
apps/sim/app/workspace/[workspaceId]/home/components/user-input/components/plus-menu-dropdown/plus-menu-dropdown.tsx Integrates folder location metadata into flat mention results and widens the responsive mention dropdown.
apps/sim/components/ui/folder-path-label.tsx Introduces a reusable root-first folder-path label that retains root and leaf segments for deep paths.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/search-modal/components/command-items/command-items.tsx Replaces duplicated search-result folder-path rendering with the shared label component.

Reviews (3): Last reviewed commit: "fix(chat): keep the log row's timestamp ..." | Re-trigger Greptile

Bill Leoutsakos and others added 2 commits August 17, 2026 18:40
The mention menu's folder location and the cmd-K row's folder receipt were two
copies of the same flex-shrink layout. Both now render `FolderPathLabel`, which
collapses ancestors past the third into a single `…` segment so a deep path
drops whole folders instead of clipping one mid-word.

Mention rows also cap the name at 65% and fix the popover at 380px, so the
location column keeps a stable right edge and can never be squeezed out by a
long resource name.
@waleedlatif1
waleedlatif1 force-pushed the fix/disambiguate-folder-mentions branch from e218963 to 99a22d8 Compare August 18, 2026 01:40
@waleedlatif1

Copy link
Copy Markdown
Collaborator

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator

@cursor review

The name wrapper added for folder locations was applied to every flat mention
row, which broke the log row: it pins its timestamp with `ml-auto`, and that
only reaches the right edge while the row button is its flex parent. Inside a
content-sized wrapper the timestamp collapsed back beside the workflow name.

`MentionRowContent` now wraps only the rows that actually render a location and
carries the invariant in one place, with a test that fails if the unwrapped
path regresses.
@waleedlatif1

Copy link
Copy Markdown
Collaborator

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ 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 a9a5c7f. Configure here.

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