Skip to content

Skip redundant keyboard nav in string blocks#679

Open
lawsie wants to merge 1 commit into
flipcomputing:mainfrom
lawsie:quote-block-tab
Open

Skip redundant keyboard nav in string blocks#679
lawsie wants to merge 1 commit into
flipcomputing:mainfrom
lawsie:quote-block-tab

Conversation

@lawsie

@lawsie lawsie commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

There is now no redundant double-right keyboard navigation for a string block 🎉

no-redundant-tap

AI usage

After a lengthy back and forth about how this should work, and failure to implement it correctly, I had to get the big guns out. Claude Opus 4.8 wrote all of the code. I debugged and made suggestions.

Summary by CodeRabbit

  • Bug Fixes
    • Improved keyboard navigation in the block editor. Arrow key navigation now moves directly to editable fields instead of stopping at intermediate shadow blocks, providing a more intuitive and efficient editing experience.

@lawsie lawsie changed the title Skip redundant tab Skip redundant keyboard nav in string blocks Jun 15, 2026
@lawsie lawsie requested a review from tracygardner June 15, 2026 15:42
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 036d89d5-b6e2-4566-a5e9-32e88caa2fd3

📥 Commits

Reviewing files that changed from the base of the PR and between 5b1d8a1 and 471e72c.

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

📝 Walkthrough

Walkthrough

A new installShadowNavigationPatch(ws) function is added to blocklyinit.js that overrides Blockly's workspace navigator movement methods (getInNode, getOutNode, getNextNode, getPreviousNode) to skip shadow value blocks and redirect keyboard focus to the shadow's first editable field. The patch is activated by calling it during createBlocklyWorkspace() initialization.

Changes

Shadow Keyboard Navigation Patch

Layer / File(s) Summary
Shadow navigation patch implementation and workspace wiring
main/blocklyinit.js
Defines installShadowNavigationPatch(ws) with isSkippableShadow and getFirstFocusableField helpers, overrides all four navigator movement methods to bypass shadow value blocks and focus their primary editable field using document.activeElement detection, and wires the patch into createBlocklyWorkspace() initialization.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐇 Hopping through blocks, left and right I go,
No shadow shall slow my keyboard flow!
I skip the redundant, I find the real field,
My focus arrow never shall yield.
Arrow keys guide me with logic so neat —
Shadow navigation: now complete! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Skip redundant keyboard nav in string blocks' directly addresses the main change: removing double-right keyboard navigation redundancy in string blocks, which aligns with the PR's primary objective.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

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