From 3e46250f3f081cd884a95d0164c7683c6a12f0cd Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 17 Aug 2023 14:43:14 +1000 Subject: [PATCH] UX: Adjust bot warning so it looks better (#141) This moves the bot warning from `composer-after-composer-editor` to `after-d-editor` (with a minor adjustment for outlet args to match new name) --- .../composer-open.hbs | 0 .../composer-open.js | 3 ++- assets/stylesheets/modules/ai-bot/common/bot-replies.scss | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) rename assets/javascripts/discourse/connectors/{composer-after-composer-editor => after-d-editor}/composer-open.hbs (100%) rename assets/javascripts/discourse/connectors/{composer-after-composer-editor => after-d-editor}/composer-open.js (91%) diff --git a/assets/javascripts/discourse/connectors/composer-after-composer-editor/composer-open.hbs b/assets/javascripts/discourse/connectors/after-d-editor/composer-open.hbs similarity index 100% rename from assets/javascripts/discourse/connectors/composer-after-composer-editor/composer-open.hbs rename to assets/javascripts/discourse/connectors/after-d-editor/composer-open.hbs diff --git a/assets/javascripts/discourse/connectors/composer-after-composer-editor/composer-open.js b/assets/javascripts/discourse/connectors/after-d-editor/composer-open.js similarity index 91% rename from assets/javascripts/discourse/connectors/composer-after-composer-editor/composer-open.js rename to assets/javascripts/discourse/connectors/after-d-editor/composer-open.js index b095138d..20a3044f 100644 --- a/assets/javascripts/discourse/connectors/composer-after-composer-editor/composer-open.js +++ b/assets/javascripts/discourse/connectors/after-d-editor/composer-open.js @@ -11,7 +11,7 @@ export default class extends Component { @service siteSettings; get composerModel() { - return this.args.outletArgs.model; + return this.args?.outletArgs?.composer; } get renderChatWarning() { @@ -21,6 +21,7 @@ export default class extends Component { @computed("composerModel.targetRecipients") get isAiBotChat() { if ( + this.composerModel && this.composerModel.targetRecipients && this.currentUser.ai_enabled_chat_bots ) { diff --git a/assets/stylesheets/modules/ai-bot/common/bot-replies.scss b/assets/stylesheets/modules/ai-bot/common/bot-replies.scss index 79e2a79b..926ed647 100644 --- a/assets/stylesheets/modules/ai-bot/common/bot-replies.scss +++ b/assets/stylesheets/modules/ai-bot/common/bot-replies.scss @@ -3,7 +3,7 @@ nav.post-controls .actions button.cancel-streaming { } .ai-bot-chat #reply-control { - .title-input { + .title-and-category { display: none; } } @@ -11,14 +11,14 @@ nav.post-controls .actions button.cancel-streaming { .ai-bot-chat-warning { color: var(--tertiary); background-color: var(--tertiary-low); - box-shadow: 0px 0px 0px 2px var(--tertiary-medium); + border-top: 1px solid var(--tertiary-medium); opacity: 0.75; .d-icon { color: var(--tertiary); } - margin: 10px 2px 0; + margin: 0; padding: 4px 10px; - width: fit-content; + width: calc(100% - 20px); } article.streaming nav.post-controls .actions button.cancel-streaming {