Commit graph

2 commits

Author SHA1 Message Date
Danny Avila
6bbbee7a78
📏 fix: Scope Skill Command Query to Text Before the Caret (#14604) 2026-08-03 07:53:30 -04:00
Danny Avila
49f228de78
🔼 refactor: Improve UX for Command Popovers (#12677)
* refactor: Improve UX for Command Popovers

* Added loading state handling in Mention and PromptsCommand components to display a spinner when data is being fetched.
* Refactored onFocus logic to clear the textarea and set the search value based on command character input.
* Introduced a new `isLoading` state in the useMentions hook to manage loading indicators across multiple data queries.
* Added unit tests for the useHandleKeyUp hook to ensure command triggering works correctly under various conditions.

* ci: useHandleKeyUp tests for command navigation

* Added tests to ensure that the command popovers do not trigger when the cursor is mid-text after pressing ArrowLeft or Delete.
* Updated the shouldTriggerCommand function to refine the conditions under which commands are triggered based on cursor position.
* Improved agent query handling in useMentions hook for better performance and clarity.

* refactor: Optimize Mention and PromptsCommand Components

* Refactored Mention and PromptsCommand components to utilize Recoil state for popover visibility, improving state management and reducing prop drilling.
* Simplified onFocus logic to enhance user experience when interacting with command inputs.
* Added unit tests for useHandleKeyUp to ensure proper command handling and popover visibility based on user input.
* Improved performance by memoizing popover state and reducing unnecessary re-renders.

* fix: Address review findings for command popover refactor

- Fix endpointType regression: add effectiveEndpointByIndex selector
  that returns endpointType ?? endpoint, matching the original ChatForm
  guard for custom endpoints proxying assistants
- Extract duplicated initInputRef callback into shared useInitPopoverInput
  hook, used by both Mention and PromptsCommand
- Add navigation keys (ArrowLeft, ArrowRight, ArrowDown, Home, End,
  Delete) to invalidKeys to prevent false popover triggers
- Add endpoint gating tests for assistants/azureAssistants blocking the
  + command
- Remove unused _index param from MentionContent
2026-04-15 17:47:24 -04:00