From adde3fee4c850bb4a93c84d20887d772dee1359a Mon Sep 17 00:00:00 2001 From: Gadfly Date: Fri, 31 Jul 2026 10:07:18 +0800 Subject: [PATCH] fix: build folder path from Backend.Path and silence null-revision bindings in revision file tree - RevisionFileTreeView.SetSearchResultAsync: concatenate Backend.Path instead of stringifying the Backend Object, whose default ToString() leaked "SourceGit.Models.Object/" into child node paths and corrupted the DirHistories window title. - RevisionFiles / Blame: add FallbackValue={x:Null} to Commit.SHA / Revision.SHA. These commits are loaded asynchronously and are null when the view first binds, which logged "Value is null" binding errors. --- src/Views/Blame.axaml | 4 ++-- src/Views/RevisionFileTreeView.axaml.cs | 2 +- src/Views/RevisionFiles.axaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Views/Blame.axaml b/src/Views/Blame.axaml index fd28a3a54..f2c807492 100644 --- a/src/Views/Blame.axaml +++ b/src/Views/Blame.axaml @@ -116,10 +116,10 @@ FontWeight="Bold" Margin="0,0,6,0" FontFamily="{DynamicResource Fonts.Monospace}" - Text="{Binding Revision.SHA, Converter={x:Static c:StringConverters.ToShortSHA}, Mode=OneWay}"/> + Text="{Binding Revision.SHA, Converter={x:Static c:StringConverters.ToShortSHA}, Mode=OneWay, FallbackValue={x:Null}}"/> diff --git a/src/Views/RevisionFileTreeView.axaml.cs b/src/Views/RevisionFileTreeView.axaml.cs index bf9586765..953aeff54 100644 --- a/src/Views/RevisionFileTreeView.axaml.cs +++ b/src/Views/RevisionFileTreeView.axaml.cs @@ -312,7 +312,7 @@ public async Task SetSearchResultAsync(string file) last.Add(folder); last = folder.Children; - prefix = folder.Backend + "/"; + prefix = folder.Backend.Path + "/"; } last.Add(new ViewModels.RevisionFileTreeNode diff --git a/src/Views/RevisionFiles.axaml b/src/Views/RevisionFiles.axaml index 8f0407e30..edfd73359 100644 --- a/src/Views/RevisionFiles.axaml +++ b/src/Views/RevisionFiles.axaml @@ -109,7 +109,7 @@ - +