-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add shortcut metadata to data models & CommandMenu #7977
Add shortcut metadata to data models & CommandMenu #7977
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This pull request removes hotkeys for custom object commands in the command menu, addressing the issue of conflicting shortcuts for objects with the same first letter.
- Modified
GotoHotkeysEffectsProvider.tsx
to skip creating hotkeys for custom objects - Updated
useCommandMenu.ts
to setfirstHotKey
andsecondHotKey
as undefined for custom objects - Added a new test case in
useCommandMenu.test.tsx
to verify that custom objects don't receive hotkeys - These changes improve the command menu's object list by preventing shortcut conflicts and streamlining navigation
3 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile
|
||
return ( | ||
<GoToHotkeyItemEffect | ||
key={`go-to-hokey-item-${objectMetadataItem.id}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: 'hokey' is misspelled. Should be 'hotkey'
key={`go-to-hokey-item-${objectMetadataItem.id}`} | |
key={`go-to-hotkey-item-${objectMetadataItem.id}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was wrong before, should I fix it in this scope?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That'd be great thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
result.current.commandMenu.setObjectsInCommandMenu([ | ||
{ | ||
id: 'b88745ce-9021-4316-a018-8884e02d05ca', | ||
nameSingular: 'task', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for creating a test! Could you please pick another name for the custom object? Like Rocket or whatever you want. Because Task is a standard object so it can be misleading
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
/award 150 |
Awarding florianliebig: 150 points 🕹️ Well done! Check out your new contribution on oss.gg/florianliebig |
@FelixMalfait jeah saw that, too... for me as a user, I would say only frequently used items should need a hotkey - not all. So hardcoding that might be most suitable |
I tried to do the backend part quickly to help you :), not fully tested but it should work hopefuly! Do you want to take over and redo the frontend? The goal is to be able to access the .shortcut property directly on the object's metadata |
Thanks, can take over @FelixMalfait - some questions for the UI / UX of it: My idea was to place it here - or is that too tight? Could also create a new section at the settings. Do we want to allow to edit the shortcuts for the non-custom objects, too? Then we would need to add another form anyways as the existing one is disabled for those. |
Oh nice you want to display it in settings, I didn't even think we'd do that. cc @Bonapara what do you think? |
@FelixMalfait Also having a hard time getting the |
@florianliebig I might have forgotten something in the backend then! you can check in the graphql console: https://twenty.com/developers/graphql/metadata ; I'll check this afternoon and let you know Did you update the |
@florianliebig thanks for your PR! It's a great fix. For the front-end, I think placing them in the settings is a great idea, but we should wait a bit before doing that: I would love to introduce a shortcut tab in the settings and need to consider its behavior. So let's fix the backend first, and I'll create an issue for the front-end soon! Thanks a lot for contributing ;) |
Thanks for the support @FelixMalfait - I can finish it up with some tests if you like |
Thanks a lot @florianliebig great work! feel free to raise a PR on adding a test or on any other issue, happy to support you if you're stuck :) |
Resolves #7503