Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): open the file a bare filename reference names #6297

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

Fixes #6292.

Clicking ChatView.tsx:3301 fails with "Failed to read workspace file 'ChatView.tsx'". The :line suffix is what makes it a link, but the filename alone doesn't say where the file is, so it resolves against the workspace root.

When a path has no directory in it, this asks the workspace index where the file actually is before opening the panel. Only an exact filename match counts — a fuzzy match on some other file would be worse than the error you get today, so anything else keeps the old path and the old message. Paths that already carry a directory skip the lookup entirely and open synchronously, as before.

Two lookups can be in flight at once and the index makes no promise about the order it answers in, so each one claims a sequence and drops its result if a later click superseded it.

No screenshots: the visible change is a chip that used to open an error page now opening the file.

🤖 Generated with Claude Code


Note

Low Risk Focused UX bugfix for chat file links with conservative exact-match logic and unit tests; no auth, security, or data-handling changes.

Overview Bare filename links in chat markdown now resolve to a real workspace path before opening the right panel, fixing clicks like ChatView.tsx:3301 that previously failed against the workspace root.

When the path has no directory segment, openFileInPanel queries projectEnvironment.searchEntries and opens only an unambiguous exact (or single case-insensitive) basename match. Paths that already include a directory still open synchronously. Concurrent lookups are sequenced so a later click wins if an earlier search settles out of order.

MarkdownFileLink now takes an onOpenInPanel callback instead of calling the right-panel store directly.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit dcb40ad047fa9c8817ae5dd8af3b72299e9cac2c. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

  • When a file link in chat references a bare filename (no directory separator), the new openFileInPanel callback in ChatMarkdown.tsx queries the project index to find a matching file path.
  • Match selection prefers an exact basename match, falls back to a unique case-insensitive match, and uses the original path if ambiguous or unresolved.
  • Concurrent rapid clicks are handled via claimWorkspaceBasenameLookup in workspaceBasenameLookup.ts, ensuring only the latest click's lookup result is applied.
  • MarkdownFileLink now accepts an onOpenInPanel callback instead of calling the right panel store directly, making the open logic configurable by the parent.
Macroscope summarized dcb40ad.
    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 Plus

      Run ID: 7684cc41-8bcb-4402-9ba6-e844802962b8

      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

      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.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. Cursor Bugbot has reviewed your changes using high effort 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 d4f5f15f499f45db4a31b8e612f78b3634d527f7. Configure [here](https://www.cursor.com/dashboard/bugbot).
    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved dcb40ad

      This bug fix corrects bare filename opening behavior with well-tested, self-contained helper functions. The change has clear intent, limited scope, and comprehensive test coverage.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. juliusmarminge merged this2cb1a26

    6. juliusmarminge closed this

Sign in to join this conversation.