Repository navigation
fix(mobile): open the destination folder when a rename moves a file into it - #52209
Conversation
…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.
[Low impact] The PR appears safe to merge. SummaryAfter a successful mobile rename moves an entry into another folder, the Files browser now opens that folder and its ancestors.
Reviews (2) · Last reviewed commit: "fix(mobile): open the destination folder..." · Reviewed by Greptile |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
ELI5
On the phone, renaming a file to
docs/report.csvmoves it into thedocsfolder. The folder stayed closed, so the file just seemed to disappear. Now the folder opens and shows it.What Changed
report.csv→docs/report.csv, the row left the list anddocsstayed closed.onMovedfollow-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 servebuilt from this branch (before: main's page).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.txton main leavesdocsclosed; on this branche.txt→docs/e.txtandf.txt→src/f.txtopen their folders. Checked on the host's disk.pnpm check:changedpasses.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
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
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)