-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fix: Anvil drag preview for section widget #33198
Conversation
WalkthroughThe recent updates aim to enhance the drag preview functionality for widgets within the Anvil editor by introducing the Changes
Possibly related issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/8967677762. |
Deploy-Preview-URL: https://ce-33198.dp.appsmith.com |
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/8969393864. |
Deploy-Preview-URL: https://ce-33198.dp.appsmith.com |
widgetConfig.displayName | ||
) { | ||
return { | ||
thumbnail: widgetConfig.thumbnailSVG, |
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.
Maybe, we don't need to support SVG for anvil? I think the code will be a little clearer without it.
const widgetType = isNewWidget | ||
? dragDetails?.newWidget?.type | ||
: dragDetails?.draggingGroupCenter?.widgetType || ""; | ||
const dragPreviewProps: |
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.
Could you create named type for this? Really difficult to read this inline types.
…o section-drag-preview
ThumbnailCmp, | ||
}: { | ||
displayName: string; | ||
ThumbnailCmp?: React.FC; |
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.
Isn't this a required prop for this component?
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.
it is required to show the icon whilst dragging, however we are checking for scenarios where the Icon is not provided since the ThumbnailCmp is not a required config for all widgets.
When it is not present we just render the widget display name on the drag preview without the icon.
Description
Fixes #
Issue Number
or
Fixes
Issue URL
Warning
If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.
Automation
/ok-to-test tags="@tag.Anvil"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/8983616703
Commit: d96144a
Cypress dashboard url: Click here!
Communication
Should the DevRel and Marketing teams inform users about this change?