Skip to content

Bugfix: Prevent mobile yank back - #741

Merged
lawsie merged 2 commits into
flipcomputing:mainfrom
lawsie:bugfix-yank-back
Aug 6, 2026
Merged

Bugfix: Prevent mobile yank back#741
lawsie merged 2 commits into
flipcomputing:mainfrom
lawsie:bugfix-yank-back

Conversation

@lawsie

@lawsie lawsie commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

On mobile if a block is wide and you tried to open a dropdown on the far right of the block, the view would immediately be yanked back to the left side of the block before you could open it, meaning you couldn't use anything on the right of the blocks.

AI usage

Claude Sonnet 5 fixed this. I didn't participate much other than describing the problem.

Summary by CodeRabbit

  • Bug Fixes
    • Prevented unintended workspace jumps and large horizontal scrolling after interacting with the canvas or editing fields.
    • Improved focus behavior when clicking outside the toolbox and flyout.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@lawsie, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 31 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 274811cd-8996-4ee2-a322-fdabf4327a86

📥 Commits

Reviewing files that changed from the base of the PR and between b910741 and 8aa0ea8.

📒 Files selected for processing (3)
  • main/blocklyinit.js
  • tests/blocklyinit.test.js
  • tests/tests.html
📝 Walkthrough

Walkthrough

Workspace jump suppression now tracks canvas pointerdown events outside the toolbox and flyout. Large focus-triggered horizontal scrolls are suppressed after recent canvas interaction or field editing.

Changes

Workspace jump suppression

Layer / File(s) Summary
Track canvas interactions and suppress workspace jumps
main/blocklyinit.js
The debug logic records capture-phase canvas interactions outside the toolbox and flyout. Large focus-related horizontal scrolls are rejected when a canvas interaction occurred within 800 ms or a field edit occurred within 1500 ms.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • flipcomputing/flock#509: Both changes update workspace jump suppression in main/blocklyinit.js; this change adds recent canvas pointerdown tracking.

Suggested labels: codex

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the mobile yank-back bug addressed by the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@main/blocklyinit.js`:
- Line 223: Update the conditional in the workspaceScroll flow that checks
fromFocusScroll, recentFieldInteraction, and largeHorizontalJump so it
suppresses only the horizontal scroll while preserving the requested Y
coordinate. Do not return early in a way that cancels both scroll coordinates;
ensure workspaceScroll(x, y) still applies the vertical target for focus
actions.
- Around line 211-223: Add a mobile/API regression test for the suppression
condition around lastCanvasPointerDown, fromFocusScroll, recentFieldInteraction,
and largeHorizontalJump. Simulate a canvas pointerdown followed by far-right
field focus/focus scrolling, assert horizontal scrolling is suppressed while
required vertical scrolling still occurs, then run the automated test suite and
report the result.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 31bf2079-c0c3-48ec-8ada-e4dd77987fdb

📥 Commits

Reviewing files that changed from the base of the PR and between 3e469d7 and b910741.

📒 Files selected for processing (1)
  • main/blocklyinit.js

Comment thread main/blocklyinit.js
Comment thread main/blocklyinit.js
@lawsie
lawsie merged commit 3b30dad into flipcomputing:main Aug 6, 2026
3 checks passed
@lawsie
lawsie deleted the bugfix-yank-back branch August 6, 2026 14:51
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.

1 participant