-
Notifications
You must be signed in to change notification settings - Fork 22
[ENH] Added dropdown to select drives and to select files from the tree view while selecting location of new project #475
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: sumana sree <[email protected]>
Hello @JoeZiminski @adamltyson I have tried to solve the issue #448 but got stuck in the process. As shown in the video, I have added a dropdown to select drives, the dropdown is successfully showing the available files. But the tree view is not updating the files according to the drive selected. Can you please help me how to refine the code to correctly add this feature. Thank you!!! |
@sumana-2705 thanks for this! This is a really nice addition and will be very useful for users, please see comments above. I can take a look at the linux / macOS situation next week and will let you know about that ASAP (feel free to look into this also if you have access to these systems). It is possible to mount external drives on macOS / linux and so it will be nice to support these also if possible. We will also need to add a test for this, unfortunately it is not a simple thing to test. I think it will be impossible to actually test the behaviour on real drives (we at the NIU might have to add this to our internal tests). However, we can at least test the interface. I think the approach will be:
You can take a look at this function on the test suite for inspiration. However this is quite advanced so happy to give more detail and an example once this round of comments have been responded too. Thanks again! |
Thank you for providing the reference and background, @JoeZiminski. Unfortunately, most of my peers at university use Windows, so I currently don’t have access to Mac or Linux systems. For now, I will focus on understanding and implementing monkeypatch. I will provide an update as soon as possible. Once it is working properly, we can test it on different systems and refine the tests accordingly. |
Sounds good! Thanks @sumana-2705 I'll get back to you ASAP, let me know if you have any questions about the monkeypatching. |
Hello @JoeZiminski @adamltyson Before adding tests using |
HI @sumana-2705, I'm very sorry when I last reviewed your PR I did not click the submit button, I thought I had in the process of posting the summary. Please see some suggested changes, apologies for this oversight. That's a good question, I think textual has a |
Thank you for the suggestions @JoeZiminski I will go through them clearly and work on them |
Thank you @JoeZiminski all the suggestions worked like a magic. Now everything is perfect, I tried so hard to correct this issue but it was not updating properly even after so many attempts. You helped me a lot by suggesting changes. Thank you once again. Also I wanted to conform that whether Untitled.video.-.Made.with.Clipchamp.mp4 |
Hi @sumana-2705 great glad it helped! Yes textual can be hard to work with at first because it is a huge package and there are a lot of different ways to do similar things. Yes |
BTW I did not have time in the end this week to test on the macOS in the office, but I will do next week. In terms of working on this PR don't worry much about it, it should just be a quick check to find what the mount paths are and setting appropriately. |
Got it! It took me some time since I'm new to TUI development, but I'm gaining valuable experience while working on these issues. I'll also try to check this on a Mac in the meantime. Thanks for your support! |
Hello @JoeZiminski I have checked the behavior of the directory tree on Mac and modified the code to ensure the functionalities work correctly on both Windows and Mac. Here is a picture of the directory tree on Mac for reference. |
Description
What is this PR
Why is this PR needed?
Currently,
SelectDirectoryTreeScreen
starts atPath.home()
by default, which is not ideal for selecting external drives. Windows and some Linux systems do not have a master root where all drives are listed, making drive selection difficult. This PR introduces a dropdown to allow users to choose the drive they want to navigate.What does this PR do?
References
fixes #448
How has this PR been tested?
I have tested it my windows laptop, the dropdown successfully worked. But the directory tree is not getting refreshed, I need your help to fix this. I am attaching the current state of the window:
datashuttle.mp4
Is this a breaking change?
No, this PR does not break existing functionality. It only enhances the directory selection process by allowing users to switch between drives.
Does this PR require an update to the documentation?
Yes, documentation should be updated to mention the new drive selection feature in
SelectDirectoryTreeScreen
.Checklist: