Skip to content

refactor!: Move responsibility for block creation out of flyouts#9610

Merged
gonfunko merged 6 commits intov13from
flyout-moves
Mar 5, 2026
Merged

refactor!: Move responsibility for block creation out of flyouts#9610
gonfunko merged 6 commits intov13from
flyout-moves

Conversation

@gonfunko
Copy link
Contributor

@gonfunko gonfunko commented Mar 3, 2026

The basics

The details

Proposed Changes

This PR moves block creation out of the flyout and into the BlockDragStrategy. This simplifies the code overall and results in a better separation of concerns: flyouts are capable of holding arbitrary kinds of objects now, so having them tightly coupled to blocks is suboptimal. Now, duplicating blocks when dragged out of the flyout is handled by the BlockDragStrategy, and the flyout is concerned only with the display and layout of its contents, whatever they may be. As a result of this change, it's now possible to copy blocks out of the flyout using the keyboard alone by selecting a block in the flyout and hitting m to enter move mode, which copies the block to the main workspace and puts it in move mode, exactly the same as a mouse-driven drag would.

Breaking Changes

  • createBlock(), isDragTowardWorkspace(), and isBlockCreatable() have been removed from IFlyout. While this is not breaking from a building standpoint, it is behaviorally breaking if you have an alternate flyout implementation that customized those methods. isDragTowardWorkspace() was already a no-op, so no action needs to be taken other than removing it. Customizations that were made to createBlock() and isBlockCreatable() can be achieved by creating a BlockDragStrategy subclass that overrides isMovable() and/or swapTargetBlock() and using a mixin or extension to apply that drag strategy to your blocks.

@gonfunko gonfunko requested a review from maribethb March 3, 2026 20:42
@gonfunko gonfunko requested a review from a team as a code owner March 3, 2026 20:42
@github-actions github-actions bot added breaking change Used to mark a PR or issue that changes our public APIs. PR: refactor labels Mar 3, 2026
@gonfunko
Copy link
Contributor Author

gonfunko commented Mar 3, 2026

@gonfunko gonfunko merged commit a5a18d3 into v13 Mar 5, 2026
4 of 5 checks passed
@gonfunko gonfunko deleted the flyout-moves branch March 5, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Used to mark a PR or issue that changes our public APIs. PR: refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants