-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Delete button in right drawer / side pannel #7200
base: main
Are you sure you want to change the base?
Conversation
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.
PR Summary
This PR adds a delete button to the right drawer/side panel of the show page, addressing issue #7069 by allowing users to delete notes/tasks directly from the side panel.
- Implemented delete functionality in
packages/twenty-front/src/modules/ui/layout/show-page/components/ShowPageRightContainer.tsx
- Added a styled component
StyledButtonContainer
for consistent button placement - Utilized
useDeleteOneRecord
hook for record deletion - Conditionally rendered the delete button when the component is in the right drawer
- Improved user experience by enabling quick deletion without navigating to the Notes object list
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
Hello @ehconitin ! It seems that the trash Icon is missing in the button ;) |
@bosiraphael oops, I am yet to finalize changes Raphael. |
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.
Left some comments :)
packages/twenty-front/src/modules/ui/layout/show-page/components/ShowPageRightContainer.tsx
Outdated
Show resolved
Hide resolved
packages/twenty-front/src/modules/ui/layout/show-page/components/ShowPageRightContainer.tsx
Outdated
Show resolved
Hide resolved
packages/twenty-front/src/modules/ui/layout/show-page/components/ShowPageRightContainer.tsx
Outdated
Show resolved
Hide resolved
Okay no worries! When you are still working on your PR, you can open a draft PR instead, or just add the label |
@bosiraphael yup yup, will take a note of it for next time :) |
@bosiraphael |
I think the issue of the button being missaligned has something to do with the |
@FelixMalfait
2024-09-25.18-10-15.mp4 |
|
||
const StyledRightDrawerRecord = styled.div` | ||
height: ${({ theme }) => | ||
useIsMobile() ? `calc(100% - ${theme.spacing(16)})` : '100%'}; |
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.
@bosiraphael
This is correct right? this is regarding the height of the right drawer.
Should i just use a local const like in CommandMenu? or create new const file and export it from there to both the 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.
Second option is better to avoid code duplication :)
@ehconitin yes re-fetching is not a best practise, it throws an additional request to fetch the resource again, while we should instead be able to optimistically predict the result and modify the cache based on that |
Hi @FelixMalfait, I don't have much expertise in this area, unfortunately. @bosiraphael, could you assist with this? For more context, please follow the comment thread here. |
As discussed in Discord, since we introduce Soft Delete, the delete isn't really a delete anymore, so we should instead leverage what's been done for optimistic updates when there's a delete, as what we call "delete" is actually closer to an update. |
@FelixMalfait Understood, I am still thinking about it :(. Ill get back to you! |
fixes #7069
@Bonapara
2024-09-23.17-42-55.mp4