Skip to content

feat(ui): H / F keyboard fits for the plot data viewport - #4

Closed
Limdongcheng wants to merge 1 commit into
fix/clickable-affordancefrom
feat/plot-fit-shortcuts
Closed

feat(ui): H / F keyboard fits for the plot data viewport#4
Limdongcheng wants to merge 1 commit into
fix/clickable-affordancefrom
feat/plot-fit-shortcuts

Conversation

@Limdongcheng

Copy link
Copy Markdown
Owner

What this adds

  • H fits the y axis to the data visible in the current x window (the NMR vertical-fit convention — the window-scoped auto range, not full_y).
  • F fits both axes.

Both are single undoable viewport steps sharing the double-click reset path.

The F conflict

Plain F was already bound to ZoomToSelection (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 new FitPlotXY; anywhere else it keeps ZoomToSelection. Neither behavior is silently dropped. H was unbound before.

Command catalog

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.

Docs & tests

The keyboard shortcut reference (EN + zh-CN) documents the new keys; shortcuts.rs tests moved to a sibling shortcuts_tests.rs to stay under the source-size limit. cargo pr-check passes.


Part 3 of the stack, based on fix/clickable-affordance (#3).

`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.
@github-actions

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant