Use canvas layout for all advanced RPL widgets#17028
Conversation
| icon: 'IconTimelineEvent', | ||
| position: 200, | ||
| layoutMode: 'vertical-list', | ||
| layoutMode: 'canvas', |
There was a problem hiding this comment.
Bug: Changing default layouts to canvas mode will hide any widgets beyond the first one, as PageLayoutCanvasViewer only renders widgets.at(0).
Severity: CRITICAL
🔍 Detailed Analysis
The pull request changes several default page layout tabs from vertical-list to canvas mode. The PageLayoutCanvasViewer component, which renders canvas layouts, is designed to only display the first widget in the list (widgets.at(0)). However, there are no validation checks in place to prevent users from adding multiple widgets to a tab in canvas mode. As a result, if a user adds more than one widget to these newly converted canvas tabs, all widgets after the first one will be silently hidden from view, leading to a confusing user experience and perceived data loss. This also affects existing customizations where users may have already added multiple widgets.
💡 Suggested Fix
Prevent users from adding more than one widget to tabs with layoutMode: 'canvas'. This can be achieved by adding a validation check within the widget creation hooks (e.g., useCreatePageLayoutStandaloneRichTextWidget) before adding a new widget to a tab.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location:
packages/twenty-front/src/modules/page-layout/constants/DefaultPersonRecordPageLayout.ts#L58
Potential issue: The pull request changes several default page layout tabs from
`vertical-list` to `canvas` mode. The `PageLayoutCanvasViewer` component, which renders
canvas layouts, is designed to only display the first widget in the list
(`widgets.at(0)`). However, there are no validation checks in place to prevent users
from adding multiple widgets to a tab in canvas mode. As a result, if a user adds more
than one widget to these newly converted canvas tabs, all widgets after the first one
will be silently hidden from view, leading to a confusing user experience and perceived
data loss. This also affects existing customizations where users may have already added
multiple widgets.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 8353563
There was a problem hiding this comment.
Pull request overview
This pull request updates the layout mode for advanced RPL (Record Page Layout) widgets from 'vertical-list' to 'canvas' across all default record page layouts. The change improves the visual presentation of interactive widgets like Timeline, Tasks, Notes, Files, Emails, and Calendar, while keeping the basic Fields tabs unchanged.
Key changes:
- Updated layoutMode from 'vertical-list' to 'canvas' for advanced widgets across 6 default page layout files
- Basic tabs (Fields, Note) intentionally remain as 'vertical-list'
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| DefaultTaskRecordPageLayout.ts | Updated Timeline and Files tabs to use canvas layout |
| DefaultRecordPageLayout.ts | Updated Timeline, Tasks, Notes, and Files tabs to use canvas layout |
| DefaultPersonRecordPageLayout.ts | Updated Timeline, Tasks, Notes, Files, Emails, and Calendar tabs to use canvas layout |
| DefaultOpportunityRecordPageLayout.ts | Updated Timeline, Tasks, Notes, Files, Emails, and Calendar tabs to use canvas layout |
| DefaultNoteRecordPageLayout.ts | Updated Timeline and Files tabs to use canvas layout |
| DefaultCompanyRecordPageLayout.ts | Updated Timeline, Tasks, Notes, Files, Emails, and Calendar tabs to use canvas layout |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:14741 This environment will automatically shut down when the PR is closed or after 5 hours. |
|
Hey @Devessier! After you've done the QA of your Pull Request, you can mark it as done here. Thank you! |
2 similar comments
|
Hey @Devessier! After you've done the QA of your Pull Request, you can mark it as done here. Thank you! |
|
Hey @Devessier! After you've done the QA of your Pull Request, you can mark it as done here. Thank you! |
Before
After