feat(ui): make sidebar folder hierarchy readable
Lists default to the Text icon instead of the folder icon, rows align across depths with a guide line per open folder, folder names are semibold, folder counts only show while collapsed and zero counts hide.
This commit is contained in:
@@ -111,7 +111,10 @@ public sealed partial class ListSettingsModalViewModel : ViewModelBase
|
||||
|
||||
public ObservableCollection<string> CommitTypeOptions { get; } = new(CommitTypeRegistry.Types);
|
||||
|
||||
public const string DefaultIcon = "Folder";
|
||||
public const string DefaultIcon = "Text";
|
||||
|
||||
/// <summary>Default icon for folders, kept apart from <see cref="DefaultIcon"/> so lists never look like folders.</summary>
|
||||
public const string DefaultFolderIcon = "Folder";
|
||||
|
||||
// Curated subset of the Icon.* geometry library in IslandStyles.axaml — window chrome and
|
||||
// pure stroke icons (PathIcon fills, so those render invisible) are deliberately left out.
|
||||
@@ -171,7 +174,7 @@ public sealed partial class ListSettingsModalViewModel : ViewModelBase
|
||||
IsFolder = true;
|
||||
CanToggleFolder = false;
|
||||
Name = name;
|
||||
Icon = IconOptions.Contains(icon) ? icon! : DefaultIcon;
|
||||
Icon = IconOptions.Contains(icon) ? icon! : DefaultFolderIcon;
|
||||
}
|
||||
|
||||
public async Task LoadAsync(
|
||||
@@ -261,6 +264,13 @@ public sealed partial class ListSettingsModalViewModel : ViewModelBase
|
||||
// A manual list without a WorkingDir is untouched (empty is always valid) — this only fires
|
||||
// for the "picked a folder that turns out not to be a repo" case the audit found: it would
|
||||
// otherwise only surface as a Failed task the first time the worker tries to use it.
|
||||
// The create-flow toggle swaps the untouched default so a new folder doesn't get the list icon.
|
||||
partial void OnIsFolderChanged(bool value)
|
||||
{
|
||||
if (Icon == (value ? DefaultIcon : DefaultFolderIcon))
|
||||
Icon = value ? DefaultFolderIcon : DefaultIcon;
|
||||
}
|
||||
|
||||
partial void OnWorkingDirChanged(string value)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(value)) { WorkingDirWarning = ""; return; }
|
||||
|
||||
Reference in New Issue
Block a user