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
Add UI for configuring the demos directory #35
Add UI for configuring the demos directory #35
Conversation
"path": { | ||
"all": true | ||
}, | ||
"fs": { | ||
"all": true, | ||
"scope": [ | ||
"**" | ||
] | ||
} |
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.
Required so the tauri fs API has access to read files
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.
Really? I thought "all": true
enables everything.
I intend to reduce the allowed scopes before release, but I believe that with the current settings everything is allowed.
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.
Tauri was raising permissions errors on file reads without adding this. Maybe "all" only applies to top-level permissions within the scope?
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.
That's odd, but I suppose you're right.
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.
Is it sufficient to specify the scope?
Looks nice, I like it. I think the back button is redundant and can be removed, the settings page was nothing more than a placeholder until now. |
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 what you've done here.
I use Prettier to format all of my code, and I suggest that you do the same so that every line of code follows the same style.
If you use VS code, you can use the recommended plugins to do that for you. If you use vim, there's the vim-prettier
plugin you can use.
"path": { | ||
"all": true | ||
}, | ||
"fs": { | ||
"all": true, | ||
"scope": [ | ||
"**" | ||
] | ||
} |
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.
Really? I thought "all": true
enables everything.
I intend to reduce the allowed scopes before release, but I believe that with the current settings everything is allowed.
We could use this crate to auto-detect where TF2 is installed. What do you think? |
Also, instead of asking for the user to paste the path into the text input, we could use the platform's open dialog to let the user choose a path directly. Sounds good? |
This looks very nice. |
src/views/settings/index.tsx
Outdated
<Link to="/">Back</Link> | ||
</div> | ||
|
||
<ScrollArea.Autosize maxHeight={400}> |
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.
We should let the scroll area fill the entire height of the window instead of having a hard-coded 400px max height. See mantinedev/mantine#724 for possible solutions.
Run |
Remove hardcoded directory name in favor of using the latest value on app startup Update styles for the settings page to make it look a bit nicer Change "Back" text link to a button
If TF2 couldn't be found, default to looking in the user's home directory This isn't any more likely to work than any other fallback, but it's preferred over having nothing at all
Display the current folder in a disabled text input
Lets the UI always correspond to the configured state
Root div needs to resize with its parent (the window), otherwise it doesn't shrink in the Y axis and the scroll overflow wouldn't kick in
a0444ef
to
f88f80c
Compare
Rebased on latest |
Remove hardcoded directory name in favor of using the latest value on app startup
Update styles for the settings page to make it look a bit nicer
Change "Back" text link to a button
Screenshot
Set to a valid directory
Set to an invalid directory