Skip to content

Conversation

kpatl1
Copy link
Collaborator

@kpatl1 kpatl1 commented Jul 16, 2025

Summary
I have added a function that checks if there are unsaved files within a folder. If so, it will open a modal asking if the user wants to actually delete the folder. On deletion it will then move to recycle bin.
Testing
How did you test this change?
I followed the steps to recreate the feature request by joining a viya server, making a new folder with two unsaved files, and then try to delete the folder. After deleting it, I got the message if I truly did want to and then I had the option to continue or cancel. On continuation, the folder then moved to recycle bin.

Fixes #1136

@kpatl1 kpatl1 requested a review from scnwwu July 16, 2025 19:32
@kpatl1 kpatl1 added the good first issue Good for newcomers label Jul 16, 2025
@scnwwu scnwwu removed the good first issue Good for newcomers label Jul 21, 2025
@kpatl1
Copy link
Collaborator Author

kpatl1 commented Jul 23, 2025

Added fixes. Put the logic into the UI and Service layer. Children are found recursively for the folder and added to a set. Open files are then referenced into the set to see if they are within it. If the file is dirty and in the children set, a popup will appear. Overall, time complexity boils down to O(N + M) I believe where N is the number of files within a root directory and M being the number of files being open in the window.

kpatl1 added 5 commits July 24, 2025 13:54
I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: 5ef4032
I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: 3195f1d
I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: 9166f84

Signed-off-by: Kishan Patel <[email protected]>
Copy link
Member

@scnwwu scnwwu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kpatl1, for your nested folder question, if you dump your uriToParentMap, you'll see that the Uri format in key and value are different.
I've added suggestions that will make it work

Kishan Patel and others added 6 commits August 15, 2025 15:56
I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: 5da1aa5

Signed-off-by: Kishan Patel <[email protected]>
Signed-off-by: Kishan Patel <[email protected]>
I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: 2c3e6e2
I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: ed1cf13
I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: b8dbf88
I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: 0cba768
I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: d0c8028

Signed-off-by: Kishan Patel <[email protected]>
Copy link
Collaborator Author

@kpatl1 kpatl1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved comments, and tested functionality again.

kpatl1 added 2 commits August 20, 2025 14:33
I, Kishan Patel <[email protected]>, hereby add my Signed-off-by to this commit: 5da1aa5

Signed-off-by: Kishan Patel <[email protected]>
@scnwwu scnwwu added this to the 1.17.0 milestone Aug 21, 2025
@enzhihpp enzhihpp assigned Zhirong2022 and unassigned enzhihpp Aug 21, 2025
@Zhirong2022 Zhirong2022 added testing Test the pull requests and removed verification-needed labels Aug 21, 2025
@Zhirong2022
Copy link

It has no further response if trying to delete the folder which contains unsaved file after switch to a new Viya profile.
Steps to reproduce:
Suppose having two valid Viya connection
1.Sign in with one of the Viya server
2.Go to SAS Server, create a new file under a specified personal file folder and kept it unsaved
3.Switch to another Viya server
4.Delete the specified file folder which contains the unsaved file

@kpatl1
Copy link
Collaborator Author

kpatl1 commented Aug 25, 2025

It has no further response if trying to delete the folder which contains unsaved file after switch to a new Viya profile. Steps to reproduce: Suppose having two valid Viya connection 1.Sign in with one of the Viya server 2.Go to SAS Server, create a new file under a specified personal file folder and kept it unsaved 3.Switch to another Viya server 4.Delete the specified file folder which contains the unsaved file

I believe that is because VSCode will no longer mark the file as dirty since you are reloading the connection. I am unsure is there is a way to work around this as it is a base issue coming from VSCode no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Test the pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No warning message if trying to delete a folder which contains unsaved files
4 participants