Skip to content

fix: filetree rename file correctly#3108

Merged
erha19 merged 2 commits intomainfrom
fix/file-tree-rename
Oct 12, 2023
Merged

fix: filetree rename file correctly#3108
erha19 merged 2 commits intomainfrom
fix/file-tree-rename

Conversation

@erha19
Copy link
Copy Markdown
Member

@erha19 erha19 commented Oct 11, 2023

Types

  • 🐛 Bug Fixes

Background or solution

🤖 Generated by Copilot at b1b9c17

  • Prevent renaming of compact nodes that do not match the active uri to avoid confusion or inconsistency in the file tree (link)
  • Add type guards to check if the nodes are File or Directory instances before calling methods or accessing properties that are specific to those types, such as updateMetaData, updateChildren, fileStat, or children (link, link, link, link, link, link, link, link)
  • Add a space between the Chinese words and the English word uri in a comment in file-tree.service.ts to follow the code style convention (link)
  • Add a method updateChildren to the FileTreeService class in file-tree.service.ts that recursively updates the metadata of the children nodes of a moved directory node (link)
  • Modify the parameter type and the conditional logic of the refresh method in the FileTreeService class in file-tree.service.ts to accept either a directory or a file node as an argument and refresh the parent directory of a file node or the directory node itself (link)
  • Modify the logic of the rename method in the FileTreeModelService class in file-tree-model.service.ts to set or unset the updateRefreshable flag before and after certain file operations, such as moving, validating, or deselecting nodes, to indicate whether the file tree service should refresh the file tree data (link, link)

close #3090

Changelog

🤖 Generated by Copilot at b1b9c17

This pull request enhances the file tree service and model by adding or improving type guards, metadata, and refresh logic. These changes improve the type safety, consistency, and usability of the file tree data and operations. The files affected are file-tree.service.ts, file-tree-model.service.ts, and file-tree-node.define.ts.

@opensumi opensumi Bot added 🐞 bug Something isn't working 💄 style change labels Oct 11, 2023
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 11, 2023

Codecov Report

Attention: 44 lines in your changes are missing coverage. Please review.

Files Coverage Δ
...file-tree-next/src/common/file-tree-node.define.ts 64.81% <50.00%> (+64.81%) ⬆️
...es/file-tree-next/src/browser/file-tree.service.ts 67.82% <9.52%> (+67.82%) ⬆️
...xt/src/browser/services/file-tree-model.service.ts 54.42% <0.00%> (+54.42%) ⬆️

... and 821 files with indirect coverage changes

📢 Thoughts on this report? Let us know!.

@erha19 erha19 merged commit 41a3427 into main Oct 12, 2023
@erha19 erha19 deleted the fix/file-tree-rename branch October 12, 2023 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working 💄 style change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 文件树中重命名目录后,状态没有同步到子文件,子文件无法打开

2 participants