Feature 15797 add secondary action button#16582
Conversation
…ithub.com/Lakshayyy-m/twenty into feature-15797-add-secondary-action-button
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
Pull request overview
This PR adds support for secondary action buttons in table cells for phone, email, and link fields. It enables users to toggle between copy and navigate actions based on the field's configured click action setting.
- Enhanced
RecordTableCellButtonto support optional secondary action buttons usingLightIconButtonGroup - Extended
RecordTableCellEditButtonto provide both copy and navigate actions as primary/secondary buttons for phone, email, and link fields based on their configured click action - Added I18n decorator to storybook configuration and removed
isDisplayModeFixHeightfrom default context values
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
RecordTableCellEditButton.tsx |
Added logic to determine primary/secondary actions (copy/navigate) based on field type and click action configuration |
RecordTableCellButton.tsx |
Refactored to use LightIconButtonGroup for rendering multiple action buttons and added border styling |
RecordInlineCellContext.tsx |
Removed isDisplayModeFixHeight from default context values |
SettingsDataModelFieldPreviewWidget.stories.tsx |
Added I18nFrontDecorator for internationalization support |
Comments suppressed due to low confidence (2)
packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellEditButton.tsx:27
- Unused variable enqueueSuccessSnackBar.
const { enqueueSuccessSnackBar, enqueueErrorSnackBar } = useSnackBar();
packages/twenty-front/src/modules/object-record/record-table/record-table-cell/components/RecordTableCellEditButton.tsx:27
- Unused variable enqueueErrorSnackBar.
const { enqueueSuccessSnackBar, enqueueErrorSnackBar } = useSnackBar();
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...odules/object-record/record-table/record-table-cell/components/RecordTableCellEditButton.tsx
Outdated
Show resolved
Hide resolved
...ty-front/src/modules/object-record/record-inline-cell/components/RecordInlineCellContext.tsx
Show resolved
Hide resolved
...odules/object-record/record-table/record-table-cell/components/RecordTableCellEditButton.tsx
Outdated
Show resolved
Hide resolved
...odules/object-record/record-table/record-table-cell/components/RecordTableCellEditButton.tsx
Show resolved
Hide resolved
| editModeContent: undefined, | ||
| editModeContentOnly: false, | ||
| displayModeContent: undefined, | ||
| isDisplayModeFixHeight: false, |
There was a problem hiding this comment.
@Lakshayyy-m Why do you remove this default prop ?
There was a problem hiding this comment.
@Lakshayyy-m Thanks a lot for your contribution ! 🙏
As you already do extra work with rebase, I update myself rather than commenting. I simply move the secondary button action logic in a dedicated hook.
Thank you for your work and patience !
|
Hey @etiennejouan, |
|
Hey @etiennejouan! After you've done the QA of your Pull Request, you can mark it as done here. Thank you! |
|
Thanks @Lakshayyy-m for your contribution! |
@Lakshayyy-m, congrats for your first merged PR ! 👏 |
Merged #16582 without testing case when fieldDefinition.metadata.settings?.clickAction is not set (default value) To test : When <img width="548" height="537" alt="Screenshot 2025-12-17 at 09 37 26" src="https://github.com/user-attachments/assets/96a85093-24bb-4436-9000-340cd020e343" /> is set (or default) In table view you can copy cell content <img width="252" height="77" alt="Screenshot 2025-12-17 at 09 36 58" src="https://github.com/user-attachments/assets/44b938f3-74b8-4d58-8b1a-344b4f39bfbd" />
This is a fix for #15797 This pull request is to replace PR #16307 and to extend #16265 Just to repeat, this PR does the following -> **Table Cell Button and Edit Button Improvements** - Enhanced RecordTableCellButton to support a secondary action and icon, enabling both the primary and secondary actions based on the selected action mode. - Updated RecordTableCellEditButton to determine the action mode for actionable fields, and provide both copy and navigate actions as primary/secondary buttons, with appropriate feedback. ## When primary function is to copy <img width="1817" height="939" alt="image" src="https://github.com/user-attachments/assets/7ec6c6aa-80d8-402b-a210-519163d39ef6" /> ## When primary function is to open link <img width="1784" height="942" alt="image" src="https://github.com/user-attachments/assets/dfe0fcf1-ba72-4083-a5f9-7165a03db3df" /> Hey @etiennejouan, please have a look! Thank you --------- Co-authored-by: Etienne <45695613+etiennejouan@users.noreply.github.com>
Merged #16582 without testing case when fieldDefinition.metadata.settings?.clickAction is not set (default value) To test : When <img width="548" height="537" alt="Screenshot 2025-12-17 at 09 37 26" src="https://github.com/user-attachments/assets/96a85093-24bb-4436-9000-340cd020e343" /> is set (or default) In table view you can copy cell content <img width="252" height="77" alt="Screenshot 2025-12-17 at 09 36 58" src="https://github.com/user-attachments/assets/44b938f3-74b8-4d58-8b1a-344b4f39bfbd" />

This is a fix for #15797
This pull request is to replace PR #16307 and to extend #16265
Just to repeat, this PR does the following ->
Table Cell Button and Edit Button Improvements
When primary function is to copy
When primary function is to open link
Hey @etiennejouan, please have a look!
Thank you