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: have the gesture use a dragger for blocks #7972

Merged
merged 4 commits into from
Mar 29, 2024

Conversation

BeksOmega
Copy link
Collaborator

@BeksOmega BeksOmega commented Mar 28, 2024

The basics

The details

Resolves

Work on #7844

Proposed Changes

Upgrades the gesture class to use a IDragger for dragging blocks instead of using a IBlockDragger. This conforms to our new design for handling dragging.

Test Coverage

Manually tested with all of the previous PRs, and everything seems to wire together correctly! Once this is in I can hammer it more.

Documentation

N/A

Additional Information

As I write the other IDraggables I'll migrate the gesture to pass those to the dragger instead of using special draggers. (i.e. the workspaceDragger and bubbleDragger)

@github-actions github-actions bot added PR: feature Adds a feature and removed PR: feature Adds a feature labels Mar 28, 2024
@BeksOmega BeksOmega force-pushed the feat/gesture-use-draggers branch from 72b1c24 to e2b4f41 Compare March 28, 2024 23:08
@BeksOmega BeksOmega marked this pull request as ready for review March 28, 2024 23:12
@BeksOmega BeksOmega requested a review from a team as a code owner March 28, 2024 23:12
@BeksOmega BeksOmega requested a review from maribethb March 28, 2024 23:12
@BeksOmega BeksOmega requested review from rachel-fenichel and removed request for maribethb March 28, 2024 23:12
core/gesture.ts Outdated
@@ -1235,9 +1230,6 @@ export class Gesture {
* @internal
*/
getInsertionMarkers(): BlockSvg[] {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm probably missing context, but: why does this function continue to exist but always return an empty list? Will you re-implement it later?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Mmm I left this like this because I wasn't quite sure what to do with it, since the draggable doesn't have APIs for getting insertion markers, cuz that's super specific to blocks. But I think I can reimplements this by just walking the workspace and checking for any blocks that are flagged as insertion markers. I'll check where this is getting called from and whether that's going to be a performance killer or not.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So it turns out that getInsertionMarkers is only called from workspace.render, so I just moved the relevant logic into there. Performance impact shouldn't be an issue, because we don't actually call that method. And if people are calling it and run into problems, I can give them more performant ways of triggering rerenders.

@BeksOmega BeksOmega merged commit da8a83b into google:rc/v11.0.0 Mar 29, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: feature Adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants