A platform for community discussion. Free, open, simple.
UX: Notification panel update (#33795)
Jordan Vidrined9eefd9cf30b
diff --git a/app/assets/stylesheets/common/base/header.scss b/app/assets/stylesheets/common/base/header.scssindex aa5d3b41b97..16f29aa4b29 100644--- a/app/assets/stylesheets/common/base/header.scss+++ b/app/assets/stylesheets/common/base/header.scss@@ -203,11 +203,6 @@position: relative;background-color: var(--secondary);cursor: default;- border-top: 1px solid var(--primary-low);- border-left: 1px solid var(--primary-low);- border-right: 1px solid var(--primary-low);- border-bottom-right-radius: 0;- border-bottom-left-radius: 0;> .d-icon {color: var(--primary-medium);diff --git a/app/assets/stylesheets/common/base/menu-panel.scss b/app/assets/stylesheets/common/base/menu-panel.scssindex 552de96247c..d623f0254ad 100644--- a/app/assets/stylesheets/common/base/menu-panel.scss+++ b/app/assets/stylesheets/common/base/menu-panel.scss@@ -1,5 +1,14 @@@use "lib/viewport";+:root {+ --d-unread-notification-background: light-dark(+ var(--tertiary-25),+ var(--tertiary-200)+ );+ --active-shadow: 0 0 0 0.5rem var(--d-sidebar-active-background);+ --hover-shadow: 0 0 0 0.5rem var(--d-sidebar-highlight-background);+}+.menu-panel.slide-in {position: fixed;right: 0;@@ -32,7 +41,7 @@// positions are relative to the .d-header .panel divtop: 100%; // directly underneath .panel- right: -10px; // 10px to the right of .panel - adjust as needed+ right: 5px;max-height: calc(100dvh - var(--header-offset) - 1em);border-radius: var(--d-border-radius);@@ -45,7 +54,9 @@}.menu-panel {+ --shadow-dropdown: 0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a;--list-item-padding: 0.5em 1rem;+ border: 1px solid var(--primary-low);box-shadow: var(--shadow-dropdown);background-color: var(--secondary);z-index: z("header");@@ -230,12 +241,14 @@.btn {background-color: var(--primary-very-low);- color: var(--primary-high);++ --d-button-default-icon-color: var(--primary-high);&:hover,&:focus-visible {- background: var(--primary-low);- color: var(--primary);+ background-color: var(--primary-low);++ --d-button-default-icon-color--hover: var(--primary);}}}@@ -265,7 +278,6 @@--user-menu-border-width: 1px;right: 0;padding: 0;- border-top-right-radius: 0;width: unset;@include viewport.until(sm) {@@ -279,7 +291,7 @@.menu-tabs-container {display: flex;flex-direction: column;- padding: 0;+ padding: var(--space-half);overflow-y: auto;overscroll-behavior: contain;margin-inline: calc(var(--user-menu-border-width) * -1);@@ -293,7 +305,7 @@display: flex;position: relative;border-radius: 0;- padding: 0.875em 1em 0.875em 0.875em;+ padding: 0.8125em;@include viewport.until(sm) {padding: 1.2em 1.4em;@@ -324,14 +336,23 @@}&.active {- background-color: var(--d-selected);+ .d-icon {+ box-shadow: var(--active-shadow);+ color: var(--d-sidebar-active-color);+ background-color: var(--d-sidebar-active-background);+ border-radius: calc(var(--d-border-radius) * 0.25);+ }}- .discourse-no-touch & {- &:hover {- background-color: var(--d-hover);- border-left: var(--user-menu-border-width) solid var(--primary-low);- padding-left: calc(0.875em - var(--user-menu-border-width));+ &:not(.active):hover,+ &:not(.active):focus-visible {+ background: none;+ padding-left: calc(0.875em - var(--user-menu-border-width));++ .d-icon {+ box-shadow: var(--hover-shadow);+ background-color: var(--d-sidebar-highlight-background);+ border-radius: calc(var(--d-border-radius) * 0.25);}}}@@ -559,21 +580,6 @@margin: 0.5em 0;}- .d-icon,- &:hover .d-icon {- color: var(--primary-medium);- }-- .icon {- color: var(--primary-high);- }-- .btn-primary {- .d-icon {- color: var(--secondary);- }- }-ul {display: flex;flex-flow: column wrap;@@ -587,7 +593,7 @@&.unread,&.pending {- background-color: var(--tertiary-low);+ background-color: var(--d-unread-notification-background);}&:hover {@@ -651,16 +657,25 @@a {display: flex;padding: var(--list-item-padding);++ .item-label {+ font-weight: bold;+ }++ .item-description {+ color: var(--primary);+ overflow: hidden; // clears the text from wrapping below icons+ overflow-wrap: break-word;++ @include line-clamp(2);+ }}a,button {> div {- overflow: hidden; // clears the text from wrapping below icons- overflow-wrap: anywhere;-- // Truncate items with more than 2 lines.- @include line-clamp(2);+ display: flex;+ flex-direction: column;}}@@ -687,8 +702,13 @@}}- .read {+ .read,+ .bookmark {background-color: var(--secondary);++ a .d-icon {+ color: var(--primary-medium);+ }}.none {@@ -740,6 +760,8 @@.item-description {color: var(--primary);++ @include line-clamp(2);}.icon-avatar {@@ -749,7 +771,7 @@flex-shrink: 0;width: 2em;height: 2em;- margin: 0.3em 1em 0 0;+ margin: 0.3em 1em auto 0;.avatar {width: 100%;diff --git a/app/assets/stylesheets/common/components/user-stream-item.scss b/app/assets/stylesheets/common/components/user-stream-item.scssindex c3f7824100d..050653003a0 100644--- a/app/assets/stylesheets/common/components/user-stream-item.scss+++ b/app/assets/stylesheets/common/components/user-stream-item.scss@@ -120,7 +120,7 @@padding-top: 0;li.notification {- padding: 0.25em 0;+ padding: var(--space-3);border-bottom: 1px solid var(--primary-low);a {@@ -129,6 +129,8 @@.d-icon {color: var(--primary-medium);+ padding-top: 0;+ font-size: var(--font-up-2);}.relative-date {@@ -137,17 +139,6 @@float: none;}}-- &:not(.show-avatars) {- li.notification {- padding: var(--space-3);-- .d-icon {- padding-top: 0;- font-size: var(--font-up-2);- }- }- }}.expand-item,diff --git a/spec/system/page_objects/components/user_menu.rb b/spec/system/page_objects/components/user_menu.rbindex 3fe29c73448..a37e7c7a266 100644--- a/spec/system/page_objects/components/user_menu.rb+++ b/spec/system/page_objects/components/user_menu.rb@@ -47,31 +47,31 @@ module PageObjectsdef has_group_mentioned_notification?(topic, user_that_mentioned_group, group_mentioned)expect(find("#quick-access-replies .group-mentioned").text).to eq(- "#{user_that_mentioned_group.username} @#{group_mentioned.name} #{topic.title}",+ "#{user_that_mentioned_group.username} @#{group_mentioned.name}\n#{topic.title}",)enddef has_user_full_name_mentioned_notification?(topic, user_that_mentioned)expect(find("#quick-access-replies .mentioned").text).to eq(- "#{user_that_mentioned.name} #{topic.title}",+ "#{user_that_mentioned.name}\n#{topic.title}",)enddef has_user_full_name_messaged_notification?(post, user)expect(find("#quick-access-all-notifications .private-message").text).to eq(- "#{user.name} #{post.topic.title}",+ "#{user.name}\n#{post.topic.title}",)enddef has_user_full_name_bookmarked_notification?(post, user)expect(find("#quick-access-bookmarks .bookmark").text).to eq(- "#{user.name} #{post.topic.title}",+ "#{user.name}\n#{post.topic.title}",)enddef has_user_username_mentioned_notification?(topic, user_that_mentioned)expect(find("#quick-access-replies .mentioned").text).to eq(- "#{user_that_mentioned.username} #{topic.title}",+ "#{user_that_mentioned.username}\n#{topic.title}",)end