Skip to content

Conversation

@rachel-fenichel
Copy link
Collaborator

The basics

The details

Resolves

Progress on RaspberryPiFoundation/blockly-keyboard-experimentation#409

Proposed Changes

  • Add a loop parameter to getPreviousNode and getNextNode in cursor.
  • Add tests for loopback and non loopback cases.

Reason for Changes

Both navigation and keyboard drags will use this to smoothly roll from the end of the workspace to the beginning and vice versa, matching standard approaches to searching.

Test Coverage

Added tests in cursor_test.ts.

Documentation

Additional Information

I got some unexpected (to me) behaviour in getPreviousNode but they turned out to be unexpected stack nodes. Getting rid of stack nodes is being considered already, and will require updates to these tests.

The fourth commit inlines some logic in functions in line_cursor.ts, but I can revert it if necessary.

@rachel-fenichel rachel-fenichel requested a review from a team as a code owner April 12, 2025 00:13
@rachel-fenichel rachel-fenichel changed the title Loop in next feat: add loopback in cursor navigation, and add tests Apr 12, 2025
@rachel-fenichel rachel-fenichel requested review from gonfunko and removed request for maribethb April 12, 2025 00:13
@rachel-fenichel rachel-fenichel added the PR: feature Adds a feature label Apr 12, 2025
@rachel-fenichel rachel-fenichel merged commit fac7504 into RaspberryPiFoundation:rc/v12.0.0 Apr 14, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: feature Adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants