From 0733ff7e67e0df098b4e7dbc64e43e0f0b299026 Mon Sep 17 00:00:00 2001 From: Keegan George Date: Wed, 6 Sep 2023 12:20:08 -0700 Subject: [PATCH] UX: Show suggestion buttons only if sufficient content is present (#204) --- .../components/ai-suggestion-dropdown.gjs | 123 ++++++++++-------- .../ai_helper/ai_composer_helper_spec.rb | 11 ++ .../components/ai_suggestion_dropdown.rb | 17 ++- 3 files changed, 92 insertions(+), 59 deletions(-) diff --git a/assets/javascripts/discourse/components/ai-suggestion-dropdown.gjs b/assets/javascripts/discourse/components/ai-suggestion-dropdown.gjs index edca3919..7b24a791 100644 --- a/assets/javascripts/discourse/components/ai-suggestion-dropdown.gjs +++ b/assets/javascripts/discourse/components/ai-suggestion-dropdown.gjs @@ -1,5 +1,4 @@ import Component from '@glimmer/component'; -import DButton from "discourse/components/d-button"; import { tracked } from "@glimmer/tracking"; import { action } from "@ember/object"; import { ajax } from "discourse/lib/ajax"; @@ -8,17 +7,21 @@ import didInsert from "@ember/render-modifiers/modifiers/did-insert"; import { bind } from "discourse-common/utils/decorators"; import { inject as service } from "@ember/service"; import I18n from "I18n"; +import DButton from "discourse/components/d-button"; export default class AISuggestionDropdown extends Component {