-
-
Notifications
You must be signed in to change notification settings - Fork 25
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 durview 16colors crash #94
Conversation
- made a decorator function to wrap around the main() functions/entrypoints - log errors to file, include stacktrace - add to durdraw, durview & durfetch
- check if the file list is empty (i.e. user has unselected every option) - set an empty filename if that's the case, and check this to prevent crashes - then let the loop proceed as usual
Nice! Seems like a reasonable way to deal with the spaghetti. (I am open to just redoing openFilePicker() to handle navigating the directory structures in a more logical way, but haven't got my head around how quite yet.) Still a problem: When you un-check "[X] 16colo.rs archive" with the mouse, it repopulates the interface with the list of directories and files in the local filesystem. When you un-check that with the keyboard, it doesn't, instead leaving the list blank. |
I think an easy start to this would be converting the nested if statements to early
Ooh legend thanks for the feedback! I'll ensure that the keyboard produces the same behaviour as the mouse 🐁 |
it seems like this gigantic loop resets and repopulates the list of local files in a few different circumstances I think that this is working nicely for mouse clicks, however for keyboard presses this doesn't seem to happen. I disovered a commented-out else statement near the bottom of the loop which seemed to re-initialise the file list at some point for this keypress case. I've tried to reinstate the logic in a working fashion
@cmang It's so close now! The only difference that I can see is that the folders/files are different colours when clicked vs using enter/spacebar, do you know how that's done? |
Honestly... this is a bug I am willing to live with for now. Lol. This is feeling pretty solid. I am not sure why yet. But it looks like maybe in one mode, folders[] is being populated (where they show as menuTitleColor), and in the other, it isn't. |
I'm thinking of going ahead with the merge and worrying about the colors later. I still want to add more features before the release. Maybe we can tackle the colors as a separate patch. I can work on that. Tom, as always, I appreciate your work here! |
You're very welcome! I'm enjoying working on this a lot. Feel free to merge if you're happy with it 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good!
Context
This attempts to fix the release-blocking bug mentioned in #91
Changes
Essentially, the
file_list
is empty after deselecting all options. This happens somewhere in the very large method.After some stumbling around and some feedback from cmang, I noticed that there was a commented
else
statement at the bottom of the loop, which seems to previously have re-populated thefile_list
with files and folders from the user's CWD.https://github.com/cmang/durdraw/pull/94/files#diff-1e5995f8f73af74bc0296a94b0e316dcddab68b97c5302584a32b947dce096daR4909
else
block that I discovered at the bottom of the loop and it's looking 90% similarDemo
Screen.Recording.2025-01-30.at.7.25.58.pm.mov
first attempt
screen-20250130-084322.2.mp4
I branched this off my crash logging PR #93, but I think the order doesn't matter/you could just merge this one if you prefer 🤙