From 93650c9d7c5e527c09015247d83fe25c7bab74fe Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Thu, 10 Jul 2025 20:49:28 +0200 Subject: [PATCH] Refactor `HideFromUser` to use `init` and enhance `DeepClone` with optional hide state adjustment --- app/MindWork AI Studio/Chat/ContentBlock.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/MindWork AI Studio/Chat/ContentBlock.cs b/app/MindWork AI Studio/Chat/ContentBlock.cs index 841cad69..4f281df4 100644 --- a/app/MindWork AI Studio/Chat/ContentBlock.cs +++ b/app/MindWork AI Studio/Chat/ContentBlock.cs @@ -28,14 +28,14 @@ public class ContentBlock /// /// Should the content block be hidden from the user? /// - public bool HideFromUser { get; set; } + public bool HideFromUser { get; init; } - public ContentBlock DeepClone() => new() + public ContentBlock DeepClone(bool changeHideState = false, bool hideFromUser = true) => new() { Time = this.Time, ContentType = this.ContentType, Content = this.Content?.DeepClone(), Role = this.Role, - HideFromUser = this.HideFromUser, + HideFromUser = changeHideState ? hideFromUser : this.HideFromUser, }; } \ No newline at end of file