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

fix!: update the scroll options to work with v11 dragging #2316

Merged
merged 5 commits into from
Apr 11, 2024

Conversation

BeksOmega
Copy link
Contributor

@BeksOmega BeksOmega commented Apr 8, 2024

The basics

The details

Resolves

Fixes #2317

Proposed Changes

Makes it so the scroll-options plugin works with the new dragging system.

Test Coverage

Tested manually with changes in core. Dragging workspace comments to the edge of the workspace properly scrolls yay!

Documentation

N/A

Additional Information

Dependent on google/blockly#8016, but we have no tests so we can still merge this.

Breaking changes / To Fix

The ScrollBlockDragger now conforms to the new IDraggable interfaces in v11 of core Blockly.

When constructing an AutoScroll you now have to pass the ScrollBlockDragger as well.

@BeksOmega BeksOmega changed the title Fix/scroll v11 fix!: update the scroll options to work with v11 dragging Apr 8, 2024
@BeksOmega BeksOmega marked this pull request as ready for review April 8, 2024 18:47
@BeksOmega BeksOmega requested a review from a team as a code owner April 8, 2024 18:47
@BeksOmega BeksOmega requested review from maribethb and removed request for a team April 8, 2024 18:47
@BeksOmega BeksOmega marked this pull request as draft April 8, 2024 18:47
@BeksOmega BeksOmega marked this pull request as ready for review April 8, 2024 18:57
Copy link
Contributor

@maribethb maribethb left a comment

Choose a reason for hiding this comment

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

LGTM, but can you update the PR description with a breaking change section? This is only a breaking change if you're subclassing elements of this plugin and if so then the class has been renamed. If you're simply installing and configuring this plugin, you don't need to take any action [edited].

plugins/scroll-options/src/ScrollDragger.js Outdated Show resolved Hide resolved
plugins/scroll-options/src/ScrollDragger.js Outdated Show resolved Hide resolved
@BeksOmega
Copy link
Contributor Author

LGTM, but can you update the PR description with a breaking change section? This is only a breaking change if you're subclassing elements of this plugin and if so then the class has been renamed. If you're simply installing and configuring this plugin, you don't need to take any action [edited].

I think it's a breaking change either way because of the renaming. To pass it to the configuration structure you need to get it by name. Do you want me to not rename it?

@maribethb
Copy link
Contributor

LGTM, but can you update the PR description with a breaking change section? This is only a breaking change if you're subclassing elements of this plugin and if so then the class has been renamed. If you're simply installing and configuring this plugin, you don't need to take any action [edited].

I think it's a breaking change either way because of the renaming. To pass it to the configuration structure you need to get it by name. Do you want me to not rename it?

Hmm, yeah. I think the value gained in renaming it is lower than the annoyance of making developers rename their plugin struct. The rename is more accurate but there's little value in that to the plugin user imo. I'd probably keep the name and have a comment explaining it now can drag more than blocks.

I think renames that affect people subclassing these classes or doing more advanced work are ok. But we should try not to break people who are just using the plugin as-is unless we have good reason. Open to debate on this point though :)

@BeksOmega
Copy link
Contributor Author

LGTM, but can you update the PR description with a breaking change section? This is only a breaking change if you're subclassing elements of this plugin and if so then the class has been renamed. If you're simply installing and configuring this plugin, you don't need to take any action [edited].

I think it's a breaking change either way because of the renaming. To pass it to the configuration structure you need to get it by name. Do you want me to not rename it?

Hmm, yeah. I think the value gained in renaming it is lower than the annoyance of making developers rename their plugin struct. The rename is more accurate but there's little value in that to the plugin user imo. I'd probably keep the name and have a comment explaining it now can drag more than blocks.

I think renames that affect people subclassing these classes or doing more advanced work are ok. But we should try not to break people who are just using the plugin as-is unless we have good reason. Open to debate on this point though :)

Ehh as a team, we have this same argument every time we want to rename something. And then it's like "do we want to create an alias?" "well aliases are also annoying" etc etc. And it goes on forever. I'd rather just get this merged.

@maribethb
Copy link
Contributor

Yes, but in the past we've also decided not to do renames that don't add a lot of value to the end-user. Most recently I recall were some changes in generators where we decided not to do renames and not to add aliases. So I don't think this decision is inconsistent.

@BeksOmega
Copy link
Contributor Author

Yes, but in the past we've also decided not to do renames that don't add a lot of value to the end-user. Most recently I recall were some changes in generators where we decided not to do renames and not to add aliases. So I don't think this decision is inconsistent.

Oh to clarify I'm going to make the change you suggested! I was just saying I don't need to discuss it more and was just going to go with whatever you said haha.

@BeksOmega
Copy link
Contributor Author

@maribethb Can you give this another quick look since I made the naming changes?

Copy link
Contributor

@maribethb maribethb left a comment

Choose a reason for hiding this comment

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

I think the 3 places I noted still need to be updated then lgtm

plugins/scroll-options/src/index.js Show resolved Hide resolved
/**
* Workspace to scroll.
* @protected {!Blockly.WorkspaceSvg}
*/
this.workspace_ = workspace;

/** @private {!ScrollDragger} */
Copy link
Contributor

Choose a reason for hiding this comment

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

this name needs to be updated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh hm I guess rename symbol doesn't work for jsdoc tags?

@BeksOmega BeksOmega merged commit f5aaa98 into google:rc/v11.0.0 Apr 11, 2024
8 checks passed
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.

2 participants