-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: Drop zone for save files #28
base: dev
Are you sure you want to change the base?
Conversation
Found it cumbersome to continually navigate to my save file location and instead made a drop zone so I can keep the folder open and just drop the save file rather than deal with the navigator
8ac8fc4
to
1db7371
Compare
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.
I like the idea! I’ll give it a proper check later, in the meantime some things that come to my mind:
- Is the accept prop ok for mantine/dropzone? I think it uses a different format, we should check it shows a reject icon and that it doesn’t allows to pick up other files with d&d
- The border seems a bit strange in the video, is it just an artifact from video compression?
PS: Please target dev branch |
The border in the video is just compression weirdness indeed. As the screenshot shows, it looks fine normally. There does, in fact, seem to be some issue with dropzone not properly accepting .sav files. I'll have to check mime types here. It still uploads the save files and rejects other types but let me see what I can do to fix it. I tried it with PDF, PNG, JPEG and other files and it rejects them all as is expected. |
The accept prop doesn't seem to properly deal with weird file types like the Satisfactory save file since it wants proper mime types. Instead, we are using a validator that will simply check the file extension. Since we're dealing with weird binary files, this is bound to be sort of weird.
Switched to a custom validator logic since the accept prop technically worked but would throw warnings on console. The dropzone still throws a "reject" on dragOver because the browser doesn't handle these types of custom files well but once the file is dropped, it will check the file extension and only accept |
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.
I fiddled with it and I get the validator
thing, d&d file support is lacking. Anyway we still need to:
- Provide the
accept
prop, since we need it when using normal file picker. Without it, it doesn't filter for save files - Show a clear error (e.g. under the Dropzone) if the dropped file is not valid. Right now there is a
return { .. }
in the validator function but the message is not shown if there are issues
Found it cumbersome to continually navigate to my save file location and instead made a drop zone so I can keep the folder open and just drop the save file rather than deal with the navigator.