Skip to content
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

feat(widget-builder): Make widget builder preview draggable #82038

Closed

Conversation

nikkikapadia
Copy link
Member

The responsive design for the widget builder allows for a draggable preview on smaller screens. The preview is now draggable by the dnd-kit library. It is only draggable when the slideout is the full screen width (on small screens), otherwise it is not draggable. The preview is on top of the widget builder and can be shifted around for easy access to the fields. It looks like this yayyy:

Screen.Recording.2024-12-12.at.2.51.05.PM.mov

Closes #81804

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Dec 12, 2024
@nikkikapadia nikkikapadia marked this pull request as ready for review December 12, 2024 21:09
@nikkikapadia nikkikapadia requested a review from a team as a code owner December 12, 2024 21:09
@@ -93,10 +93,10 @@ const _SlideOverPanel = styled(motion.div, {
}>`
position: fixed;

top: ${space(2)};
right: 0;
top: ${p => (p.slidePosition === 'left' ? '54px' : space(2))};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there some kind of constant we could use in place of the 54px? Just trying to see if there's something a bit more semantic

<DraggableWidgetContainer
ref={setNodeRef}
id={WIDGET_PREVIEW_DRAG_ID}
style={{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might be able to eek out some small perf gains by telling the browser these values will change.
https://developer.mozilla.org/en-US/docs/Learn/Performance/CSS#optimizing_element_changes_with_will-change

i.e. you can probably add willChange: 'opacity, transform'

@nikkikapadia
Copy link
Member Author

closing this pr because i misunderstood the responsive design lol

@github-actions github-actions bot locked and limited conversation to collaborators Dec 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Responsive behaviour for widget preview
2 participants