From c7b49a14c722f68fd47d3651ddb81aa168e3987a Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Mon, 10 Apr 2023 07:43:11 +0200 Subject: [PATCH] Chat/drawer ux tweaks (#21032) - clicking empty area on the header will toggle collapse/expand it - applies a background on hover of the channel title - active state for small buttons - the back button now has the correct icon color when hovered - adds missing focus state for heade buttons icons --- .../components/chat-drawer/channel.hbs | 2 +- .../components/chat-drawer/draft-channel.hbs | 2 +- .../components/chat-drawer/header.hbs | 7 +++ .../components/chat-drawer/header.js | 6 +++ .../chat-drawer/header/right-actions.hbs | 6 +-- .../header/toggle-expand-button.hbs | 6 ++- .../components/chat-drawer/index.hbs | 9 +++- .../components/chat-drawer/thread.hbs | 2 +- .../stylesheets/common/chat-drawer.scss | 43 +++++++++++++------ plugins/chat/config/locales/client.en.yml | 1 + plugins/chat/spec/system/drawer_spec.rb | 12 ++++++ 11 files changed, 73 insertions(+), 23 deletions(-) create mode 100644 plugins/chat/assets/javascripts/discourse/components/chat-drawer/header.js diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/channel.hbs b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/channel.hbs index 45a1360f5c1..7a94b39267e 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/channel.hbs +++ b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/channel.hbs @@ -1,4 +1,4 @@ - + + diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header.hbs b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header.hbs index 45a25d6fed4..416b6e5616c 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header.hbs +++ b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header.hbs @@ -1,7 +1,14 @@ +{{! template-lint-disable no-invalid-interactive }}
{{yield}}
\ No newline at end of file diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header.js b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header.js new file mode 100644 index 00000000000..f38df7fe6e0 --- /dev/null +++ b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header.js @@ -0,0 +1,6 @@ +import Component from "@glimmer/component"; +import { inject as service } from "@ember/service"; + +export default class ChatDrawerHeader extends Component { + @service chatStateManager; +} diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/right-actions.hbs b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/right-actions.hbs index 38ad3860de1..c022dcdc028 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/right-actions.hbs +++ b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/right-actions.hbs @@ -1,11 +1,11 @@
- +
\ No newline at end of file diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/toggle-expand-button.hbs b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/toggle-expand-button.hbs index 9514aeb96b7..28d93d22fd0 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/toggle-expand-button.hbs +++ b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/header/toggle-expand-button.hbs @@ -6,5 +6,9 @@ }} @class="btn-flat btn-link chat-drawer-header__expand-btn" @action={{@toggleExpand}} - @title="chat.collapse" + @title={{if + this.chatStateManager.isDrawerExpanded + "chat.collapse" + "chat.expand" + }} /> \ No newline at end of file diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/index.hbs b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/index.hbs index 4f44d5f9453..080e5ab4ea5 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/index.hbs +++ b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/index.hbs @@ -1,5 +1,10 @@ - - + +
+
+ {{i18n "chat.heading"}} +
+
+
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/thread.hbs b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/thread.hbs index a51bd5cfacd..3b2e19a4abd 100644 --- a/plugins/chat/assets/javascripts/discourse/components/chat-drawer/thread.hbs +++ b/plugins/chat/assets/javascripts/discourse/components/chat-drawer/thread.hbs @@ -1,4 +1,4 @@ - +