fix(open-folder): refresh renamed entries with URI-aware matching#2142
Conversation
Greptile SummaryThis PR replaces in-place DOM mutation (
Confidence Score: 4/5Safe to merge for the primary rename flow; the only rough edge is SAF content: URI expanded-state migration, which silently drops sidebar expand state after a rename of nested directories on Android SAF — no data loss. The new
Important Files Changed
Sequence DiagramsequenceDiagram
participant U as User
participant EO as execOperation / renameItem
participant RREOF as refreshRenamedEntryInOpenFolders
participant MOFS as migrateOpenFolderStateUrls
participant ROF as refreshOpenFolder
participant OFind as openFolder.find
participant FT as FileTree (root)
participant CT as FileTree (child subtree)
U->>EO: rename(url → newUrl)
EO->>RREOF: (url, newUrl)
RREOF->>MOFS: migrate listState keys
MOFS-->>RREOF: listState updated
RREOF->>ROF: refreshOpenFolder(oldParentUrl)
ROF->>OFind: find(oldParentUrl)
OFind-->>ROF: root Folder object
ROF->>FT: refreshFolder(oldParentUrl, areSameOpenFolderUrl)
FT->>FT: "currentUrl == oldParentUrl? NO"
loop childTrees
FT->>CT: refreshFolder(oldParentUrl, ...)
CT->>CT: "currentUrl == oldParentUrl? YES"
CT->>CT: refresh() → load(currentUrl)
CT-->>FT: true
end
FT-->>ROF: true
ROF-->>RREOF: done
RREOF-->>EO: done
Reviews (3): Last reviewed commit: "fix the edge case" | Re-trigger Greptile |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
We're back at our hacky URL transformations. |
Yeah, we need it to handle different |
No description provided.