Skip to content

fix: Fix positioning of move marker on blocks#9722

Merged
gonfunko merged 2 commits intov13from
move-marker-placement
Apr 13, 2026
Merged

fix: Fix positioning of move marker on blocks#9722
gonfunko merged 2 commits intov13from
move-marker-placement

Conversation

@gonfunko
Copy link
Copy Markdown
Contributor

The basics

The details

Resolves

Fixes #9702

Proposed Changes

This PR resolves two issues with move indicator placement:

  • The initial placement now waits for a render to complete to avoid the position changing
  • For blocks, the indicator is anchored to the rightmost point of the topmost block

@gonfunko gonfunko requested a review from a team as a code owner April 13, 2026 19:33
@gonfunko gonfunko requested a review from mikeharv April 13, 2026 19:33
@github-actions github-actions bot added the PR: fix Fixes a bug label Apr 13, 2026
Copy link
Copy Markdown
Contributor

@mikeharv mikeharv left a comment

Choose a reason for hiding this comment

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

A couple small suggestions, but this looks like a good solution!

renderManagement.finishQueuedRenders().then(() => {
let bounds = this.draggable?.getBoundingRectangle();
if (
this.draggable &&
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it possible that this.draggable could change before the async promise resolves? It might be worth using a local variable to capture this before the async call to be sure we're looking at the right block.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No, it's only mutable by starting a move, and you can't do that while a move is in progress.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh right. Thanks for explaining.

// as the starting block.
while (
targetBlock?.getBoundingRectangleWithoutChildren().getOrigin().y !==
block.getBoundingRectangleWithoutChildren().getOrigin().y
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: Could we cache this before the loop so we don't have to recalculate each time through the loop?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We could also make a getY helper to possibly make this more readable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Split it out of the loop, which also improved the readability.

@gonfunko gonfunko changed the title fix: Fix positioning of move marker on blocks. fix: Fix positioning of move marker on blocks Apr 13, 2026
@github-actions github-actions bot added PR: fix Fixes a bug and removed PR: fix Fixes a bug labels Apr 13, 2026
@gonfunko gonfunko requested a review from mikeharv April 13, 2026 20:16
@gonfunko gonfunko merged commit 13459a2 into v13 Apr 13, 2026
5 checks passed
@gonfunko gonfunko deleted the move-marker-placement branch April 13, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants