Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

Mergedchickenputty(GitHub profile, opens in a new tab)merged 6 commits intomain fromrefs/pull/18389/headmerged by juliusmarminge View on GitHub

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.

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      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](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. 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.

    4. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      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 cb3ecbf659d3d9e0ad3b24b739b82ece7ffebc8b and 2d3e3b9d3f5df9e68c708f429a97c06401646805.

      📒 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 83fbbc18f8718b0254e696f02b8e381386fd6c7b and cb3ecbf659d3d9e0ad3b24b739b82ece7ffebc8b.

      📒 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 nameStatusExplanationResolution
      Linked Issues checkWarningIssue #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 checkWarningThe 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 nameStatusExplanation
      Title checkPassedThe title clearly identifies the primary fix: opening the file named by a chat file chip in the editor.
      Description checkPassedThe 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.
    5. juliusmarminge assignedjuliusmarminge

    6. 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.

    7. juliusmarminge added labelsmacroscope-review

    8. juliusmarminge merged thisfc4319c

    9. juliusmarminge closed this

Sign in to join this conversation.