Skip to content

fix(web): open workspace root links in the file explorer - #12449

Open
saphid wants to merge 4 commits into
pingdotgg:mainfrom
saphid:fix/web-workspace-root-links
Open

saphid wants to merge 4 commits into
pingdotgg:mainfrom
saphid:fix/web-workspace-root-links

Conversation

@saphid

@saphid saphid commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

What Changed

Clicking a chat link to the project directory now opens the workspace file explorer in the web/desktop file panel.

Why

Workspace membership recognized descendants but missed the root itself. The root link was consequently treated as an external file and displayed “Failed to read workspace file.” Recognize the root as . and route it to the explorer without issuing a file read or a basename search. Root links reuse the existing Files tab, including repeat opens. Other absolute paths retain their existing behavior.

Verification

Merged upstream main at 7445aa733ada33e45289e5aa5055f79142556513 (20 September 2026).

  • vp test run packages/client-runtime/src/markdownLinks.test.ts apps/web/src/markdown-links.test.ts apps/web/src/components/files/FilePreviewPanel.test.ts apps/web/src/workspaceBasenameLookup.test.ts apps/web/src/rightPanelStore.test.ts --maxWorkers 1: 247 passed.
  • vp exec tsc --noEmit -p apps/web/tsconfig.json: passed.
  • Targeted formatting, lint, and git diff --check: passed (existing warnings/suggestions may remain).

The existing captures show the same root-link resolver and Files-tab behavior. This refresh changes no root-link behavior; the captures retain their original revisions and are not new recordings.

Independent review was attempted before the final upstream sync, directly with devin -p --model swe-2-max using a frozen diff and repository standards. The noninteractive tool-based attempt returned without reviewing; bounded no-tool attempts timed out (status 124) without a verdict. No new independent approval is claimed.

UI Changes

Live web verification used the same isolated, seeded conversation and disposable workspace at 1280 × 800. The base is 52e4b4429359904441039a286c61eaafe8474451; the recorded candidate is 7737c37654. The subsequent merge from upstream changes diff rendering only; the root-link behavior shown here is unchanged. The actual link was activated through the attached preview’s DOM API. GIFs are sampled at 8 fps with original timing; the MP4 recordings are linked below. This proves shared web behavior, not native Electron IPC. Mobile was not changed or exercised.

Before: clicking the project directory opens a file tab with a read error.

Before: the project folder produces a workspace file-read error

File-panel detail:

Before detail: failed to read workspace file

After: the same link opens the Files explorer with src and README.md.

After: the project folder opens the Files explorer

File-panel detail:

After detail: the Files explorer lists the project contents

Before recording · After recording

Additional live checks confirmed that README.md renders its actual contents and the root link returns to the explorer. These follow-through checks are not in the comparison recordings.

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 with GPT-6 Astra in the Codex harness (T3 Code).

Current upstream integration and focused verification: GPT-6 Astra in the Codex harness (T3 Code).

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 18, 2026
@coderabbitai

coderabbitai Bot commented Sep 18, 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 37fb7237-c08f-4ff1-8da7-dacb024d73ce

📥 Commits

Reviewing files that changed from the base of the PR and between 9ea9c3d and 5a26a9f.

📒 Files selected for processing (10)
  • apps/web/src/components/files/FilePreviewPanel.test.ts
  • apps/web/src/components/files/FilePreviewPanel.tsx
  • apps/web/src/components/files/filePreviewMode.ts
  • apps/web/src/markdown-links.test.ts
  • apps/web/src/rightPanelStore.test.ts
  • apps/web/src/rightPanelStore.ts
  • apps/web/src/workspaceBasenameLookup.test.ts
  • apps/web/src/workspaceBasenameLookup.ts
  • packages/client-runtime/src/markdownLinks.test.ts
  • packages/client-runtime/src/markdownLinks.ts

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


📝 Walkthrough

Walkthrough

Workspace-root paths now resolve to ".", bypass file previews, and open the singleton files explorer. Path normalization and basename lookup tests cover root and dot-path cases.

Changes

Workspace-root navigation

Layer / File(s) Summary
Workspace-root path resolution
packages/client-runtime/src/markdownLinks.ts, packages/client-runtime/src/markdownLinks.test.ts, apps/web/src/markdown-links.test.ts
workspaceRelativeFilePath returns "." for normalized workspace-root paths. Tests cover trailing separators, filesystem roots, Windows drive paths, and inline code links.
Preview path handling
apps/web/src/components/files/filePreviewMode.ts, apps/web/src/components/files/FilePreviewPanel.tsx, apps/web/src/components/files/FilePreviewPanel.test.ts
resolveFilePreviewPath converts workspace-root paths to null. FilePreviewPanel disables file queries for null paths and retains attachment and non-root paths.
Explorer surface routing
apps/web/src/rightPanelStore.ts, apps/web/src/rightPanelStore.test.ts, apps/web/src/workspaceBasenameLookup.ts, apps/web/src/workspaceBasenameLookup.test.ts
openFile routes "." to the singleton "files" surface. Basename lookup excludes "." and "..".

Priority: ➖ Normal

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

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant MarkdownLinkResolver
  participant FilePreviewPanel
  participant RightPanelStore
  MarkdownLinkResolver->>FilePreviewPanel: provide workspace-root path as "."
  FilePreviewPanel->>FilePreviewPanel: resolve path to null
  FilePreviewPanel->>RightPanelStore: route root request to files surface
  RightPanelStore-->>FilePreviewPanel: activate singleton "files" surface
Loading

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to 5a26a

The workspace-root navigation behavior matches the repository’s Windows path contract, with no actionable current-head risk identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 10 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely describes the main change: routing workspace root links to the web file explorer.
Description check ✅ Passed The description is complete and focused. It explains what changed, why it changed, UI impact, verification results, and checklist completion. It includes before-and-after screenshots and recordings fo…
  • 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.

@macroscopeapp

macroscopeapp Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 7737c37

Macroscope's review found this PR approvable — This is a narrowly scoped workspace-link bug fix that reuses the existing file explorer, leaves non-root files and attachments unchanged, and includes targeted coverage for path normalization and panel state. It does not alter product defaults, schemas, deployment, or static-analysis configuration.

No code changes detected at d83a68c. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

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:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant