Gesture auto-complete, similar to emojis/mentions#5919
Conversation
| class LLFloater; | ||
| class LLUICtrl; | ||
|
|
||
| class LLGestureAutocompleteHelper : public LLSingleton<LLGestureAutocompleteHelper> |
There was a problem hiding this comment.
LLFloaterGestureAutocompletePicker is effectively a singleton, since only a single instance can exist.
This is a not a request to change this, just a note, that code might have been simpler if LLFloaterGestureAutocompletePicker was doing all this instead of managing both host and picker manualy.
|
@maxim-productengine I think you are familiar with with autocompletion in chat, please check this over. This likely needs approval from product before merge, I will create a ticket for triage. |
There was a problem hiding this comment.
Pull request overview
Adds a new gesture auto-complete experience in Nearby Chat when typing /, using the same helper/picker pattern as existing emoji and @mention autocompletion.
Changes:
- Introduces
LLGestureAutocompleteHelper(LLUI) plus a newLLFloaterGestureAutocompletePicker(Newview) to display/select matching gesture triggers. - Wires Nearby Chat keystrokes to build suggestion rows from active
LLGestureMgrgestures whenChatAutocompleteGesturesis enabled. - Extends
LLTextEditorkey-forwarding so the gesture picker can be keyboard-navigated like other autocomplete helpers.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| indra/newview/skins/default/xui/en/floater_gesture_autocomplete_picker.xml | Adds XUI definition for the gesture autocomplete picker floater. |
| indra/newview/llviewerfloaterreg.cpp | Registers the new gesture autocomplete picker floater type. |
| indra/newview/llfloaterimnearbychat.cpp | Builds gesture match rows on keystroke and shows/hides the helper based on input. |
| indra/newview/llfloatergestureautocompletepicker.h | Declares the picker floater class and its selection/keyboard handling. |
| indra/newview/llfloatergestureautocompletepicker.cpp | Implements picker population, keyboard navigation, and commit behavior. |
| indra/newview/CMakeLists.txt | Adds the new picker floater source/header to the build. |
| indra/llui/lltexteditor.cpp | Forwards key handling to the new gesture helper (like emoji/mention helpers). |
| indra/llui/llgestureautocompletehelper.h | Declares the singleton helper API and row model for gesture suggestions. |
| indra/llui/llgestureautocompletehelper.cpp | Implements helper show/hide/commit plumbing and picker refresh. |
| indra/llui/CMakeLists.txt | Adds the new helper source/header to the LLUI build. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
maxim-productengine
left a comment
There was a problem hiding this comment.
I was not sure that mGestureList->setDoubleClickCallback is the correct approach, because the first click may cause focus loss for the chat editor and that triggers hideHelper, so the picker is closed before the double-click is actually handled. I built this branch and it is indeed the issue: double-clicking the gesture won't put it into the chat.
Probably you need to update the mHostCtrlFocusLostConn = host_ctrl->setFocusLostCallback lambda: when focus goes into the picker's own floater, restore it to the host control instead of hiding. This way the picker stays open and the double-click commit fires correctly.
On the other hand, you may want to get rid of the double-click callback and handle single click similar to the name-mention helper. Both approaches are fine with me.
And Andrey is right, we'll need product approval before merge.
Includes some minor improvements (locales partially setup, LLCachedControl , require one letter after `/`, and tab select tweak)
a490f43 to
7545724
Compare
|
thanks, that should put it in a better position now the lambda is a bit more than what mentions has, as gestures is using a scroll list which seems to pinch focus when it's clicked... could do it differently but that'll possibly require edits to |
|
Looks good |
|
Thank you for your contribution! |
New gesture picker for nearby chat slash gesture autocomplete. Shown when the user types
/nearby chat, matching active gestures instead of relying only on inline text completion.LLGestureAutocompleteHelperfollowing the existingLLChatMentionHelper/LLEmojiHelperautocomplete patternLLFloaterGestureAutocompletePickerand XUI for displaying matching gesture triggers and names.LLGestureMgrentriesLLTextEditorhelper key-forwarding path used by other autocomplete helpersChatAutocompleteGestureschat preferencePreview only shown in nearby chat, for active
/prefixed triggers, like/wave.Also ignores anything that doesn't match gestures, as you'd expect.