fix(files): navigate sim file mentions - #7000
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview File destinations drop the obsolete The collab read-only placeholder now uses the same navigable mention wiring (tagging still off) so chips work before the live editor seeds. Reviewed by Cursor Bugbot for commit 9b547e3. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR enables ordinary-click navigation for file mention chips while preserving Cmd/Ctrl-click new-tab behavior and keeping non-navigable surfaces inert.
Confidence Score: 5/5The PR appears safe to merge, with no actionable correctness or security failures identified in the changed navigation paths. The changed click behavior remains gated by per-editor navigation configuration and an allowlisted path resolver, while destination paths, identifier encoding, read-only placeholder behavior, and modifier-click handling align with the existing route and editor contracts.
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/mention/mention-chip.tsx | Expands navigable mention chips from modifier-only activation to plain-click routing while retaining Cmd/Ctrl-click new-tab behavior. |
| apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/mention/sim-link.ts | Produces encoded, allowlisted resource paths and corrects file links to the existing canonical route. |
| apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/rich-markdown-editor.tsx | Gives the collaborative read-only placeholder isolated mention navigation configuration while keeping tagging disabled. |
| apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/mention/mention-chip.test.tsx | Adds coverage for ordinary clicks, modifier clicks, and all configured inert cases. |
| apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/rich-markdown-editor/mention/sim-link.test.ts | Updates route expectations and verifies workspace and resource identifiers remain single encoded URL components. |
Sequence Diagram
sequenceDiagram
actor User
participant Chip as Mention chip
participant Path as simLinkPath
participant Router as Next router
participant Tab as New browser tab
User->>Chip: Click mention
Chip->>Path: Resolve allowlisted resource path
alt Path unavailable or navigation disabled
Path-->>Chip: null
Chip-->>User: Remain inert
else Cmd/Ctrl-click
Path-->>Chip: Encoded canonical path
Chip->>Tab: window.open(path, _blank)
else Plain click
Path-->>Chip: Encoded canonical path
Chip->>Router: push(path)
end
Reviews (1): Last reviewed commit: "fix(files): navigate sim file mentions" | Re-trigger Greptile


Summary
sim:file/{fileId}mention chips navigate on plain click in authenticated workspace Markdown file surfaces./workspace/{workspaceId}/files/{fileId}and encode workspace/resource IDs.MentionChipViewgated all navigation behind Cmd/Ctrl, whilesimLinkPathstill emitted the obsolete/viewsuffix.Type of Change
Testing
apps/sim:bun run type-checkpassed before and after rebasing ontoorigin/staging.Targetmention chip;/viewsuffix;Checklist
Screenshots/Videos
Paired browser-control captures were recorded during the signed-in local verification:
sim-file-navigation-source-before.png: source file immediately before clicking theTargetchip.sim-file-navigation-destination-after.png: canonical destination showingSim File Navigation Target 2026-08-22after navigation.