From d0427919f1a7978267264d78713b49d8d355c9d1 Mon Sep 17 00:00:00 2001 From: chapoi <101828855+chapoi@users.noreply.github.com> Date: Tue, 28 May 2024 15:00:04 +0200 Subject: [PATCH] UX: add illustrations for empty chat list + split into tabs on drawer (#26910) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a placeholder image + CTA in chat, for empty channel and DM lists. On desktop with drawer mode, we split chat into tabs (like mobile). --------- Co-authored-by: Joffrey JAFFEUX Co-authored-by: David Battersby Co-authored-by: Régis Hanol --- .../components/channels-list-direct.gjs | 81 +++++++------ .../components/channels-list-public.gjs | 106 +++++++++--------- .../discourse/components/chat-footer.gjs | 16 ++- .../chat/drawer-routes/channels.gjs | 36 +++++- .../components/empty-channels-list.gjs | 64 +++++++++++ .../javascripts/discourse/controllers/chat.js | 10 ++ .../javascripts/discourse/templates/chat.hbs | 5 +- .../common/chat-channel-preview-card.scss | 2 +- .../stylesheets/common/chat-footer.scss | 77 +++++++++++++ .../assets/stylesheets/common/chat-index.scss | 40 ++++--- .../chat/assets/stylesheets/common/index.scss | 1 + .../desktop/chat-index-drawer.scss | 6 +- .../desktop/chat-index-full-page.scss | 14 +++ .../stylesheets/mobile/chat-footer.scss | 66 ----------- plugins/chat/config/locales/client.en.yml | 7 +- plugins/chat/spec/system/drawer/index_spec.rb | 2 + .../spec/system/list_channels/mobile_spec.rb | 4 +- .../system/list_channels/no_sidebar_spec.rb | 17 ++- .../spec/system/page_objects/chat/chat.rb | 3 +- .../chat/components/channel_index.rb | 2 +- .../page_objects/chat_drawer/chat_drawer.rb | 10 +- plugins/chat/spec/system/user_threads_spec.rb | 7 +- 22 files changed, 363 insertions(+), 213 deletions(-) create mode 100644 plugins/chat/assets/javascripts/discourse/components/empty-channels-list.gjs create mode 100644 plugins/chat/assets/stylesheets/common/chat-footer.scss diff --git a/plugins/chat/assets/javascripts/discourse/components/channels-list-direct.gjs b/plugins/chat/assets/javascripts/discourse/components/channels-list-direct.gjs index d2af7a32fe0..c58745a6288 100644 --- a/plugins/chat/assets/javascripts/discourse/components/channels-list-direct.gjs +++ b/plugins/chat/assets/javascripts/discourse/components/channels-list-direct.gjs @@ -3,11 +3,13 @@ import { fn, hash } from "@ember/helper"; import { on } from "@ember/modifier"; import { action } from "@ember/object"; import { service } from "@ember/service"; +import { and } from "truth-helpers"; import DButton from "discourse/components/d-button"; import PluginOutlet from "discourse/components/plugin-outlet"; import dIcon from "discourse-common/helpers/d-icon"; import i18n from "discourse-common/helpers/i18n"; import ChatModalNewMessage from "discourse/plugins/chat/discourse/components/chat/modal/new-message"; +import EmptyChannelsList from "discourse/plugins/chat/discourse/components/empty-channels-list"; import ChatChannelRow from "./chat-channel-row"; export default class ChannelsListDirect extends Component { @@ -16,11 +18,6 @@ export default class ChannelsListDirect extends Component { @service site; @service modal; - @action - openNewMessageModal() { - this.modal.show(ChatModalNewMessage); - } - get inSidebar() { return this.args.inSidebar ?? false; } @@ -58,6 +55,11 @@ export default class ChannelsListDirect extends Component { this.args.toggleSection(section); } + @action + openNewMessageModal() { + this.modal.show(ChatModalNewMessage); + } +