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

[REG-1903] Drag and Drop Sequence Editor #271

Merged
merged 13 commits into from
Aug 30, 2024
Merged

Conversation

addisonbgross
Copy link
Contributor

image

The main focus of this PR is to establish the drag and drop interaction that will be used for creating and editing bot Sequences. The next PR will use real Segments, and will save the new Sequence

I apologize for the size of this PR. Luckily most of the changes are from new prefabs

What has been done

  • Added the Sequence Editor prefab, where the user can drag and drop Segment Cards into a Drop Zone
    • Cards can be added or removed from the Drop Zone
    • Cards can be reordered within the Drop Zone
      • This Drop Zone can display an optional empty state/message
    • An animation will play when removing a card (or choosing not to add it to the Drop Zone)
  • Added assets used in the Sequence Editor, Drop Zone, and Segment Cards

Out of Scope

  • Fetching Bot Segments and using them to populate the list of Available Segments within the Sequence Editor
  • The Sequence Editor's button to refresh the Available Segments list
  • A scrollable list of Segments within the Drop Zone. Getting this particular section scrolling was breaking my brain, I'll take it on in my follow-up PR to this
  • Saving the new Bot Sequence, and the button needed to do so
  • More styling updates
  • Tests! They will be my next task after this create flow is ready

LOOM

https://www.loom.com/share/1176801c9be147fd948630be6505a7af


// check if this card is within a drop zone the moment it begins dragging. If so, this card is being
// reordered or deleted, not added as a new child
Vector2 mouseScreenSpacePosition = Input.mousePosition;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do I need to do any special handling of these mouse input events?

Copy link
Collaborator

@vontell vontell left a comment

Choose a reason for hiding this comment

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

This is seriously so awesome to see! Love the attention to detail, especially with that fade out deletion. Also appreciate the comments and code structure, was super easy to review. LGTM!

Copy link
Contributor

@batu batu left a comment

Choose a reason for hiding this comment

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

This looks sweet!

Non blocking, most likely already in scope for the next PR: How difficult would it be to implement this type of drop shadow when dragging/reordering segments already in the dropzone?
image

@batu
Copy link
Contributor

batu commented Aug 30, 2024

Idea/Question:

What should/does happen when we double click on a segment? In this view, do we have a way for the user to get more information about each segment?

Copy link
Collaborator

@RG-nAmKcAz RG-nAmKcAz left a comment

Choose a reason for hiding this comment

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

Regarding the drag/drop into a scrollable box. I've seen this done a few different ways, but one way is to treat the draggable area as a fixed area.

Then transform those coordinates into the scrollable component behind it based on its relative scroll position at the time.

A bit tedious/manual but reliable

@addisonbgross
Copy link
Contributor Author

@batu thanks for the great input!

  • I think having some sort of visual indicator when reordering segments is a solid idea
  • I'm hoping to add an expanded view of the segment cards when clicked on. Larger, with more information

@addisonbgross addisonbgross merged commit 98a95a2 into main Aug 30, 2024
2 checks passed
@addisonbgross addisonbgross deleted the addison/reg-1903 branch August 30, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants