Skip to content

fix(mobile): open the destination folder when a rename moves a file into it - #52209

Merged
AmoabaKelvin merged 1 commit into
mainfrom
mobile-files-rename-reveal
Nov 29, 2026
Merged

AmoabaKelvin merged 1 commit into
mainfrom
mobile-files-rename-reveal

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

On the phone, renaming a file to docs/report.csv moves it into the docs folder. The folder stayed closed, so the file just seemed to disappear. Now the folder opens and shows it.

Files Added Deleted Net
Test 0 0 0 0
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​10 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​9

What Changed

  • Before: after a rename like report.csv → docs/report.csv, the row left the list and docs stayed closed.
  • After: the folders the file moved into open, so it is in sight. Renames that stay in the same folder change nothing; a renamed folder that was open stays open, as before.
  • Mechanism: the Files browser's onMoved follow-up (run only after the host accepted the rename, for the workspace still shown) now also opens the destination folder and its ancestors when the new parent differs from the old one, reusing the helper New File and New Folder already use.

Why

The desktop explorer reveals a renamed file when it is the open editor, expanding its folders. The phone has no open editor, so opening the destination right after the rename is the equivalent, and matches what New File/New Folder already do on the phone.

Linked Issue

Follow-up to #51224 (review comment on the rename flow). Part of #31892.

Visual Proof

iPhone simulator paired to a headless orca serve built from this branch (before: main's page).

Before (main) After
Dark
Light

The rename being typed:

Testing

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • Every added test fails without this change and avoids the test anti-patterns

  • Simulator: c.txt → docs/c.txt on main leaves docs closed; on this branch e.txt → docs/e.txt and f.txt → src/f.txt open their folders. Checked on the host's disk.

  • pnpm check:changed passes.

  • No unit test: a one-line UI state follow-up.

Performance

None, because it only runs once after a successful rename into another folder, copying one panel's small open-folders set.

Risk

Only the open/closed state of folders in one Files panel changes after a rename. A plain revert undoes it.

Level: Low

AI Disclosure

Review

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

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Phone page change only, served by the host; no store build needed.

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)

…nto it

Renaming a file in the phone's Files browser to a name with a slash
(docs/report.csv) moves it into that folder, but the folder stayed
closed, so the row seemed to vanish. The folders it went into now open,
as desktop's explorer reveals a renamed file that is open.
@greptile-apps

greptile-apps Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

After a successful mobile rename moves an entry into another folder, the Files browser now opens that folder and its ancestors.

  • Renaming an entry into another folder opens that folder in the mobile tree.

Reviews (2) · Last reviewed commit: "fix(mobile): open the destination folder..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

When a file moves, the callback updates expanded paths. If the destination parent exists and differs from the original parent, the callback also expands the destination parent.

Merge Risk: Minimal · up to 2f666

After a rename moves a file into another folder, the phone Files browser now opens the destination folder so the moved file is visible. The change is small and easy to revert, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the actual change: after a rename moves a file into another folder, the phone Files browser opens the destination folder. It matches the raw summary, which says onMoved now opens the m…
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.
Description check Passed The description follows the repository template and covers the main required sections. The ELI5, What Changed (before/after plus mechanism), Why, Visual Proof (before/after images in a table), Testing…
Full details: Title check

Explanation

The title names the actual change: after a rename moves a file into another folder, the phone Files browser opens the destination folder. It matches the raw summary, which says onMoved now opens the moved entry's destination parent when it differs from the original parent. The title uses the conventional fix(mobile) prefix and is specific enough for history scanning.

Full details: Description check

Explanation

The description follows the repository template and covers the main required sections. The ELI5, What Changed (before/after plus mechanism), Why, Visual Proof (before/after images in a table), Testing, Performance, Risk with level, and Checklist are all filled in. The Linked Issue section references a follow-up to #51224 and part of #31892, but it does not use the required 'Fixes #' form. The AI Disclosure section is empty. The Review section is empty. The Testing checklist leaves the automated test item unchecked, but the author explains why no unit test was added. The lint, typecheck, test, and build checklist item is unchecked, and the author notes only that pnpm check:changed passes. These gaps are non-critical, so the description is mostly complete.

  • 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

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: 7ca5f4f2-0775-428a-9dc0-6d9ae953a652
Commits

Reviewing files that changed from the base of the PR and between a42c042 and 2f666bd.

Files selected for processing: 1

  • mobile/src/files/explorer/use-mobile-file-explorer-actions.tsx

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 999bbe0 into main Nov 29, 2026
28 of 29 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

Development

Successfully merging this pull request may close these issues.

1 participant