-
Notifications
You must be signed in to change notification settings - Fork 44
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
Storage UI: Delete Drive (in proposal; Remove the configuration for this device) #1934
base: storage-config-ui
Are you sure you want to change the base?
Conversation
(the menu item only appears when I first delete the root partition from it) except it crashes!? and I am pretty sure useDrive has worked before > Unexpected Application Error! > _useDrive4 is undefined > > RemoveDriveOption@https://localhost:10443/index.js:42094:22 > renderWithHooks@https://localhost:10443/index.js:84540:27 > updateFunctionComponent@https://localhost:10443/index.js:88666:20 > beginWork@https://localhost:10443/index.js:90689:16 > beginWork$1@https://localhost:10443/index.js:96514:14 > performUnitOfWork@https://localhost:10443/index.js:95645:12 > ... > 💿 Hey developer 👋 > You can provide a way better UX than this when your app throws errors by providing your own ErrorBoundary or errorElement prop on your route.
9dd9190
to
ad15af6
Compare
@@ -393,7 +393,7 @@ const RemoveDriveOption = ({ drive }) => { | |||
return ( | |||
<> | |||
<Divider component="hr" /> | |||
<MenuItem description={_("Remove the configuration for this device")}> | |||
<MenuItem description={_("REMOVE the configuration for this device")} onClick={deleteDrive}> |
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.
Why uppercase?
For visually grabbing user attention about the destructive effect of the action I'd use the isDanger MenuItem prop instead of playing with text that, somehow, is out of our control
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.
Sorry for confusing you, that is just my WIP debugging way to make sure my browser is seeing the intended branch
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.
Ah, understood.
Anyway, goes for isDanger prop with this option :)
I will need help with this: |
The interface was crashing when deleting a drive due to the `RemoveDriveOption` component attempting to destructure an `undefined` value after the delete action was performed. Most likely, after the delete action, a parent component in the tree is re-rendered, which causes `RemoveDriveOption` to re-render as well. As a quick fix, this commit postpones the destructuring until the value returned by the `useDrive` hook is known, returning early if it is `undefined`. A more refined solution is welcome, but will be addressed once the overall storage UI is more polished.
Yes, it is a workflow problem because the combination of re-renders, hooks, and the mentioned undefined. The quick fix could be the one proposed at 8a9477d, but actually Agama should stop re-rendering components that are going to be unmounted. Let's go ahead and commit the right fix later, when all the storage interface pieces are more polished. |
Problem
https://trello.com/c/JQ3blpRm
Solution
WIP
Testing
Screenshots
If the fix affects the UI attach some screenshots here.