feat(ui): H / F keyboard fits for the plot data viewport - #4
Closed
Limdongcheng wants to merge 1 commit into
Closed
Conversation
`H` fits the y axis to the data visible in the current x window (the NMR vertical-fit convention — reset_y's window-scoped auto range, not full_y) and `F` fits both axes, both as single undoable viewport steps sharing the double-click reset path. Plain `F` was already bound to ZoomToSelection (board-level frame fit), so the chord is now context-split by a focused handler instead of the dispatch table: with the pointer on a plot's data area it runs the new FitPlotXY, anywhere else it keeps ZoomToSelection. Both fits are registered as CommandId (FitPlotY / FitPlotXY), gated in describe on an active plot, searchable in the palette, and listed in the View menu; invoked without a pointer target they fall back to the active plot. `H` was unbound before. The keyboard shortcut reference (English and Simplified Chinese) now documents the new keys; shortcuts.rs tests moved to a sibling shortcuts_tests.rs to stay under the source-size limit.
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
This was referenced Aug 28, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What this adds
full_y).Both are single undoable viewport steps sharing the double-click reset path.
The
FconflictPlain
Fwas already bound toZoomToSelection(board-level frame fit). The chord is now context-split by a focused handler instead of the dispatch table: with the pointer on a plot's data area it runs the newFitPlotXY; anywhere else it keepsZoomToSelection. Neither behavior is silently dropped.Hwas unbound before.Command catalog
Both fits are registered as
CommandId(FitPlotY/FitPlotXY), gated indescribeon an active plot, searchable in the palette, and listed in the View menu. Invoked without a pointer target they fall back to the active plot.Docs & tests
The keyboard shortcut reference (EN + zh-CN) documents the new keys;
shortcuts.rstests moved to a siblingshortcuts_tests.rsto stay under the source-size limit.cargo pr-checkpasses.Part 3 of the stack, based on
fix/clickable-affordance(#3).