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

Make the token draggable #2441

Merged
merged 71 commits into from
Apr 27, 2024
Merged

Make the token draggable #2441

merged 71 commits into from
Apr 27, 2024

Conversation

jakzaizzat
Copy link
Collaborator

@jakzaizzat jakzaizzat commented Apr 25, 2024

Summary of Changes

  • Now we can drag the token in the editor!
  • All the changes can be saved in the db as well

Demo or Before/After Pics

CleanShot.2024-04-26.at.15.02.22.mp4

Edge Cases

  1. Tested after enabled the row dnd and token dnd
  2. Added new token in the active row
  3. Update the column of the row

Testing Steps

Provide steps on how the reviewer can test the changes.

Checklist

Please make sure to review and check all of the following:

  • I've tested the changes and all tests pass.
  • (if mobile) I've tested the changes on both light and dark modes.

Copy link

vercel bot commented Apr 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gallery ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 27, 2024 2:20am

Copy link

github-actions bot commented Apr 25, 2024

Bundle Sizes

Compared against 0b6d352

Route: No significant changes found

Dynamic import: No significant changes found

@jakzaizzat jakzaizzat changed the title Jakz/gallery editor token draggable Make the token draggable Apr 26, 2024
Comment on lines -250 to -255
transform: [
{ translateY: translateY.value ?? 0 },
{
scale: withSpring(isGestureActive.value ? 1.05 : 1),
},
],
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove the scale for the row here. Kind of weird when hovering the token to drag but the **row ** as triggered too

Comment on lines +81 to +89
<SortableTokenGrid
columns={row.columns}
items={row.items}
size={widthPerToken}
scrollContentOffsetY={scrollContentOffsetY}
scrollViewRef={scrollViewRef}
onDragStart={handleDragStart}
onDragEnd={handleDragEnd}
/>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This component responsible to render the item in grid view

Copy link
Contributor

Choose a reason for hiding this comment

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

can we add this as a comment?

Copy link
Contributor

@Robinnnnn Robinnnnn left a comment

Choose a reason for hiding this comment

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

jakz you are literally a magician

Comment on lines +81 to +89
<SortableTokenGrid
columns={row.columns}
items={row.items}
size={widthPerToken}
scrollContentOffsetY={scrollContentOffsetY}
scrollViewRef={scrollViewRef}
onDragStart={handleDragStart}
onDragEnd={handleDragEnd}
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add this as a comment?

Comment on lines 53 to 55
style={{
height: containerHeight,
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

let's memoize this object

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated it!

@jakzaizzat jakzaizzat merged commit 4fcb55f into main Apr 27, 2024
9 checks passed
@jakzaizzat jakzaizzat deleted the jakz/gallery-editor-token-draggable branch April 27, 2024 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants