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: fixed shortcuts population #7016

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

sid0-0
Copy link

@sid0-0 sid0-0 commented Sep 13, 2024

This PR fixes #6776

Screenshots:
image

Copy link

github-actions bot commented Sep 13, 2024

Welcome!

Hello there, congrats on your first PR! We're excited to have you contributing to this project.
By submitting your Pull Request, you acknowledge that you agree with the terms of our Contributor License Agreement.

Generated by 🚫 dangerJS against 5327b3d

Copy link

@greptile-apps greptile-apps bot left a 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 addresses issue #6776 by modifying the command menu functionality to filter out deactivated objects, preventing users from accessing them through shortcuts or the command menu.

  • Added 'nameSingular' property to Command type and CommandMenuCommands for object identification
  • Updated PageChangeEffect to use objectMetadataItemsState for filtering active items
  • Modified useCommandMenu hook to include filterCommandMenu function and update setToInitialCommandMenu
  • Adjusted CommandMenu.stories to incorporate changes for handling active/inactive object metadata items
  • Implemented filtering logic to exclude deactivated objects from the command menu and shortcuts

5 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings

setToInitialCommandMenu,
openCreateActivity,
objectMetadataItems,
filterCommandMenu,
Copy link

Choose a reason for hiding this comment

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

style: filterCommandMenu is unused in this component

@FelixMalfait
Copy link
Member

Thanks a lot!
Sorry this could have been discussed upfront but tbh I think we should have done a loop and display all non isSystem +active objects like in settings, instead of filtering out from an hardcoded list. That way we could also get the icon directly from the true source in object metadata.
One thing we would lose is the shortcuts but we can bring them back later.

We have plans to isolate it into a dedicated entry point, not mixed with records:
Screenshot 2024-09-13 at 15 55 31
("Objects" would open the list of objects you can navigate to)
Maybe this would be a good first step towards that.

What do you think?

@sid0-0
Copy link
Author

sid0-0 commented Sep 15, 2024

@FelixMalfait
What exactly do you mean by isolate it into a dedicated entry point, not mixed with records (actually I don't know what records are)?

I have made changes to pick all data directly from object data.

Shortcuts are still functional as all initials are different and we won't run into any issues right now, in future we'll have to add a key for shortcut into object data itself (in case conflicts arise).

Note for reviewers: CommandMenu items' id has change from 'go-to-[labelPlural]' to uuid provided by the object. I can revert to using a generic go-to... string if required, but I didn't see any issues this would raise.

@lucasbordeau
Copy link
Contributor

Please see in GotoHotkeysEffect in order to create something dynamic. Right now it's hard coded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deactivated objects can still be accessed using shortcuts & cmd+k
3 participants