Skip to content

Added feature File Path Links - Agent Mode#2202

Open
shubhamgore2468 wants to merge 1 commit intomito-ds:devfrom
shubhamgore2468:feature/Make_File_PathLinks
Open

Added feature File Path Links - Agent Mode#2202
shubhamgore2468 wants to merge 1 commit intomito-ds:devfrom
shubhamgore2468:feature/Make_File_PathLinks

Conversation

@shubhamgore2468
Copy link

What does this PR do?

When the agent mentions a file in its response (e.g. results.csv, sales_data.xlsx), the filename is now rendered as a clickable link. Clicking it opens the file directly in JupyterLab.

How it works

  • File references are detected in agent messages using a regex that matches filenames with common data/notebook extensions (.csv, .xlsx, .json, .parquet, .py, .ipynb, etc.)
  • Detected filenames are replaced with placeholder tokens before markdown rendering, then injected back as clickable <span> elements using the same React Portal pattern already used for citations and cell references
  • The filename is resolved relative to the notebook's directory so that files saved by the kernel can be found correctly
  • Filenames inside backtick code spans are not converted to links since they live inside <code> DOM elements which the text node walker skips

Files changed

  • MarkdownBlock.tsx — file ref extraction, placeholder injection, and click handler
  • ChatMessage.tsx — passes app prop down to MarkdownBlock
  • CellReference.css — adds .file-reference styles

@vercel
Copy link

vercel bot commented Mar 5, 2026

@shubhamgore2468 is attempting to deploy a commit to the trymito Team on Vercel.

A member of the Team first needs to authorize it.

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