Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 25fcd6a

Browse files
authored
Update Thread Panel to match latest designs (#12797)
* Add reusable empty state for the right panel Signed-off-by: Michael Telatynski <[email protected]> * Update tests Signed-off-by: Michael Telatynski <[email protected]> * Improve coverage Signed-off-by: Michael Telatynski <[email protected]> * Update Thread Panel to match latest Figma Signed-off-by: Michael Telatynski <[email protected]> * Update tests Signed-off-by: Michael Telatynski <[email protected]> * i18n Signed-off-by: Michael Telatynski <[email protected]> * Use --cpd-space var Signed-off-by: Michael Telatynski <[email protected]> --------- Signed-off-by: Michael Telatynski <[email protected]>
1 parent 5308c91 commit 25fcd6a

File tree

6 files changed

+8
-22
lines changed

6 files changed

+8
-22
lines changed

res/css/_common.pcss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ legend {
851851
@define-mixin ThreadSummaryIcon {
852852
content: "";
853853
display: inline-block;
854-
mask-image: url("$(res)/img/element-icons/thread-summary.svg");
854+
mask-image: url("@vector-im/compound-design-tokens/icons/threads.svg");
855855
mask-position: center;
856856
mask-repeat: no-repeat;
857857
mask-size: contain;

res/css/views/right_panel/_ThreadPanel.pcss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ limitations under the License.
1818
height: 100px;
1919
overflow: visible;
2020

21+
/* Unset flex on the thread list, but not the thread view */
22+
&:not(.mx_ThreadView) .mx_BaseCard_header .mx_BaseCard_header_title {
23+
flex: unset;
24+
}
25+
2126
.mx_BaseCard_header {
2227
.mx_BaseCard_header_title {
23-
.mx_BaseCard_header_title_heading {
24-
margin-right: auto;
25-
}
26-
2728
.mx_AccessibleButton {
2829
font-size: 12px;
2930
color: $secondary-content;

res/css/views/rooms/_EventTile.pcss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ $left-gutter: 64px;
10241024
$notification-dot-size: 8px; /* notification dot next to the timestamp */
10251025

10261026
margin: calc(var(--topOffset) + $hrHeight) 0 var(--topOffset); /* include the height of horizontal line */
1027-
padding: $padding $spacing-24 $padding $padding;
1027+
padding: $padding;
10281028
border-radius: $borderRadius;
10291029

10301030
display: flex;
@@ -1039,7 +1039,7 @@ $left-gutter: 64px;
10391039

10401040
&::after {
10411041
$inset-block-start: auto;
1042-
$inset-inline-end: calc(32px - $padding);
1042+
$inset-inline-end: calc(-1 * var(--cpd-space-2x));
10431043
$inset-block-end: calc(-1 * var(--topOffset) - $hrHeight); /* exclude the height of horizontal line */
10441044
$inset-inline-start: calc(var(--leftOffset) + $padding);
10451045
inset: $inset-block-start $inset-inline-end $inset-block-end $inset-inline-start;

res/img/element-icons/thread-summary.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/components/structures/ThreadPanel.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import Measured from "../views/elements/Measured";
3636
import PosthogTrackers from "../../PosthogTrackers";
3737
import { ButtonEvent } from "../views/elements/AccessibleButton";
3838
import Spinner from "../views/elements/Spinner";
39-
import Heading from "../views/typography/Heading";
4039
import { clearRoomNotification } from "../../utils/notifications";
4140
import EmptyState from "../views/right_panel/EmptyState";
4241

@@ -138,9 +137,6 @@ export const ThreadPanelHeader: React.FC<{
138137

139138
return (
140139
<div className="mx_BaseCard_header_title">
141-
<Heading size="4" className="mx_BaseCard_header_title_heading">
142-
{_t("common|threads")}
143-
</Heading>
144140
<Tooltip label={_t("threads|mark_all_read")}>
145141
<IconButton onClick={onMarkAllThreadsReadClick} aria-label={_t("threads|mark_all_read")} size="24px">
146142
<MarkAllThreadsReadIcon />

test/components/structures/__snapshots__/ThreadPanel-test.tsx.snap

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ exports[`ThreadPanel Header expect that All filter for ThreadPanelHeader properl
55
<div
66
class="mx_BaseCard_header_title"
77
>
8-
<h4
9-
class="mx_Heading_h4 mx_BaseCard_header_title_heading"
10-
>
11-
Threads
12-
</h4>
138
<button
149
aria-label="Mark all as read"
1510
class="_icon-button_bh2qc_17"
@@ -45,11 +40,6 @@ exports[`ThreadPanel Header expect that My filter for ThreadPanelHeader properly
4540
<div
4641
class="mx_BaseCard_header_title"
4742
>
48-
<h4
49-
class="mx_Heading_h4 mx_BaseCard_header_title_heading"
50-
>
51-
Threads
52-
</h4>
5343
<button
5444
aria-label="Mark all as read"
5545
class="_icon-button_bh2qc_17"

0 commit comments

Comments
 (0)