Skip to content

fix(web): open absolute folder links in the file explorer - #12800

Open
shardmods wants to merge 1 commit into
pingdotgg:mainfrom
shardmods:fix/absolute-folder-chat-links
Open

shardmods wants to merge 1 commit into
pingdotgg:mainfrom
shardmods:fix/absolute-folder-chat-links

Conversation

@shardmods

@shardmods shardmods commented Sep 20, 2026 •

Copy link
Copy Markdown

What Changed

Absolute folder links in chat now open a file explorer rooted at the linked folder. Opening a child file or copying/dragging a mention keeps its absolute path, so it continues to refer to the correct location outside the chat's workspace. Directory suffixes are stripped before Windows path conversion when dragging mentions.

Why

Clicking a link to /Users/user/Coding/t3code-local from a chat in /Users/user/Amethyst/design opened a file preview and failed because the target was a directory. The existing directory fallback excluded absolute paths. This extends that fallback by giving the explorer the linked directory as its root.

Related: #10909 added the workspace-relative folder fallback. #12449 handles links to the current workspace root; this fix also handles directories outside that workspace.

UI Changes

Captured in an isolated web development instance using the same seeded chat. Before: the folder link produces a read error. After: it opens the folder's contents; selecting a child file opens its contents from that folder. The shared web/desktop panel changed; native desktop and mobile were not separately exercised. Captured at 1280 × 800 against the upstream base and the PR patch.

Before After
Folder link produces a file-read error Folder link opens its own file explorer

Before/after interaction recording — the fixed flow starts at 0:10; an idle pause is cut at 0:20.

Validation

  • 22 tests passed across FilePreviewPanel.test.ts, projectFilesQueryState.test.tsx, and fileTreeDragMention.test.ts.
  • Web typecheck passed with existing suggestions.
  • Targeted lint passed with existing React warnings; formatting and git diff --check passed.

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

Implemented and reviewed with GPT-6 through the Codex harness in T3 Code.

Summary by CodeRabbit

  • New Features

    • File browsing now supports directories hosted outside the current project context.
    • File links, context-menu actions, and drag-and-drop mentions can use resolved absolute paths when viewing external directories.
  • Bug Fixes

    • Improved path handling keeps displayed file links aligned with their actual project location while preserving correct selection behavior.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 20, 2026
@shardmods
shardmods marked this pull request as ready for review September 20, 2026 22:32
@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 6bfa2984-bcb4-4e31-adfb-64001155996c

📥 Commits

Reviewing files that changed from the base of the PR and between f6cc6bc and fbb7d49.

📒 Files selected for processing (4)
  • apps/web/src/components/files/FileBrowserPanel.tsx
  • apps/web/src/components/files/FilePreviewPanel.tsx
  • apps/web/src/components/files/fileTreeDragMention.test.ts
  • apps/web/src/components/files/fileTreeDragMention.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The file explorer now supports host directories outside the chat workspace. It resolves entry paths for links, file opening, and drag mentions while preserving original tree paths for deselection.

Changes

External File Paths

Layer / File(s) Summary
Path resolution and drag mentions
apps/web/src/components/files/FileBrowserPanel.tsx, apps/web/src/components/files/fileTreeDragMention.ts, apps/web/src/components/files/fileTreeDragMention.test.ts
FileBrowserPanel optionally resolves entries against cwd. Context-menu mentions, file opening, and drag mentions use resolved paths. Drag deselection keeps the original tree paths.
Host directory explorer integration
apps/web/src/components/files/FilePreviewPanel.tsx
Host directories use their relative path as the explorer CWD. The explorer remounts for the environment and CWD, displays the directory basename, enables absolute paths, and clears the selected tree path.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant FilePreviewPanel
  participant FileBrowserPanel
  participant DragMentionController
  participant Composer
  FilePreviewPanel->>FileBrowserPanel: Pass host directory CWD and absolutePaths
  FileBrowserPanel->>FileBrowserPanel: Resolve entry path against CWD
  FileBrowserPanel->>DragMentionController: Provide resolved path callback
  DragMentionController->>Composer: Create mention with resolved path
  DragMentionController->>FileBrowserPanel: Deselect original tree path
Loading

Suggested reviewers: maria-rcks

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description includes all required sections, explains the change and rationale, provides UI screenshots and an interaction recording, and completes the checklist. It also documents validation resul…
Title check ✅ Passed The title clearly and concisely describes the main change: absolute folder links now open in the file explorer.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant