Repository navigation
Control: Go To and Select over the control channel scroll the active cell into view - #970
Merged
Merged
Conversation
…cell into view (fixes storytold#966)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #966.
The Go To dialog, the Name Box and the arrow keys all set
grid.ensure_visibleafter moving the selection, which is what makes the grid scroll (the same flag #763 extended for the moving end).engine.executeincontrol.rsruns the command and stops there, so over the control channel, and through the MCPselecttool that callsselection.seton it, the selection moves and the view stays where it was. Now the control channel sets the flag afteredit.goTo,edit.goToSpecial,selection.setandselection.movesucceed, both forengine.executeand for a command named as the method. I kept it to the commands that navigate rather than "any command that moves the active cell", so things likesheet.activatekeep the sheet's saved scroll; happy to switch if you'd rather have the broader rule.docs/control-protocol.mdmentions it.Validation:
selection_scroll.rs: two new tests drivecontrol::handlein egui_kittest:edit.goToto Z300 must leave Z300 on screen (and going back to A1 must bring A1 back), andselection.setto BZ150:CA160 must show BZ150. Both fail on main (the active cell moves, the cell is not visible) and pass here; droppingedit.goTofrom the list makes the Go To test fail again.cargo test -p gridcraft-ui-egui --test selection_scroll,cargo clippy -p gridcraft-ui-egui --all-targets -- -D warnings,cargo fmt --all -- --check