-
Notifications
You must be signed in to change notification settings - Fork 16
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
File rename refactor #2054
File rename refactor #2054
Conversation
Your Render PR Server URL is https://storage-ui-stage-pr-2054.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c91fukfd17cat7g04me0. |
Your Render PR Server URL is https://files-ui-stage-pr-2054.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c91fulnd17cat7g04mrg. |
Your Render PR Server URL is https://chainsafe-components-stage-pr-2054.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-c91fumnd17cat7g04nd0. |
I think this feels more natural 👍. There is no way for a user to cancel once they have made their change now though. We also need to apply the same change to the Shared page, when renaming a Shared Folder it did not save when I clicked outside the input. It would be good to apply the same change to files within buckets on Storage UI too (or create a seperate issue), what do you think? I wasn't able to see the spinner when I throttled the connection in the dev tools. |
There is by pressing the Thanks for checking it out, I'll apply these changes to the other areas where we rename stuff. |
Storage needed some small refactor. This is being a big PR now. I tried to test all cases, and couldn't spot anything missing, feel free to play around and rename anything you can rename :) I did not change the mobile way with a loader on the modal, just to keep things from exploding totally. |
Just checked out the latest changes. Share folder renaming in Files UI and file renaming in Storage UI buckets are both good now. I did notice on storage ui that we're not doing the same thing with file extensions when we're renaming so I'll create a separate issue as it would be good to have them behaving the same. I realized I was seeing the spinner before but in dark mode it's really difficult to see: |
The implementation is really great, here are some thoughts that came into my mind.
|
…ChainSafe/ui-monorepo into fix/tbaut-save-on-blur-edit-loader-2050
Agreed, I looked for this, the
Ah good point! Definitely something I can do @asnaith I hadn't tested dark mode yet (and didn't check the box in the first post :D ), it's fixed now :) |
This seems implemented already :) canren.mov
That's why I switched to dark mode straight away 😂. Looks great now. |
const newName = extension !== "" ? `${values.name.trim()}.${extension}` : values.name.trim() | ||
|
||
if (newName !== name) { | ||
newName && handleRename && handleRename(file.cid, newName) | ||
if (newName !== name && !!newName && handleRename) { |
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.
yup that's in the code, if newName
is "" it'll be falsy and go to the else
and stop editing.
Thanks Andrew for checking, it's indeed already supported :) |
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.
The rename functionality feels fully intuitive now. 💯
...ges/files-ui/src/Components/Modules/FileBrowsers/views/FileSystemItem/FileSystemGridItem.tsx
Outdated
Show resolved
Hide resolved
…leSystemItem/FileSystemGridItem.tsx Co-authored-by: Tanmoy Basak Anjan <[email protected]>
...ges/files-ui/src/Components/Modules/FileBrowsers/views/FileSystemItem/FileSystemGridItem.tsx
Outdated
Show resolved
Hide resolved
…leSystemItem/FileSystemGridItem.tsx
closes #2050
Since the edition isn't exactly instant even with good internet, I find it good to have a spinner to show something is happening
Submission checklist:
Layout
Theme