Skip to content

Migrate out of react-hotkeys to @mantine/hooks #2968

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 3, 2024
Merged

Conversation

chownces
Copy link
Contributor

@chownces chownces commented May 2, 2024

Description

Consolidating our usage of 3rd party hooks under the mantine hooks library.

‼️ BREAKING CHANGE

  • The old playground h u l k hotkey sequence has been replaced with alt+shift+h since mantine's useHotkey does not support hotkey sequences

Closes #2935

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code quality improvements

How to test

Checklist

  • I have tested this code
  • I have updated the documentation

@chownces chownces force-pushed the hotkeys-migration branch from 161c3d6 to b70fa5f Compare May 2, 2024 05:14
@coveralls
Copy link

coveralls commented May 2, 2024

Pull Request Test Coverage Report for Build 8934209129

Details

  • 43 of 87 (49.43%) changed or added relevant lines in 5 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.2%) to 33.303%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/commons/sideContent/content/SideContentDataVisualizer.tsx 2 6 33.33%
src/commons/sideContent/content/SideContentSubstVisualizer.tsx 33 73 45.21%
Files with Coverage Reduction New Missed Lines %
src/commons/sideContent/content/SideContentSubstVisualizer.tsx 2 37.78%
Totals Coverage Status
Change from base Build 8934207535: 0.2%
Covered Lines: 5319
Relevant Lines: 14850

💛 - Coveralls

@chownces chownces force-pushed the hotkeys-migration branch from b658b16 to fac3eda Compare May 2, 2024 07:49
@RichDom2185
Copy link
Member

  • Migration of SideContentTabs: CseMachine, SubstViz, DataViz

Note that we plan to shift DataViz to a module: #2809

Copy link
Member

@RichDom2185 RichDom2185 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! Did a quick run through and some comments below:

@chownces chownces marked this pull request as ready for review May 2, 2024 09:01
Copy link
Member

@RichDom2185 RichDom2185 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Comment on lines +197 to +209
const hotkeyBindings: HotkeyItem[] = this.state.visualization
? [
['a', this.stepFirst],
['f', this.stepNext],
['b', this.stepPrevious],
['e', this.stepLast(this.props.stepsTotal)]
]
: [
['a', () => {}],
['f', () => {}],
['b', () => {}],
['e', () => {}]
];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While not related to this PR, it it just be or are the keyboard shortcuts not intuitive? I would expect the following:

(first, prev, next, last) to be mapped to (h, j, k, l) or (a, s, d, f) -- basically just a sequence of keys that are next to each other on the keyboard.

@RichDom2185 RichDom2185 enabled auto-merge (squash) May 2, 2024 10:15
@RichDom2185 RichDom2185 disabled auto-merge May 2, 2024 10:18
@RichDom2185 RichDom2185 enabled auto-merge (squash) May 3, 2024 04:45
@RichDom2185 RichDom2185 merged commit 62f5a83 into master May 3, 2024
8 checks passed
@RichDom2185 RichDom2185 deleted the hotkeys-migration branch May 3, 2024 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate hotkeys library
3 participants