From d236d9d45b90a9bae0f4d96a09c31a32aff486f8 Mon Sep 17 00:00:00 2001 From: marlon-erler Date: Wed, 23 Sep 2026 14:50:51 +0200 Subject: [PATCH] implement showing only replies --- src/View/ChatPages/messagePage.tsx | 4 +++- src/View/Components/replyViewHeader.tsx | 24 ++++++++++++++++++++++++ src/View/translations.ts | 3 +++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 src/View/Components/replyViewHeader.tsx diff --git a/src/View/ChatPages/messagePage.tsx b/src/View/ChatPages/messagePage.tsx index 24259c0d..e75c39ce 100644 --- a/src/View/ChatPages/messagePage.tsx +++ b/src/View/ChatPages/messagePage.tsx @@ -7,6 +7,7 @@ import * as React from "../../react"; import MessagePageViewModel from "../../ViewModel/Pages/messagePageViewModel"; import CoreViewModel from "../../ViewModel/Global/coreViewModel"; import ChatMessageViewModel from "../../ViewModel/Chat/chatMessageViewModel"; +import {ReplyViewHeader} from "../Components/replyViewHeader"; export function MessagePage( coreViewModel: CoreViewModel, @@ -98,7 +99,8 @@ export function MessagePage( -
+
+ {ReplyViewHeader(coreViewModel, messagePageViewModel)} {messageContainer}
diff --git a/src/View/Components/replyViewHeader.tsx b/src/View/Components/replyViewHeader.tsx new file mode 100644 index 00000000..9a6498cf --- /dev/null +++ b/src/View/Components/replyViewHeader.tsx @@ -0,0 +1,24 @@ +import * as React from "../../react"; +import CoreViewModel from "../../ViewModel/Global/coreViewModel"; +import MessagePageViewModel from "../../ViewModel/Pages/messagePageViewModel"; + +export function ReplyViewHeader(coreViewModel: CoreViewModel, messagePageViewModel: MessagePageViewModel) { + const isHidden = React.createProxyState([messagePageViewModel.replyViewSelectedMessage], ()=>messagePageViewModel.replyViewSelectedMessage.value == undefined); + + const label = React.createProxyState([messagePageViewModel.replyViewSelectedMessage], ()=>coreViewModel.translations.chatPage.message.replyHeaderLabel(messagePageViewModel.replyViewSelectedMessage.value.sender)); + + return ( +
+ + +
+ ); +} diff --git a/src/View/translations.ts b/src/View/translations.ts index 8f94eaaa..eafe0442 100644 --- a/src/View/translations.ts +++ b/src/View/translations.ts @@ -252,6 +252,7 @@ const englishTranslations = { // replyPrefixLabel: "Replies: ", + replyHeaderLabel: (sender: string) => `Replies to ${sender}`, }, task: { @@ -575,6 +576,7 @@ export const allTranslations: { questionReaction: "Reaktion: Fragezeichen", replyPrefixLabel: "Antworten: ", + replyHeaderLabel: (sender: string) => `Antworten an ${sender}`, }, task: { @@ -879,6 +881,7 @@ export const allTranslations: { questionReaction: "Reaccion: signo de interrogación", replyPrefixLabel: "Respuestas: ", + replyHeaderLabel: (sender: string) => `Respuestas a ${sender}`, }, task: {