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 command menu selection #10248

Merged
merged 2 commits into from
Feb 17, 2025
Merged

Fix command menu selection #10248

merged 2 commits into from
Feb 17, 2025

Conversation

bosiraphael
Copy link
Contributor

  • Created a state hasUserSelectedCommandState : This state is set to true when the user selects an element in the command menu list. It is set to false upon redirection or when the command menu is closed.
  • Modified CommandMenuDefaultSelectionEffect to have the expected selection behavior for the command menu

Copy link
Contributor

@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 PR introduces a new Recoil state to track user selections in the command menu, improving the default selection behavior and preventing unwanted selection resets.

  • Added hasUserSelectedCommandState in /packages/twenty-front/src/modules/command-menu/states/hasUserSelectedCommandState.ts to track user selection state
  • Modified CommandMenuDefaultSelectionEffect to only auto-select first item when no manual selection exists
  • Integrated selection state management across command menu operations (open, close, navigate) in useCommandMenu.ts
  • Enhanced SelectableList component with onSelect callback to track keyboard navigation selections
  • Updated selection reset logic to properly handle menu redirections and closures

6 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

@bosiraphael bosiraphael enabled auto-merge (squash) February 17, 2025 10:59
@bosiraphael bosiraphael merged commit 7ed142e into main Feb 17, 2025
50 checks passed
@bosiraphael bosiraphael deleted the r--fix-command-menu-selection branch February 17, 2025 11:02
eliezer-rodrigues037 pushed a commit to mind-developer/kvoip-v2 that referenced this pull request Feb 17, 2025
- Created a state `hasUserSelectedCommandState` : This state is set to
`true` when the user selects an element in the command menu list. It is
set to false upon redirection or when the command menu is closed.
- Modified `CommandMenuDefaultSelectionEffect` to have the expected
selection behavior for the command menu
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.

2 participants