Skip to content

fix(web): Open in editor on a chat file chip opens the file the chip names - #18389

Merged
juliusmarminge merged 6 commits into
pingdotgg:mainfrom
chickenputty:fix/chat-file-chip-open-resolves-path
Oct 20, 2026
Merged

juliusmarminge merged 6 commits into
pingdotgg:mainfrom
chickenputty:fix/chat-file-chip-open-resolves-path

Conversation

@chickenputty

@chickenputty chickenputty commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

A chat chip naming a nested file by basename opened the correct file in the preview, but Open in editor and both copy actions used a nonexistent file at the workspace root. Resolve these actions through the preview's existing workspace-index lookup, preserving line/column and the authored fallback when no match is found.

Clipboard writes begin with a pending payload before lookup completes, following the existing media-copy pattern to retain Safari user activation. Safari itself remains unverified.

Retains @chickenputty's original work in #18389, with main merged and the helper and callbacks simplified. The Electron desktop client loads this web renderer; native mobile has a separate renderer and is outside this change. Related: #14624.

Validation: 69 focused tests in four files before → 69 in three existing files after. Replaced the standalone suite with two path regressions; the indexed-path regression fails when lookup is disabled. The two relevant browser suites also pass, 75 before → 76 after, including a regression that starts the clipboard write before the delayed lookup resolves. Changed-file type-aware lint, formatting and web typecheck pass. The original 117-test count refers to an older test layout and was replaced with current results.

Headless Linux live verification used an isolated server and synthetic conversation fixture naming HostResources.ts:10:2, which exists at src/resourceTelemetry/HostResources.ts. On main, the menu sent the workspace-root path. On this head, the actual editor RPC spawned a code argv recorder with --goto <workspace>/src/resourceTelemetry/HostResources.ts:10:2. Both copy actions passed that nested path, retaining the workspace-labelled relative format and position. The file preview also opened the nested source. Clipboard writes were recorded at the browser API boundary; native clipboard integration and a real VS Code window were not verified. No provider was started. A local DejaVu font fixture made screenshots legible.

Before — Copy full path points at the workspace root:

Before: incorrect root file path

After — Copy full path names the existing nested file:

After: resolved nested file path

Menu actions recording

Not verified: macOS, Windows, iOS, Android, Electron desktop, a real desktop editor, native clipboard, remote relay/tunnel or a separate physical client. Existing environment-scoped RPC and permission paths are retained; no contracts or provider adapters change.

Implementation: Codex GPT-6.1 Sol through T3 Code; tests: Codex GPT-6 Astra; independent review: Claude Opus 5.5 and Codex GPT-6 Sol.

…names

A click on a chip with a bare filename (`user.ts:261`) looks the name up in
the workspace index, so it opens src/.../user.ts. Open in editor and the copy
actions skipped that lookup and used `<workspace>/user.ts`, so VS Code opened
an empty unsaved file at the root and the copied paths pointed there too.
Open in editor, Reveal and both copy actions now resolve through one helper
that asks the index first, the same lookup the click and Reveal already used.

Fixes pingdotgg#14624.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Oct 11, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 11, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 2d3e3b9

Macroscope's review found this PR approvable — This is a localized web bug fix that resolves existing chat file-chip actions through the workspace index while preserving fallback paths and source positions. It adds focused regression coverage without changing schemas, defaults, deployment, or security-sensitive code.

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

Copy link
Copy Markdown
Member

Note

This comment is posted by Julius' dot

The focused tests cover the resolved paths, but the changed menu actions have no before/after client evidence. Please add a short recording showing the bare-filename chip opening the existing nested file in the editor and both copy actions producing the correct paths, as required by the verification guide. A recording of the equivalent fix in your Windows fork is fine if you identify the build.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

Only developers with an assigned seat can use this organization's usage-based review budget, and seats here are assigned manually. Ask an admin to assign a seat, or change the review continuation mode in Billing.

Next included review available in 12 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 916774ec-a118-4017-9076-e098c571a041
📥 Commits

Reviewing files that changed from the base of the PR and between cb3ecbf and 2d3e3b9.

📒 Files selected for processing: 4
  • apps/web/src/components/ChatMarkdown.permissions.browser.test.tsx
  • apps/web/src/components/ChatMarkdown.tsx
  • apps/web/src/markdown-links.test.ts
  • apps/web/src/markdownFileHostPath.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a0f4cff5-ba15-469f-85d8-84c50dbb74b4
📥 Commits

Reviewing files that changed from the base of the PR and between 83fbbc1 and cb3ecbf.

📒 Files selected for processing (3)
  • apps/web/src/components/ChatMarkdown.tsx
  • apps/web/src/markdownFileHostPath.test.ts
  • apps/web/src/markdownFileHostPath.ts

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

📝 Walkthrough

File-link actions now resolve bare filenames through the workspace index when workspace path and cwd are available. Resolved host paths drive editor, reveal, and copy actions. Unmatched links retain their metadata paths. Tests cover matched and unmatched results.

Changes: File-link path resolution

