using System.Collections.ObjectModel;
namespace MarketAlly.GitCommitEditor.Models;
///
/// Represents a branch in a Git repository for display in TreeView.
///
public class BranchInfo
{
public string Name { get; init; } = string.Empty;
public string FullName { get; init; } = string.Empty;
public bool IsRemote { get; init; }
public bool IsCurrentHead { get; init; }
public string? LastCommitSha { get; init; }
public DateTimeOffset? LastCommitDate { get; init; }
public string? RemoteName { get; init; }
}
///
/// Hierarchical node for TreeView display - can represent a repo or a branch category.
///
public class BranchTreeNode
{
public string Name { get; set; } = string.Empty;
public string? Icon { get; set; }
public bool IsExpanded { get; set; } = true;
public BranchInfo? Branch { get; set; }
public ObservableCollection Children { get; set; } = new();
///
/// Display name including icon for current branch indicator
///
public string DisplayName => Branch?.IsCurrentHead == true ? $"* {Name}" : Name;
///
/// Whether this node represents an actual branch (leaf node)
///
public bool IsBranch => Branch != null;
}