Skip to content
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

fix: make shortcut change work for shortcuts with two words, added sidebar shortcut, fix categories order #4831

Merged
merged 18 commits into from
Nov 27, 2024

Conversation

lucaseduoli
Copy link
Collaborator

@lucaseduoli lucaseduoli commented Nov 25, 2024

This pull request introduces several changes to the shortcut management and sidebar functionality in the frontend application. The most important changes include the addition of a new keyboard shortcut for toggling the sidebar, modifications to the shortcut storage structure, and updates to the utility functions for handling shortcuts.

Shortcut Management Updates:

  • Added new toggleSidebar keyboard shortcut to the default shortcuts list and the useShortcutsStore state. (src/frontend/src/constants/constants.ts, src/frontend/src/stores/shortcuts.ts) [1] [2]
  • Updated the useShortcutsStore to use consistent naming for the freezePath shortcut. (src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/hooks/use-shortcuts.tsx, src/frontend/src/stores/shortcuts.ts) [1] [2]
  • Modified the handleRestore function in ShortcutsPage to use shortcut_mod instead of shortcut for updating unique shortcuts. (src/frontend/src/pages/SettingsPage/pages/ShortcutsPage/index.tsx)

Sidebar Functionality Enhancements:

  • Integrated useHotkeys and useShortcutsStore to handle the new toggleSidebar shortcut, replacing the previous hardcoded keyboard shortcut. (src/frontend/src/components/ui/sidebar.tsx) [1] [2]
  • Removed the old SIDEBAR_KEYBOARD_SHORTCUT constant and its associated event listener for toggling the sidebar. (src/frontend/src/components/ui/sidebar.tsx) [1] [2]

Utility and Miscellaneous Changes:

  • Added toNormalCase utility function and updated relevant imports and usage to ensure consistent shortcut naming. (src/frontend/src/pages/SettingsPage/pages/ShortcutsPage/EditShortcutButton/index.tsx, src/frontend/src/pages/SettingsPage/pages/ShortcutsPage/index.tsx) [1] [2]
  • Fixed sorting logic in FlowSidebarComponent to correctly sort categories. (src/frontend/src/pages/FlowPage/components/flowSidebarComponent/index.tsx)

@lucaseduoli lucaseduoli self-assigned this Nov 25, 2024
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. javascript Pull requests that update Javascript code labels Nov 25, 2024
@github-actions github-actions bot added the bug Something isn't working label Nov 25, 2024
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Nov 25, 2024
@lucaseduoli lucaseduoli changed the title fix: make shortcut change work for shortcuts with two words, added sidebar shortcut fix: make shortcut change work for shortcuts with two words, added sidebar shortcut, fix categories order Nov 25, 2024
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Nov 25, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 25, 2024
Copy link
Contributor

@anovazzi1 anovazzi1 left a comment

Choose a reason for hiding this comment

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

tested on linux machine and the shortcuts that use ctrl+shift+something are not working

@dosubot dosubot bot removed the lgtm This PR has been approved by a maintainer label Nov 25, 2024
Copy link
Contributor

@anovazzi1 anovazzi1 left a comment

Choose a reason for hiding this comment

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

lgtm

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Nov 26, 2024
@ogabrielluiz ogabrielluiz enabled auto-merge (squash) November 26, 2024 22:09
@ogabrielluiz ogabrielluiz merged commit 2f629c6 into main Nov 27, 2024
19 checks passed
@ogabrielluiz ogabrielluiz deleted the fix/sidebar_shortcut branch November 27, 2024 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working javascript Pull requests that update Javascript code lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants