Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: filetree rename file correctly #3108

Merged
merged 2 commits into from
Oct 12, 2023
Merged

fix: filetree rename file correctly #3108

merged 2 commits into from
Oct 12, 2023

Conversation

erha19
Copy link
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

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
12 checks passed
@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
Projects
None yet
2 participants