Skip to content

Commit 1d0b67b

Browse files
committed
frontend/chat: remove all messages of thread of folded
1 parent a6bfe45 commit 1d0b67b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/packages/frontend/chat/message.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,8 @@ export default function Message({
617617
}
618618

619619
function contentColumn() {
620+
const mainXS = mode === "standalone" ? 20 : 22;
621+
620622
const { background, color, lighten, message_class } = message_colors(
621623
account_id,
622624
message,
@@ -642,8 +644,6 @@ export default function Message({
642644
...(selected ? { border: "3px solid #66bb6a" } : undefined),
643645
} as const;
644646

645-
const mainXS = mode === "standalone" ? 20 : 22;
646-
647647
return (
648648
<Col key={1} xs={mainXS}>
649649
<div
@@ -935,15 +935,14 @@ export default function Message({
935935
<Button
936936
type="text"
937937
style={{ color: COLORS.GRAY_M }}
938-
icon={<Icon name="to-top-outlined" />}
939938
onClick={() =>
940939
actions?.toggleFoldThread(
941940
new Date(getThreadRootDate({ date, messages })),
942941
index,
943942
)
944943
}
945944
>
946-
Fold…
945+
<Icon name="to-top-outlined" /> Fold…
947946
</Button>
948947
</Tip>
949948
)}
@@ -958,26 +957,27 @@ export default function Message({
958957

959958
const label = numChildren ? (
960959
<>
961-
Show {numChildren} {plural(numChildren, "Reply", "Replies")}
960+
Show {numChildren + 1} {plural(numChildren + 1, "Message", "Messages")}
962961
</>
963962
) : (
964-
"View Replies…"
963+
"View Messages…"
965964
);
966965

967966
return (
968-
<Col xs={24}>
969-
<div style={{ textAlign: "center" }}>
967+
<Col xs={24} style={{}}>
968+
<Tip title={"Click to unfold this thread to show all messages."}>
970969
<Button
971970
onClick={() =>
972971
actions?.toggleFoldThread(message.get("date"), index)
973972
}
974973
type="link"
975-
style={{ color: "darkblue" }}
974+
block
975+
style={{ color: "darkblue", textAlign: "center" }}
976976
icon={<Icon name="to-top-outlined" rotate="180" />}
977977
>
978978
{label}
979979
</Button>
980-
</div>
980+
</Tip>
981981
</Col>
982982
);
983983
}
@@ -1062,7 +1062,7 @@ export default function Message({
10621062

10631063
function renderCols(): JSX.Element[] | JSX.Element {
10641064
// these columns should be filtered in the first place, this here is just an extra check
1065-
if (is_thread && is_folded && is_thread_body) {
1065+
if (is_folded || (is_thread && is_folded && is_thread_body)) {
10661066
return <></>;
10671067
}
10681068

0 commit comments

Comments
 (0)