add inline replies, ui improvements, rename ViewPersistence->ViewController, add scroll method and highlight

This commit is contained in:
marlon-erler
2026-04-14 13:15:38 +00:00
parent 634e898317
commit f4a3450b14
19 changed files with 508 additions and 122 deletions
@@ -17,6 +17,7 @@ export default class ChatMessageViewModel {
sender: string;
dateSent: string;
body: React.State<string> = new React.State("");
inlineReply: ChatMessageViewModel | undefined = undefined;
status: React.State<ChatMessageStatuses | any> = new React.State<any>(
undefined,
);
@@ -80,6 +81,15 @@ export default class ChatMessageViewModel {
this.messagePageViewModel.decryptMessage(this);
};
reply = (): void => {
this.messagePageViewModel.replyingMessage.value = this;
this.hideInfoModal();
};
cancelReply = (): void => {
if (this.messagePageViewModel.replyingMessage.value != this) return;
this.messagePageViewModel.replyingMessage.value = undefined;
};
// view
showInfoModal = (): void => {
this.isPresentingInfoModal.value = true;
@@ -119,6 +129,10 @@ export default class ChatMessageViewModel {
this.dateSent = new Date(this.chatMessage.dateSent).toLocaleString();
this.body.value = this.chatMessage.body;
this.status.value = this.chatMessage.status;
if (this.chatMessage.inlineReplyId) {
this.inlineReply = this.messagePageViewModel.chatMessageViewModels.value.get(this.chatMessage.inlineReplyId);
}
};
// init