-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add select
option to Editor.groupShapes
and Editor.ungroupShapes
#3690
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
Taha-Hassan-Git
temporarily deployed
to
deploy-staging
May 3, 2024 11:40
— with
GitHub Actions
Inactive
15 tasks
huppy-bot
bot
added
improvement
Improves existing features
sdk
Affects the tldraw sdk
labels
May 3, 2024
ds300
reviewed
May 14, 2024
Comment on lines
6592
to
6593
groupId = createShapeId(), | ||
options: TLGroupShapesOptions = { selectAfterGrouping: true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to combine these into one options argument while preserving backwards compatibility. something like this
export type TLGroupShapesOptions = {
selectAfterGrouping?: boolean
shapeId?: string
}
// ...
groupShapes(shapes: TLShapeId[] | TLShape[], options: TLGroupShapesOptions | TLShapeId = {}) {
if (typeof options === 'string') {
options = { groupId: options }
}
// ...
}
That way we keep the 'options' a bit tidier.
steveruizok
changed the title
Add options arg to groupShapes method
Add Jun 3, 2024
select
option to Editor.groupShapes
and Editor.ungroupShapes
steveruizok
temporarily deployed
to
deploy-staging
June 3, 2024 09:03
— with
GitHub Actions
Inactive
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds an (optional) options argument to the
Editor.groupShapes
andEditor.ungroupShapes
methods.Taha's original PR:
This PR seeks to make it easier to disentangle shape selection logic from the grouping shapes logic. This is one of two approaches we could take to this problem.
Other PR is here: #3691
I think this is a better method because it doesn't require consumers of the library with their own custom actions to change the way their own grouping logic works. As evidenced by all the tests failing on the other PR.
Change Type
sdk
— Changes the tldraw SDKdotcom
— Changes the tldraw.com web appdocs
— Changes to the documentation, examples, or templates.vs code
— Changes to the vscode plugininternal
— Does not affect user-facing stuffbugfix
— Bug fixfeature
— New featureimprovement
— Improving existing featureschore
— Updating dependencies, other boring stuffgalaxy brain
— Architectural changestests
— Changes to any test codetools
— Changes to infrastructure, CI, internal scripts, debugging tools, etc.dunno
— I don't knowTest Plan
Release Notes