A platform for community discussion. Free, open, simple.
UX: user threads styling tweaks
chapoi7da33ad6ba2e
diff --git a/plugins/chat/assets/javascripts/discourse/components/channels-list.gjs b/plugins/chat/assets/javascripts/discourse/components/channels-list.gjsindex ae12313e11c..b8db884bc28 100644--- a/plugins/chat/assets/javascripts/discourse/components/channels-list.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/channels-list.gjs@@ -166,23 +166,18 @@ export default class ChannelsList extends Component {{{didInsert this.computeHasScrollbar}}{{onResize this.computeResizedEntries}}>- <div class="channels-list-container user-threads-section">- <LinkTo @route="chat.threads" class="chat__user-threads-row-container">- <div class="chat__user-threads-row">- <span class="chat__user-threads-row__title">- {{dIcon "discourse-threads" class="chat__user-threads-row__icon"}}- {{i18n "chat.my_threads.title"}}- </span>-- {{#if this.hasUnreadThreads}}- <div class="chat__unread-indicator">- <div class="chat__unread-indicator__number"> </div>- </div>- {{/if}}+ <LinkTo @route="chat.threads" class="chat-channel-row --threads">+ <span class="chat-channel-title">+ {{dIcon "discourse-threads" class="chat-user-threads__icon"}}+ {{i18n "chat.my_threads.title"}}+ </span>+ {{#if this.hasUnreadThreads}}+ <div class="c-unread-indicator">+ <div class="c-unread-indicator__number"> </div></div>- </LinkTo>- </div>+ {{/if}}+ </LinkTo>{{#if this.displayPublicChannels}}<div class="chat-channel-divider public-channels-section">diff --git a/plugins/chat/assets/javascripts/discourse/components/user-threads/index.gjs b/plugins/chat/assets/javascripts/discourse/components/user-threads/index.gjsindex b69acdd2a34..b3061b6314f 100644--- a/plugins/chat/assets/javascripts/discourse/components/user-threads/index.gjs+++ b/plugins/chat/assets/javascripts/discourse/components/user-threads/index.gjs@@ -71,39 +71,29 @@ export default class UserThreads extends Component {}<template>- <div class="chat__user-threads-container">- <div class="chat__user-threads" {{this.fill}}>- {{#each this.threadsCollection.items as |thread|}}- <div- class="chat__user-threads__thread-container"- data-id={{thread.id}}- >- <div class="chat__user-threads__thread">- <div class="chat__user-threads__title">- <ThreadTitle @thread={{thread}} />- <ChannelTitle @channel={{thread.channel}} />- </div>+ <div class="c-user-threads" {{this.fill}}>+ {{#each this.threadsCollection.items as |thread|}}+ <div class="c-user-thread" data-id={{thread.id}}>+ <ThreadTitle @thread={{thread}} />+ <ChannelTitle @channel={{thread.channel}} />- <div class="chat__user-threads__thread-indicator">- <ThreadIndicator- @message={{thread.originalMessage}}- @interactiveUser={{false}}- @interactiveThread={{false}}- tabindex="-1"- />- </div>- </div>- </div>- {{/each}}-- <div {{this.loadMore}}>- <br />+ <ThreadIndicator+ @message={{thread.originalMessage}}+ @interactiveUser={{false}}+ @interactiveThread={{false}}+ tabindex="-1"+ /></div>+ {{/each}}- <ConditionalLoadingSpinner- @condition={{this.threadsCollection.loading}}- />+ <div {{this.loadMore}}>+ <br /></div>++ <ConditionalLoadingSpinner+ @condition={{this.threadsCollection.loading}}+ />+</div></template>}diff --git a/plugins/chat/assets/stylesheets/common/chat-unread-indicator.scss b/plugins/chat/assets/stylesheets/common/chat-unread-indicator.scssindex 9d57b336193..a59e62a0c6b 100644--- a/plugins/chat/assets/stylesheets/common/chat-unread-indicator.scss+++ b/plugins/chat/assets/stylesheets/common/chat-unread-indicator.scss@@ -22,6 +22,6 @@}}-.chat__unread-indicator {+.c-unread-indicator {@include chat-unread-indicator;}diff --git a/plugins/chat/assets/stylesheets/common/chat-user-threads-row.scss b/plugins/chat/assets/stylesheets/common/chat-user-threads-row.scssdeleted file mode 100644index c0e17c87ceb..00000000000--- a/plugins/chat/assets/stylesheets/common/chat-user-threads-row.scss+++ /dev/null@@ -1,32 +0,0 @@-.chat__user-threads-row {- display: flex;- align-items: center;- display: flex;- align-items: center;- justify-content: space-between;- width: 100%;-- .chat__unread-indicator {- width: 8px;- height: 8px;- }-- &-container {- height: 3.6em;- padding: 0 0.5rem;- margin: 0.5rem 0rem 0 0.5rem;- box-sizing: border-box;- display: flex;-- &:hover {- background: var(--primary-low);- }-- .chat__user-threads-row__icon {- color: var(--primary);- }- .chat__user-threads-row__title {- color: var(--primary);- }- }-}diff --git a/plugins/chat/assets/stylesheets/common/chat-user-threads.scss b/plugins/chat/assets/stylesheets/common/chat-user-threads.scssindex f38c1118a09..884ae900d09 100644--- a/plugins/chat/assets/stylesheets/common/chat-user-threads.scss+++ b/plugins/chat/assets/stylesheets/common/chat-user-threads.scss@@ -1,23 +1,45 @@-.chat__user-threads__thread-indicator {- padding-top: 1rem;+.c-user-thread {+ padding-block: 1.25rem;+ margin-inline: 1rem;+ border-bottom: 1px solid var(--primary-low);++ .c-unread-indicator {+ width: 8px;+ height: 8px;+ align-self: flex-start;+ }.chat-message-thread-indicator {- margin: 0;+ margin-left: 0;+ margin-top: 1rem;+ &:hover {+ box-shadow: none;+ }+ }++ .chat__thread-title__name {+ font-size: var(--font-up-1-rem);++ &:hover {+ color: var(--primary-very-high);+ }}-}-.chat__user-threads__title {.chat-channel-title__name {+ color: var(--primary-high);font-size: var(--font-down-1);- color: var(--primary-medium);}}-.chat__user-threads__thread {- padding-bottom: 1rem;- border-bottom: 1px solid var(--primary-low);-- &-container {- padding: 1rem 1rem 0 1rem;+//sidebar+#sidebar-section-content-user-threads {+ padding-bottom: 0.5rem;+ .sidebar-section-link-wrapper:hover {+ .sidebar-section-link-prefix {+ color: var(--primary-very-high);+ }+ }+ .sidebar-section-link-content-text {+ color: var(--d-sidebar-header-color);}}diff --git a/plugins/chat/assets/stylesheets/common/index.scss b/plugins/chat/assets/stylesheets/common/index.scssindex 337cd189f72..96e12565c7a 100644--- a/plugins/chat/assets/stylesheets/common/index.scss+++ b/plugins/chat/assets/stylesheets/common/index.scss@@ -67,5 +67,4 @@@import "chat-channel-settings";@import "chat-user-threads";@import "chat-navbar";-@import "chat-user-threads-row";@import "chat-thread-title";diff --git a/plugins/chat/assets/stylesheets/desktop/chat-index-drawer.scss b/plugins/chat/assets/stylesheets/desktop/chat-index-drawer.scssindex 809821f2e31..3b53646814f 100644--- a/plugins/chat/assets/stylesheets/desktop/chat-index-drawer.scss+++ b/plugins/chat/assets/stylesheets/desktop/chat-index-drawer.scss@@ -24,6 +24,18 @@margin-top: 0.25rem;}}++ &.--threads {+ margin-top: 0.25rem;+ .c-unread-indicator {+ width: 8px;+ height: 8px;+ }+ .chat-channel-title {+ gap: 0.5rem;+ color: var(--primary);+ }+ }}.toggle-channel-membership-button.-leave {diff --git a/plugins/chat/assets/stylesheets/mobile/chat-index.scss b/plugins/chat/assets/stylesheets/mobile/chat-index.scssindex 7bdc6681389..75e36509636 100644--- a/plugins/chat/assets/stylesheets/mobile/chat-index.scss+++ b/plugins/chat/assets/stylesheets/mobile/chat-index.scss@@ -24,6 +24,24 @@}}+ .chat-channel-row {+ &.--threads {+ color: var(--primary);+ padding-inline: 1.5rem;+ font-size: var(--font-up-1-rem);+ border: 0;++ .chat-channel-title {+ gap: 0.5rem;+ }++ .c-unread-indicator {+ width: 8px;+ height: 8px;+ }+ }+ }+.chat-user-avatar {+ .chat-channel-title__usernames {margin-left: 1rem;diff --git a/plugins/chat/assets/stylesheets/mobile/chat-user-threads.scss b/plugins/chat/assets/stylesheets/mobile/chat-user-threads.scssnew file mode 100644index 00000000000..c0f25ba704c--- /dev/null+++ b/plugins/chat/assets/stylesheets/mobile/chat-user-threads.scss@@ -0,0 +1,5 @@+.chat-user-threads {+ .chat__thread-title {+ justify-content: space-between;+ }+}diff --git a/plugins/chat/assets/stylesheets/mobile/index.scss b/plugins/chat/assets/stylesheets/mobile/index.scssindex edf7b33a568..2b704dc518d 100644--- a/plugins/chat/assets/stylesheets/mobile/index.scss+++ b/plugins/chat/assets/stylesheets/mobile/index.scss@@ -18,3 +18,4 @@@import "chat-form";@import "chat-modal-new-message";@import "chat-thread-list-header";+@import "chat-user-threads";diff --git a/plugins/chat/spec/system/page_objects/chat/user_threads.rb b/plugins/chat/spec/system/page_objects/chat/user_threads.rbindex c98dbc7e325..1d2841caf7d 100644--- a/plugins/chat/spec/system/page_objects/chat/user_threads.rb+++ b/plugins/chat/spec/system/page_objects/chat/user_threads.rb@@ -5,13 +5,11 @@ module PageObjectsclass UserThreads < PageObjects::Pages::Basedef has_threads?(count: nil)has_no_css?(".spinner")- has_css?(".chat__user-threads__thread-container", count: count)+ has_css?(".c-user-thread", count: count)enddef open_thread(thread)- find(- ".chat__user-threads__thread-container[data-id='#{thread.id}'] .chat__thread-title__name",- ).click+ find(".c-user-thread[data-id='#{thread.id}'] .chat__thread-title__name").clickendendenddiff --git a/plugins/chat/spec/system/page_objects/chat_drawer/chat_drawer.rb b/plugins/chat/spec/system/page_objects/chat_drawer/chat_drawer.rbindex a3dca65eb2b..8c40b9d82a9 100644--- a/plugins/chat/spec/system/page_objects/chat_drawer/chat_drawer.rb+++ b/plugins/chat/spec/system/page_objects/chat_drawer/chat_drawer.rb@@ -38,19 +38,19 @@ module PageObjectsenddef has_user_threads_section?- has_css?(".chat__user-threads-row-container[href='/chat/threads']")+ has_css?(".chat-channel-row.--threads[href='/chat/threads']")enddef has_unread_user_threads?- has_css?(".chat__user-threads-row .chat__unread-indicator")+ has_css?(".chat-channel-row.--threads .c-unread-indicator")enddef has_no_unread_user_threads?- has_no_css?(".chat__user-threads-row .chat__unread-indicator")+ has_no_css?(".chat-channel-row.--threads .c-unread-indicator")enddef click_user_threads- find(".chat__user-threads-row").click+ find(".chat-channel-row.--threads").clickenddef maximize