-
Notifications
You must be signed in to change notification settings - Fork 8.6k
DEV: floatkit autocomplete for ai-bot-conversations #34354
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
Conversation
5f9b51a
to
44864e8
Compare
44864e8
to
276807c
Compare
}, | ||
onClose: destroyUserStatuses, | ||
}); | ||
if (!this.siteSettings.floatkit_autocomplete_chat_composer) { |
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.
Decided not to DRY the options passed into this block as it makes for a cleaner git history when we remove the jquery-based autocomplete and also there's a slightly different options
API here treatAsTextarea
for the jquery-based autocomplete vs fixedTextareaPosition
/offset
for floatkit-based autocomplete.
@@ -122,6 +122,7 @@ export default class DAutocompleteModifier extends Modifier { | |||
case "Enter": | |||
case "Tab": | |||
event.preventDefault(); | |||
event.stopImmediatePropagation(); |
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.
Without this, the AI chat interface submits the entire input on autocompletion of the term (must be some other event listener set on that element/keypress). This does not occur in chat/topic composers, only AI chat interface and full page search.
Hmm the video shows the text space expanding before first key. Is that intended? It isn't the case now in prod. |
I accidentally clicked ctrl+enter 😅, can see how that's confusing. Will do a clearer recording tomorrow 😁 |
This PR changes the ai-bot-conversations component to use the floatkit-based autocomplete menu for the AI bot chat interface when autocompleting hashtags (
#
) and mentions (@
).Preferably to be reviewed/merged after #34131 which introduces better positioning & an offset option that aligns with the UI here as well.
Also fixes a bug where autocompleting in the full page search input field results in the search immediately submitting.
autocomplete-ai-2.mov