refactor: commit message

- move issue tracker and commit hash links parsing to view models
- parsing links async
- make sure matched hash is a valid commit oid
- disable `CHILDREN` row in submodule info panel

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2025-03-04 16:04:19 +08:00
parent 5301a368e0
commit b75676a7f8
No known key found for this signature in database
17 changed files with 191 additions and 186 deletions

View file

@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Avalonia;
using Avalonia.Collections;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
@ -11,13 +11,13 @@ namespace SourceGit.Views
{
public partial class CommitBaseInfo : UserControl
{
public static readonly StyledProperty<string> MessageProperty =
AvaloniaProperty.Register<CommitBaseInfo, string>(nameof(Message), string.Empty);
public static readonly StyledProperty<Models.CommitFullMessage> FullMessageProperty =
AvaloniaProperty.Register<CommitBaseInfo, Models.CommitFullMessage>(nameof(FullMessage));
public string Message
public Models.CommitFullMessage FullMessage
{
get => GetValue(MessageProperty);
set => SetValue(MessageProperty, value);
get => GetValue(FullMessageProperty);
set => SetValue(FullMessageProperty, value);
}
public static readonly StyledProperty<Models.CommitSignInfo> SignInfoProperty =
@ -38,28 +38,19 @@ namespace SourceGit.Views
set => SetValue(SupportsContainsInProperty, value);
}
public static readonly StyledProperty<AvaloniaList<Models.CommitLink>> WebLinksProperty =
AvaloniaProperty.Register<CommitBaseInfo, AvaloniaList<Models.CommitLink>>(nameof(WebLinks));
public static readonly StyledProperty<List<Models.CommitLink>> WebLinksProperty =
AvaloniaProperty.Register<CommitBaseInfo, List<Models.CommitLink>>(nameof(WebLinks));
public AvaloniaList<Models.CommitLink> WebLinks
public List<Models.CommitLink> WebLinks
{
get => GetValue(WebLinksProperty);
set => SetValue(WebLinksProperty, value);
}
public static readonly StyledProperty<AvaloniaList<Models.IssueTrackerRule>> IssueTrackerRulesProperty =
AvaloniaProperty.Register<CommitBaseInfo, AvaloniaList<Models.IssueTrackerRule>>(nameof(IssueTrackerRules));
public static readonly StyledProperty<List<string>> ChildrenProperty =
AvaloniaProperty.Register<CommitBaseInfo, List<string>>(nameof(Children));
public AvaloniaList<Models.IssueTrackerRule> IssueTrackerRules
{
get => GetValue(IssueTrackerRulesProperty);
set => SetValue(IssueTrackerRulesProperty, value);
}
public static readonly StyledProperty<AvaloniaList<string>> ChildrenProperty =
AvaloniaProperty.Register<CommitBaseInfo, AvaloniaList<string>>(nameof(Children));
public AvaloniaList<string> Children
public List<string> Children
{
get => GetValue(ChildrenProperty);
set => SetValue(ChildrenProperty, value);