feat: Automatically manage focus tree tab indexes by BenHenning · Pull Request #9079 · RaspberryPiFoundation/blockly

@BenHenning

This is still a work-in-progress change, and it may be adapted to
include managing node tab indexes.

This was referenced

May 20, 2025

@BenHenning

@BenHenning

This removes Flyout's ability to be tab-focused and insteads relies on
treating it as a workspace, removing the extra tab stop.

This fixes an issue with FocusManager getting semi-permanently out of
sync with the DOM.

This reintroduces automatic tab management for nodes, and fixes an issue
with auto tab management for trees that would break tabbing order.

@BenHenning

@BenHenning

@BenHenning

Also fix a potential edge case with the auto tab index management
overwriting an existing tab index (since it can sometimes be necessary
as indicated by the doc update for IFocusableNode).

BenHenning

@BenHenning

BenHenning

@BenHenning

maribethb

@BenHenning

@BenHenning

Main documentation and code clarity improvements.

BenHenning

maribethb

BenHenning added a commit to RaspberryPiFoundation/blockly-keyboard-experimentation that referenced this pull request

May 29, 2025
Fixes part of RaspberryPiFoundation/blockly#8915
Fixes part of RaspberryPiFoundation/blockly#9020

This PR does a few things:
- It introduces some new helpers to simplify arrow key inputs across all of the webdriver tests.
- It introduces a new focusable div element that exists in the tab order before toolbox (so that back navigation can be tested).
- It renames a few functions for clarity: `setCurrentCursorNodeById` -> `focusOnBlock` and `setCurrentCursorNodeByIdAndFieldName` -> `focusOnBlockField`. This is closer to what the functions are actually doing, and it moves away from cursor verbiage (which could become confusing in the future once the cursor is removed).
- It introduces some robustness sanity checks for test utility functions. These should fail if an assumption isn't met rather than return null or undefined--failing fast is really useful in tests to avoid hiding legitimate failures.
- It introduces a whole test suite for toolbox and flyout (though a lot more tests can be added). This specifically emphasizes regressions fixed by RaspberryPiFoundation/blockly#9079.