Layer / File(s) Summary
Host-path resolution and formatting
apps/web/src/markdownFileHostPath.ts, apps/web/src/markdownFileHostPath.test.ts
New helpers resolve matched workspace paths and format editor and copy paths. Tests cover matched and unmatched paths.
ChatMarkdown file-link actions
apps/web/src/components/ChatMarkdown.tsx
ChatMarkdown uses resolved paths for editor, reveal, and copy actions. The optional copy-path resolver is passed to the file-link component and included in callback dependencies and memoization.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to cb3ec

The reviewed file-chip actions retain their previous paths when lookup fails, and no actionable merge-blocking risk remains after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to cb3ec

File actions remain user-triggered and permission-controlled. No concrete security regression was established, but evidence is incomplete for downstream path validation and actions pending during access or workspace changes.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The new reachability is from a content-derived bare filename to an indexed file target used by the user's editor or clipboard action. The caller carries the initiating environment and workspace; the copy action writes path text, not file contents. This does not establish server-side containment or validation of every index result.

Trust Boundaries and Controls

  • observed — After resolution, editor and reveal dispatch still use the captured environmentId and re-read orchestration permission before issuing the host command. This counters an environment-identity mismatch or simple permission-revocation bypass at these inspected call sites.

Resilience and Maintainability Implications

  • observed — The new actions await lookup before their terminal side effect and preserve the initiating path context. Unlike panel opening, chip editor, reveal, and copy resolution have no latest-result guard. Copy completion also has no terminal filesystem-permission check. These are lifecycle-policy questions, not demonstrated security violations; host actions retain terminal permission checks.
Pre-merge checks: Passed 2 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Linked Issues check Warning Issue #14624 requires the Windows desktop file context menu action Open in VS Code to open the nested file. The whole-PR diff changes only apps/web chat file-chip actions in ChatMarkdown.tsx a… Implement the workspace-path lookup in the desktop file context-menu flow used by #14624. Add an automated test that verifies a nested file opens in VS Code with its full path. Alternatively, remove the direct link if this PR intentionally …
Out of Scope Changes check Warning The changed behavior targets web chat file-chip actions: Open in editor, Reveal, and copy actions. Issue #14624 targets the apps/desktop file context menu. The diff provides no evidence that… Move the web chat-chip fix to a PR linked to the relevant web issue, or establish that the desktop file context menu uses this exact flow and add coverage for that flow. Keep the #14624 PR focused on the desktop context-menu behavior.
Passed Passed checks: 2 passed
Check name Status Explanation
Title check Passed The title clearly identifies the primary fix: opening the file named by a chat file chip in the editor.
Description check Passed The description clearly explains the problem, implementation, scope, verification results, screenshots, recording, and unverified environments. It does not use the template headings or include an expl…
Full details: Description check

Explanation

The description clearly explains the problem, implementation, scope, verification results, screenshots, recording, and unverified environments. It does not use the template headings or include an explicit maintainer approval comment, but the required information is otherwise substantially complete.

Full details: Linked Issues check

Explanation

Issue #14624 requires the Windows desktop file context menu action Open in VS Code to open the nested file. The whole-PR diff changes only apps/web chat file-chip actions in ChatMarkdown.tsx and markdownFileHostPath.ts. It does not change or test the apps/desktop context-menu flow. The web chip tests therefore do not establish compliance with the linked issue.

Resolution

Implement the workspace-path lookup in the desktop file context-menu flow used by #14624. Add an automated test that verifies a nested file opens in VS Code with its full path. Alternatively, remove the direct link if this PR intentionally fixes a separate web chat-chip issue.

Full details: Out of Scope Changes check

Explanation

The changed behavior targets web chat file-chip actions: Open in editor, Reveal, and copy actions. Issue #14624 targets the apps/desktop file context menu. The diff provides no evidence that the desktop context menu uses ChatMarkdown.tsx, so these changes are outside the linked issue's stated feature scope.

Resolution

Move the web chat-chip fix to a PR linked to the relevant web issue, or establish that the desktop file context menu uses this exact flow and add coverage for that flow. Keep the #14624 PR focused on the desktop context-menu behavior.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

chickenputty added a commit to chickenputty/t3code that referenced this pull request Oct 12, 2026
) into fork

The branch behind pingdotgg#18389 (pingdotgg#14624: chip Open in editor and
copy paths find a bare filename in the workspace). Fork main already does
this, more broadly, through resolveChipHostPath from the File menus work
(e3600f0, 146ecf8), so the fork's versions are kept: this records the
branch as landed and changes no content. One known difference: the PR's copy
actions keep the link's `:line` suffix, the fork's copy the plain path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge juliusmarminge self-assigned this Oct 19, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Taking over this one. I will merge current main, simplify the path resolution and tests, and verify the editor and copy actions with before/after evidence.

@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 19, 2026
@macroscopeapp
macroscopeapp Bot dismissed their stale review October 19, 2026 03:37

Dismissing prior approval to re-evaluate 3296fb9

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Oct 19, 2026
# Conflicts:
#	apps/web/src/components/ChatMarkdown.tsx
@macroscopeapp
macroscopeapp Bot dismissed their stale review October 20, 2026 04:50

Dismissing prior approval to re-evaluate 2d3e3b9

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

Labels

macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews size:L 100-499 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.

2 participants