Skip to content

improvement(chat): show resource-type icons on inline workspace resource links#5669

Open
waleedlatif1 wants to merge 3 commits into
stagingfrom
feat/chat-resource-link-icons
Open

improvement(chat): show resource-type icons on inline workspace resource links#5669
waleedlatif1 wants to merge 3 commits into
stagingfrom
feat/chat-resource-link-icons

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Inline workspace-resource references in chat prose (workflows, tables, files) now render the resource-type icon before the name instead of the dashed underline
  • Reuses the exact same icon mapping as the user-input context chips via the shared ContextMentionIcon / CHAT_CONTEXT_KIND_REGISTRY, so file references get extension-aware document icons and workflows/tables match their chip glyphs
  • Links keep their click behavior (wsres-click dispatch) and primary text color; external links keep the dashed underline

Type of Change

  • Improvement

Testing

Tested manually; message-content suite passing, typecheck clean

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)

@vercel

vercel Bot commented Jul 14, 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 Jul 14, 2026 3:19am

Request Review

@cursor

cursor Bot commented Jul 14, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Presentation-only change in chat markdown link rendering; no auth, data, or navigation logic changes beyond existing wsres-click behavior.

Overview
Inline workspace resource links in chat markdown (#wsres-workflow-…, #wsres-table-…, #wsres-file-…) now show the same type icon as user context chips via ContextMentionIcon, using a small WSRES_LINK_KINDS map from href type to ChatContextKind.

For those kinds, styling switches from a dashed underline to an inline-flex row (icon + label, no underline). wsres-click handling is unchanged; link text for the event uses extractTextContent(children) instead of textContent. Unknown #wsres- types still use the dashed underline with no icon.

Reviewed by Cursor Bugbot for commit 0c43b41. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates inline workspace resource links in chat messages. The main changes are:

  • Adds resource-type icons for workflow, table, and file links.
  • Reuses the shared chat context icon registry.
  • Keeps dashed underline styling for unmapped workspace resource links.
  • Preserves the existing workspace resource click event flow.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/chat-content/chat-content.tsx Adds conditional icon rendering for known workspace resource links while keeping the fallback link affordance for unmapped resource types.

Reviews (3): Last reviewed commit: "fix(chat): keep dashed-underline afforda..." | Re-trigger Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@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 9b97c16. Configure here.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@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.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0c43b41. Configure here.

{kind && (
<ContextMentionIcon
context={{ kind, label }}
className='size-[14px] flex-shrink-0 text-[var(--text-icon)]'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

File icon ignores path

Medium Severity

Inline file links pass the visible link text into ContextMentionIcon as label, but extension-aware icons come from getDocumentIcon using that label. When the markdown label is a custom title without a file extension while the #wsres-file-… href still carries the VFS path, the chip shows a generic file icon instead of the type-specific glyph the PR describes.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0c43b41. Configure here.

'text-[var(--text-primary)]',
kind
? 'not-prose inline-flex items-center gap-[5px] no-underline'
: 'underline decoration-dashed underline-offset-4'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Icon without valid reference

Low Severity

Resource kind for styling is parsed with a looser #wsres-(\w+)- pattern than the click handler’s #wsres-(\w+)-(.+)$ rule. A malformed link such as #wsres-file- with an empty ref still gets the icon and no dashed underline, but the click path never dispatches wsres-click because the stricter regex does not match.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0c43b41. 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.

1 participant