-
Notifications
You must be signed in to change notification settings - Fork 266
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: file input #7238
feat: file input #7238
Conversation
We have Inputs next to Browse buttons in many places, all with slight variations in UI or browsing. This creates a new FileInput component that uses a regular Input component with a folder icon on the right to browse for files. Exposes OpenDialogOptions to make it easy to customize what the file dialog should filter for. Uses the new FileInput for file/folder preferences so that there's something to test. There are several other file/browse buttons elsewhere, but they would be migrated separately. Likely also a candidate for svelte-ui package, but that should be after we become comfortable with/use it. Fixes containers#7197. Signed-off-by: Tim deBoer <git@tdeboer.ca>
We have Inputs next to Browse buttons in many places, all with slight variations in UI or browsing. This creates a new FileInput component that uses a regular Input component with a folder icon on the right to browse for files. Exposes OpenDialogOptions to make it easy to customize what the file dialog should filter for. Uses the new FileInput for file/folder preferences so that there's something to test. There are several other file/browse buttons elsewhere, but they would be migrated separately. Likely also a candidate for svelte-ui package, but that should be after we become comfortable with/use it. Fixes containers#7197. Signed-off-by: Tim deBoer <git@tdeboer.ca>
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.
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.
Tested, was able to browse it fine and saw the button changes didn't negatively impact any of the other UI components.
Implementation and code LGTM!
@lstocchi that is unrelated and unfortunately affects all configuration even prior to this. I opened #7142 to track it and you can see it affect other settings. |
Is it possible to clear a value once you have already chosen a directory/file? I cannot find a way to do this before/after this PR, but as we are creating a specific component, it would be interesting to support this possibility to reset a value to /undefined/ |
What does this PR do?
We have Inputs next to Browse buttons in many places, all with slight variations in UI or browsing. This creates a new FileInput component that uses a regular Input component with a folder icon on the right to browse for files. Exposes OpenDialogOptions to make it easy to customize what the file dialog should filter for.
Uses the new FileInput for file/folder preferences so that there's something to test. There are several other file/browse buttons elsewhere, but they would be migrated separately. Likely also a candidate for svelte-ui package, but that should be after we become comfortable with/use it.
Screenshot / video of UI
Before:
After:
What issues does this PR fix or reference?
Fixes #7197.
How to test this PR?
Tests added, check Settings > Preferences for usability/regression.