Skip to content

Commit

Permalink
Update Thread Panel to match latest designs (#12797)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
t3chguy authored Jul 23, 2024
1 parent 5308c91 commit 25fcd6a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 22 deletions.
2 changes: 1 addition & 1 deletion res/css/_common.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ legend {
@define-mixin ThreadSummaryIcon {
content: "";
display: inline-block;
mask-image: url("$(res)/img/element-icons/thread-summary.svg");
mask-image: url("@vector-im/compound-design-tokens/icons/threads.svg");
mask-position: center;
mask-repeat: no-repeat;
mask-size: contain;
Expand Down
9 changes: 5 additions & 4 deletions res/css/views/right_panel/_ThreadPanel.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ limitations under the License.
height: 100px;
overflow: visible;

/* Unset flex on the thread list, but not the thread view */
&:not(.mx_ThreadView) .mx_BaseCard_header .mx_BaseCard_header_title {
flex: unset;
}

.mx_BaseCard_header {
.mx_BaseCard_header_title {
.mx_BaseCard_header_title_heading {
margin-right: auto;
}

.mx_AccessibleButton {
font-size: 12px;
color: $secondary-content;
Expand Down
4 changes: 2 additions & 2 deletions res/css/views/rooms/_EventTile.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ $left-gutter: 64px;
$notification-dot-size: 8px; /* notification dot next to the timestamp */

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

display: flex;
Expand All @@ -1039,7 +1039,7 @@ $left-gutter: 64px;

&::after {
$inset-block-start: auto;
$inset-inline-end: calc(32px - $padding);
$inset-inline-end: calc(-1 * var(--cpd-space-2x));
$inset-block-end: calc(-1 * var(--topOffset) - $hrHeight); /* exclude the height of horizontal line */
$inset-inline-start: calc(var(--leftOffset) + $padding);
inset: $inset-block-start $inset-inline-end $inset-block-end $inset-inline-start;
Expand Down
1 change: 0 additions & 1 deletion res/img/element-icons/thread-summary.svg

This file was deleted.

4 changes: 0 additions & 4 deletions src/components/structures/ThreadPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import Measured from "../views/elements/Measured";
import PosthogTrackers from "../../PosthogTrackers";
import { ButtonEvent } from "../views/elements/AccessibleButton";
import Spinner from "../views/elements/Spinner";
import Heading from "../views/typography/Heading";
import { clearRoomNotification } from "../../utils/notifications";
import EmptyState from "../views/right_panel/EmptyState";

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

return (
<div className="mx_BaseCard_header_title">
<Heading size="4" className="mx_BaseCard_header_title_heading">
{_t("common|threads")}
</Heading>
<Tooltip label={_t("threads|mark_all_read")}>
<IconButton onClick={onMarkAllThreadsReadClick} aria-label={_t("threads|mark_all_read")} size="24px">
<MarkAllThreadsReadIcon />
Expand Down
10 changes: 0 additions & 10 deletions test/components/structures/__snapshots__/ThreadPanel-test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ exports[`ThreadPanel Header expect that All filter for ThreadPanelHeader properl
<div
class="mx_BaseCard_header_title"
>
<h4
class="mx_Heading_h4 mx_BaseCard_header_title_heading"
>
Threads
</h4>
<button
aria-label="Mark all as read"
class="_icon-button_bh2qc_17"
Expand Down Expand Up @@ -45,11 +40,6 @@ exports[`ThreadPanel Header expect that My filter for ThreadPanelHeader properly
<div
class="mx_BaseCard_header_title"
>
<h4
class="mx_Heading_h4 mx_BaseCard_header_title_heading"
>
Threads
</h4>
<button
aria-label="Mark all as read"
class="_icon-button_bh2qc_17"
Expand Down

0 comments on commit 25fcd6a

Please sign in to comment.