Skip to content

fix(mobile): explain file refusals and copy full paths - #37762

Merged
AmoabaKelvin merged 1 commit into
mainfrom
mobile-file-path-feedback
Nov 3, 2026
Merged

AmoabaKelvin merged 1 commit into
mainfrom
mobile-file-path-feedback

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​246 $\color{#cf222e}{\Huge{\mathbf{−}}}$​49 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​197
Prod 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​77 $\color{#cf222e}{\Huge{\mathbf{−}}}$​33 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​44

ELI5

A refused terminal file tap now says why it could not open. Markdown Copy Path copies the full host path when available.

Held for Kelvin's approval. Full-path copying reverses the deliberate workspace-relative behavior shipped in #32748, including its footer action.

What Changed

Terminal taps reuse chat's existing failure feedback, with the host's reason or "Couldn't open " for older hosts. Ordinary unresolved paths stay silent, a successful sibling candidate takes precedence over refusals, and the session's existing navigation generation suppresses stale feedback and opening after tab changes or retained-route blur, including a return to the original source.

Both existing Markdown Copy Path actions prefer filePath and fall back to relativePath. For example, docs/notes.md becomes /srv/project/docs/notes.md. Host paths are copied unchanged, including Windows drive and UNC paths.

Why

The shared file-tap opener discarded the host's refusal while resolving candidates, and terminal taps supplied no failure callback. Preserving the result until candidate selection lets terminal and chat share feedback without announcing ordinary terminal misses. Path copying stays in the existing shared action, so the tab menu and footer agree.

Linked Issue

Fixes #37748
Fixes #32230

Part of #32979, only refusal feedback. Wrapped-path reconstruction, external-file permissions and the confirmation sheet remain outside this change. #32979 remains open. #32235 is already closed; no community branches were changed.

Visual Proof

The real mobile session route rendered at 390×844 in a hidden Electron window, using fixture host replies at the native bridge. The terminal path was tapped on the canvas, and the Markdown tab menu was opened with a long press. Both captures had no page errors.

Before After
Silent terminal refusal Host refusal toast

Before interaction video:
https://github.com/user-attachments/assets/58862b86-ec22-4711-ae64-71b706ef6008

After interaction video:
https://github.com/user-attachments/assets/471bc3a7-2142-4ef4-8c59-bec8c95c45de

The clipboard bridge received docs/notes.md before and /srv/project/docs/notes.md after.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Reproduced on fresh main dc7cd7bebbf9eb45d79edc89f3f836c75be78dea: six focused failures, covering missing refusal feedback and relative-path copying. 50 focused opener/handler/reader/navigation tests and 27 neighboring Markdown/chat tests pass with at most two workers and background launch enabled. New navigation round-trip and selected-candidate regressions first failed on the initial patch and then passed. Changed-file lint, formatting, diff checks and React Doctor pass; all 15 changed-file checks passed against origin/main immediately before push. Ten focused RPC matrix/scenario checks also passed for the dependent recording adapters.

Exact head feb3a838977e882ba346c471ee8e5fbd866cadb5 is green: PR checks passed and Mobile verify. Mobile verify includes successful production and test typechecks, covering the final attachment-fixture correction.

Try on mobile:

  1. In an SSH workspace terminal, print and tap /tmp/report.md outside the workspace. The toast should say that files outside an SSH workspace cannot be opened from another device. An ordinary nonexistent path inside the workspace should stay silent.
  2. Long-press an open Markdown tab, choose Copy Path, and paste it. Expect the full host path. The footer's existing Copy path action should copy the same string.
  3. Start a file tap on a slow connection, then switch tabs or leave the session before the response. No late failure should appear on the destination screen.

Worktree: /Users/kelvinamoaba/orca/workspaces/orca/mw3-b2-terminal-d

Verified on macOS through hidden Electron CDP and fixture host replies. Physical iOS/Android devices, Windows hosts and a live SSH connection were not exercised.

Risk

Level: Medium

The full-path preference changes an intentional copy policy, so this PR must stay unmerged until approved. A wrong failure classification could show feedback for unresolved guesses or hide a real refusal. The regression tests cover those cases, sibling successes and delayed navigation. No wire, grant, saved-state or path normalization changes. A revert restores the earlier behavior.

AI Disclosure

Review

Two rounds of two independent read-only Codex peers. Round one found navigation round trips reviving late feedback and incorrect fallback path text for a selected candidate; both were repaired and reproduced with failing regressions before the fix. In round two, one reviewer reported no findings and the other caught an attachment-preview test caller missing the new required generation getter. That test caller was corrected after round two; no third review was requested under the two-round cap. The correction was validated locally and by exact-head Mobile verify, including the test typecheck ratchet; it did not receive another independent Codex peer review. No findings were rejected. Test-audit and a direct simplification pass are complete. CodeRabbit's exact-head review generated no actionable findings; there are no unresolved review threads or maintainer requests.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Hold the whole PR. No merge or deployment. No confirmation sheet, new menu action, access expansion, or closure of the #32979 umbrella.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

File-open failures now include a kind, path, and optional message. Terminal and native-chat tap handlers use navigation-generation checks when reporting failures. Markdown path copying now prefers the host path and falls back to the relative path.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to feb3a

The reviewed changes are ready for merge after the required approval and normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the two primary changes: explaining mobile file refusals and copying full paths.
Linked Issues check Passed The PR satisfies the active coding requirements in [#37748] and [#32230]. mobile-file-tap-open.ts preserves failed resolution responses, reports host error text, uses a path fallback when no message…
Out of Scope Changes check Passed The changes stay within the linked issue scope. The activation-generation updates, shared handler updates, and test changes support refusal feedback and stale-result suppression. The Markdown action c…
Description check Passed The description follows the repository template closely: it has ELI5, What Changed, Why, Linked Issue (Fixes #37748 and #32230), Visual Proof (before/after images and videos), Testing with manual and …
Full details: Linked Issues check

Explanation

The PR satisfies the active coding requirements in [#37748] and [#32230]. mobile-file-tap-open.ts preserves failed resolution responses, reports host error text, uses a path fallback when no message exists, keeps ordinary unresolved paths silent, and selects a successful sibling before reporting refusal. Activation state includes navigation generations, and the updated handler tests cover stale feedback and navigation cases. use-mobile-session-markdown-actions.ts copies tab.filePath and falls back to tab.relativePath, with tests covering normal, Windows, and UNC paths.

Full details: Out of Scope Changes check

Explanation

The changes stay within the linked issue scope. The activation-generation updates, shared handler updates, and test changes support refusal feedback and stale-result suppression. The Markdown action change implements [#32230]. The PR does not add the separate [#32979] confirmation sheet or other umbrella work described in the PR context.

Full details: Description check

Explanation

The description follows the repository template closely: it has ELI5, What Changed, Why, Linked Issue (Fixes #37748 and #32230), Visual Proof (before/after images and videos), Testing with manual and automated checkboxes, Risk with a Medium level and a revert path, Review, Agent skill boundary, Notes, and Checklist. Gaps: the AI Disclosure section is empty. The template says to fill it in for non-team contributors, and the author's status is not stated. The final checklist item (pnpm lint, typecheck, test, build) is unchecked. The Testing section lists targeted test runs but not the full pnpm suite. Those gaps are minor, so the description is mostly complete.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 6 functions across 9 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 23fd7026-a147-49a4-aaf9-3f4a00dec6f4
Commits

Reviewing files that changed from the base of the PR and between 5d5b4f4 and feb3a83.

Files selected for processing: 9
  • mobile/src/files/MobileChatAttachmentPreview.web.test.tsx
  • mobile/src/session/mobile-file-tap-open.test.ts
  • mobile/src/session/mobile-file-tap-open.ts
  • mobile/src/session/opened-mobile-session-tab.ts
  • mobile/src/session/session-markdown-source-copy.test.tsx
  • mobile/src/session/use-mobile-file-tap-handlers.test.ts
  • mobile/src/session/use-mobile-file-tap-handlers.ts
  • mobile/src/session/use-mobile-session-file-actions.ts
  • mobile/src/session/use-mobile-session-markdown-actions.ts

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

@AmoabaKelvin
AmoabaKelvin merged commit 0678a2f into main Nov 3, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant