From a8b66d0b3a5de4e5ea0576c486dce6923a788e41 Mon Sep 17 00:00:00 2001 From: R Midhun Suresh Date: Mon, 13 Jan 2025 10:40:50 +0530 Subject: [PATCH 1/2] Move threads header below base card header --- res/css/views/right_panel/_ThreadPanel.pcss | 71 +++++++++++---------- src/components/structures/ThreadPanel.tsx | 11 ++-- 2 files changed, 44 insertions(+), 38 deletions(-) diff --git a/res/css/views/right_panel/_ThreadPanel.pcss b/res/css/views/right_panel/_ThreadPanel.pcss index b21eb17f033..2fe1a869087 100644 --- a/res/css/views/right_panel/_ThreadPanel.pcss +++ b/res/css/views/right_panel/_ThreadPanel.pcss @@ -15,41 +15,48 @@ Please see LICENSE files in the repository root for full details. flex: unset; } - .mx_BaseCard_header { - .mx_BaseCard_header_title { - .mx_AccessibleButton { - font-size: 12px; - color: $secondary-content; - } + .mx_ThreadPanelHeader { + height: 60px; + display: flex; + box-sizing: border-box; + padding: 16px; + align-items: center; + border-bottom: 1px solid var(--cpd-color-gray-400); + + .mx_AccessibleButton { + font-size: 12px; + color: $secondary-content; + } - .mx_ThreadPanel_vertical_separator { - height: 16px; - margin-left: var(--cpd-space-3x); - margin-right: var(--cpd-space-1x); - border-left: 1px solid var(--cpd-color-gray-400); + .mx_ThreadPanel_vertical_separator { + height: 28px; + margin-left: var(--cpd-space-3x); + margin-right: var(--cpd-space-2x); + border-left: 1px solid var(--cpd-color-gray-400); + } + + .mx_ThreadPanel_dropdown { + font: var(--cpd-font-body-sm-regular); + padding: 3px $spacing-4 3px $spacing-8; + border-radius: 4px; + line-height: 1.5; + user-select: none; + + &:hover, + &[aria-expanded="true"] { + background: $quinary-content; } - .mx_ThreadPanel_dropdown { - padding: 3px $spacing-4 3px $spacing-8; - border-radius: 4px; - line-height: 1.5; - user-select: none; - - &:hover, - &[aria-expanded="true"] { - background: $quinary-content; - } - - &::before { - content: ""; - width: 18px; - height: 18px; - background: currentColor; - mask-image: url("@vector-im/compound-design-tokens/icons/chevron-down.svg"); - mask-size: 100%; - mask-repeat: no-repeat; - float: right; - } + &::before { + margin-left: 2px; + content: ""; + width: 20px; + height: 20px; + background: currentColor; + mask-image: url("@vector-im/compound-design-tokens/icons/chevron-down.svg"); + mask-size: 100%; + mask-repeat: no-repeat; + float: right; } } } diff --git a/src/components/structures/ThreadPanel.tsx b/src/components/structures/ThreadPanel.tsx index 7aee8554b1d..42fc8ee2825 100644 --- a/src/components/structures/ThreadPanel.tsx +++ b/src/components/structures/ThreadPanel.tsx @@ -129,10 +129,10 @@ export const ThreadPanelHeader: React.FC<{ ); return ( -
+
- - + +
@@ -192,9 +192,7 @@ const ThreadPanel: React.FC = ({ roomId, onClose, permalinkCreator }) => narrow={narrow} > - } + header={_t("common|threads")} id="thread-panel" className="mx_ThreadPanel" ariaLabelledBy="thread-panel-tab" @@ -204,6 +202,7 @@ const ThreadPanel: React.FC = ({ roomId, onClose, permalinkCreator }) => ref={card} closeButtonRef={closeButonRef} > + {hasThreads && } {card.current && } {timelineSet ? ( Date: Mon, 13 Jan 2025 10:55:48 +0530 Subject: [PATCH 2/2] Fix jest tests --- .../__snapshots__/ThreadPanel-test.tsx.snap | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/test/unit-tests/components/structures/__snapshots__/ThreadPanel-test.tsx.snap b/test/unit-tests/components/structures/__snapshots__/ThreadPanel-test.tsx.snap index 0ea46210025..20887eee036 100644 --- a/test/unit-tests/components/structures/__snapshots__/ThreadPanel-test.tsx.snap +++ b/test/unit-tests/components/structures/__snapshots__/ThreadPanel-test.tsx.snap @@ -3,20 +3,23 @@ exports[`ThreadPanel Header expect that All filter for ThreadPanelHeader properly renders Show: All threads 1`] = `