From 09e1f8715f8ef296ef8262a2b73bf16aa196eab1 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sat, 13 Jul 2024 10:04:52 +0200 Subject: [PATCH] Shorten the chat titles, when necessary --- app/MindWork AI Studio/Components/Blocks/TreeItemData.cs | 2 ++ app/MindWork AI Studio/Components/Blocks/Workspaces.razor | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/MindWork AI Studio/Components/Blocks/TreeItemData.cs b/app/MindWork AI Studio/Components/Blocks/TreeItemData.cs index f0f1f617..aa96877a 100644 --- a/app/MindWork AI Studio/Components/Blocks/TreeItemData.cs +++ b/app/MindWork AI Studio/Components/Blocks/TreeItemData.cs @@ -7,6 +7,8 @@ public class TreeItemData : ITreeItem public int Depth { get; init; } public string Text { get; init; } = string.Empty; + + public string ShortenedText => Text.Length > 30 ? this.Text[..30] + "..." : this.Text; public string Icon { get; init; } = string.Empty; diff --git a/app/MindWork AI Studio/Components/Blocks/Workspaces.razor b/app/MindWork AI Studio/Components/Blocks/Workspaces.razor index c14b910c..e45fea7a 100644 --- a/app/MindWork AI Studio/Components/Blocks/Workspaces.razor +++ b/app/MindWork AI Studio/Components/Blocks/Workspaces.razor @@ -21,7 +21,7 @@ } else { - @treeItem.Text + @treeItem.ShortenedText }