Skip to content
Source
Sign inSign up
pingdotgg/t3code

Improve markdown file link UX #1956

Mergedjustsomelegs(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/1956/headmerged by juliusmarminge View on GitHub

What Changed

This tightens the UX for markdown-rendered local file links and keeps file-path presentation more consistent across assistant surfaces.

  • Render local markdown file links as dedicated inline file chips instead of plain links
  • Add file icons, hover tooltip paths, right-click actions, and line/column labels when present
  • Disambiguate duplicate basenames inline within the same markdown message
  • Format displayed file paths from the workspace/repo root instead of absolute machine paths where possible
  • Reuse that repo-relative formatting in timeline changed-file previews/badges
  • Split markdown chip styling away from composer chips and restyle it to match markdown inline code more closely
  • Memoize markdown file chips so identical links do less work during streaming
  • Stabilize the touched timeline test under full-suite load

Why

Assistant messages were hard to scan when they referenced the same filename multiple times, especially when the visible markdown text was just menu.tsx or MessagesTimeline.tsx repeatedly. The useful context existed in the href, but the UI was not surfacing it well.

This approach keeps the change small and local to existing rendering paths:

  • improves readability without changing message semantics
  • keeps normal web links untouched
  • preserves editor-open behavior
  • avoids duplicating path-formatting logic by extracting a shared formatter
  • makes markdown file refs feel like part of prose rather than composer UI

UI Changes

Before:

  • local file refs looked like normal links
  • repeated basenames were hard to distinguish
  • tooltips showed machine-absolute paths
  • markdown file refs visually felt disconnected from nearby inline code

After:

  • local file refs render as inline file chips
  • duplicate basenames gain inline suffix disambiguation when needed
  • tooltips show workspace-relative paths
  • chip styling now sits closer to markdown inline code

Screenshots: CHIPS Screenshot 2026-04-12 133217 CONTEXT MENU Screenshot 2026-04-12 131112 HOVER TOOLTIP Screenshot 2026-04-12 130612

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

  • File links in chat markdown now render as styled inline elements with a VSCode icon, a label that includes line/column info (e.g. filename · L1:C7), and parent path segments to disambiguate duplicate basenames.
  • Clicking a file link opens it in the preferred editor at the specified line/column; a context menu offers options to copy the relative or full path, with toast feedback.
  • Adds resolveMarkdownFileLinkMeta in markdown-links.ts and formatWorkspaceRelativePath in filePathDisplay.ts to support structured metadata and workspace-relative display paths.
  • File paths in MessagesTimeline work entry rows and previews are now formatted relative to the workspace root.
  • Non-file HTTP(S) links continue to open in a new tab unchanged.
Macroscope summarized b85c801.

Note

Medium Risk Mostly UI/UX changes, but it touches link handling and editor-opening/context-menu behavior; mistakes could break navigation or open/copy actions for file links across chat surfaces.

Overview Improves local markdown file-link UX by replacing plain anchors with memoized inline file chips that show VS Code-style icons, tooltips, and context-menu actions (open in editor, copy relative/full path), while keeping normal external links unchanged.

Adds resolveMarkdownFileLinkMeta + formatWorkspaceRelativePath to compute workspace-relative display paths and parse line/column info, uses that metadata to label links as basename · parentSuffix · Lx(:Cy) (disambiguating duplicate basenames), and reuses the same path formatting for MessagesTimeline changed-file previews/badges.

Updates CSS for the new chip styling and expands/adjusts tests to cover line/column labels, basename disambiguation, web-link passthrough, and timeline path formatting.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit b85c8018f4514d1e1d29db9ea7b0284759e892e5. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: 614b202f-11f3-4883-b5ad-d5e2e9f986b5

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      Introduces a new interactive file link UX with styled chips, tooltips, context menus, and path disambiguation logic. While self-contained to the UI layer with good test coverage, the volume of new user-facing behavior (~800 lines of new components and utilities) represents a meaningful new feature that benefits from human review.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Cursor Bugbot has reviewed your changes and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit b85c8018f4514d1e1d29db9ea7b0284759e892e5. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -143,3 +153,8 @@
      143153 if (!cwd) return null;
      144154 return resolvePathLinkTarget(pathWithPosition, cwd);
      145155 }
      156+
      157+function basenameOfPath(path: string): string {
      158+ const separatorIndex = Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\"));
      159+ return separatorIndex >= 0 ? path.slice(separatorIndex + 1) : path;
      160+}

      Duplicate basenameOfPath in two new files

      Low Severity

      Two identical private basenameOfPath functions are introduced in markdown-links.ts and filePathDisplay.ts. Both compute the basename by finding the last / or \\ separator. A single shared utility (or reuse/extension of the existing basenameOfPath export in vscode-icons.ts) would avoid the duplication.

      Additional Locations (1)
      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit b85c8018f4514d1e1d29db9ea7b0284759e892e5. Configure [here](https://www.cursor.com/dashboard/bugbot).
    5. juliusmarminge merged this68061af

    6. juliusmarminge closed this

Sign in to join this conversation.