Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move threads header below base card header #28969

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 39 additions & 32 deletions res/css/views/right_panel/_ThreadPanel.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down
11 changes: 5 additions & 6 deletions src/components/structures/ThreadPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ export const ThreadPanelHeader: React.FC<{
);

return (
<div className="mx_BaseCard_header_title">
<div className="mx_ThreadPanelHeader">
<Tooltip label={_t("threads|mark_all_read")}>
<IconButton onClick={onMarkAllThreadsReadClick} size="24px">
<MarkAllThreadsReadIcon />
<IconButton onClick={onMarkAllThreadsReadClick} size="28px">
<MarkAllThreadsReadIcon height={20} width={20} />
</IconButton>
</Tooltip>
<div className="mx_ThreadPanel_vertical_separator" />
Expand Down Expand Up @@ -192,9 +192,7 @@ const ThreadPanel: React.FC<IProps> = ({ roomId, onClose, permalinkCreator }) =>
narrow={narrow}
>
<BaseCard
header={
hasThreads && <ThreadPanelHeader filterOption={filterOption} setFilterOption={setFilterOption} />
}
header={_t("common|threads")}
id="thread-panel"
className="mx_ThreadPanel"
ariaLabelledBy="thread-panel-tab"
Expand All @@ -204,6 +202,7 @@ const ThreadPanel: React.FC<IProps> = ({ roomId, onClose, permalinkCreator }) =>
ref={card}
closeButtonRef={closeButonRef}
>
{hasThreads && <ThreadPanelHeader filterOption={filterOption} setFilterOption={setFilterOption} />}
{card.current && <Measured sensor={card.current} onMeasurement={setNarrow} />}
{timelineSet ? (
<TimelinePanel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@
exports[`ThreadPanel Header expect that All filter for ThreadPanelHeader properly renders Show: All threads 1`] = `
<DocumentFragment>
<div
class="mx_BaseCard_header_title"
class="mx_ThreadPanelHeader"
>
<button
aria-labelledby=":r0:"
class="_icon-button_bh2qc_17"
role="button"
style="--cpd-icon-button-size: 24px;"
style="--cpd-icon-button-size: 28px;"
tabindex="0"
>
<div
class="_indicator-icon_133tf_26"
style="--cpd-icon-button-size: 100%;"
>
<div />
<div
height="20"
width="20"
/>
</div>
</button>
<div
Expand All @@ -38,20 +41,23 @@ exports[`ThreadPanel Header expect that All filter for ThreadPanelHeader properl
exports[`ThreadPanel Header expect that My filter for ThreadPanelHeader properly renders Show: My threads 1`] = `
<DocumentFragment>
<div
class="mx_BaseCard_header_title"
class="mx_ThreadPanelHeader"
>
<button
aria-labelledby=":r6:"
class="_icon-button_bh2qc_17"
role="button"
style="--cpd-icon-button-size: 24px;"
style="--cpd-icon-button-size: 28px;"
tabindex="0"
>
<div
class="_indicator-icon_133tf_26"
style="--cpd-icon-button-size: 100%;"
>
<div />
<div
height="20"
width="20"
/>
</div>
</button>
<div
Expand Down
Loading