feat(ui): Settings-Modal auf Sidebar-Kategorien umbauen
TabControl bleibt Content-Host, TabStrip wird retempliert (nur PART_SelectedContentHost) und durch eine zweigruppige Sidebar (BASIS/ERWEITERT) ersetzt. General wird in Allgemein/Ausfuehrung/Berichte gesplittet, Session Skills (Checkbox-Liste aus General + Skills-Tab) zu einer Liste zusammengelegt, und ein Repo-Hinweisstreifen erscheint auf Worktrees/Prime Claude/Session Skills/Berichte solange keine Liste ein WorkingDir hat. Fensterbreite 580 -> 700.
This commit is contained in:
@@ -18,7 +18,7 @@ public sealed partial class SessionSkillsSettingsTabViewModel : ViewModelBase
|
||||
[ObservableProperty] private bool _isBusy;
|
||||
[ObservableProperty] private bool _isEmpty = true;
|
||||
|
||||
public ObservableCollection<SessionSkillDto> Skills { get; } = new();
|
||||
public ObservableCollection<SessionSkillRowViewModel> Skills { get; } = new();
|
||||
|
||||
public SessionSkillsSettingsTabViewModel(IWorkerClient worker)
|
||||
{
|
||||
@@ -33,19 +33,31 @@ public sealed partial class SessionSkillsSettingsTabViewModel : ViewModelBase
|
||||
};
|
||||
}
|
||||
|
||||
public async Task LoadAsync()
|
||||
/// <summary>Loads the installed skills, marking each row selected per <paramref name="selectedNames"/>.
|
||||
/// When omitted, the current selection is preserved across the refresh (e.g. after install/update/remove).</summary>
|
||||
public async Task LoadAsync(IReadOnlyCollection<string>? selectedNames = null)
|
||||
{
|
||||
IsBusy = true;
|
||||
try
|
||||
{
|
||||
var selected = selectedNames ?? Skills.Where(s => s.IsSelected).Select(s => s.Name).ToList();
|
||||
var selectedSet = new HashSet<string>(selected);
|
||||
var skills = await _worker.GetSessionSkillsAsync();
|
||||
Skills.Clear();
|
||||
foreach (var s in skills) Skills.Add(s);
|
||||
foreach (var s in skills) Skills.Add(new SessionSkillRowViewModel(s, selectedSet.Contains(s.Name)));
|
||||
IsEmpty = Skills.Count == 0;
|
||||
}
|
||||
finally { IsBusy = false; }
|
||||
}
|
||||
|
||||
/// <summary>The globally-selected skill names, or null when none are selected (matches the
|
||||
/// AppSettingsDto.SessionSkills convention of "null means no global selection").</summary>
|
||||
public List<string>? SelectedSkillNames()
|
||||
{
|
||||
var names = Skills.Where(s => s.IsSelected).Select(s => s.Name).ToList();
|
||||
return names.Count == 0 ? null : names;
|
||||
}
|
||||
|
||||
private bool CanInstall() => !InstallOp.IsRunning;
|
||||
|
||||
[RelayCommand(CanExecute = nameof(CanInstall))]
|
||||
@@ -96,3 +108,27 @@ public sealed partial class SessionSkillsSettingsTabViewModel : ViewModelBase
|
||||
finally { IsBusy = false; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>One installed skill row: identity/management fields from <see cref="SessionSkillDto"/>
|
||||
/// plus the global "active for every task" checkbox state that used to live in a separate
|
||||
/// General-tab list.</summary>
|
||||
public sealed partial class SessionSkillRowViewModel : ViewModelBase
|
||||
{
|
||||
public string Name { get; }
|
||||
public string Description { get; }
|
||||
public string SourceUrl { get; }
|
||||
public string PinnedRef { get; }
|
||||
public DateTimeOffset AddedAt { get; }
|
||||
|
||||
[ObservableProperty] private bool _isSelected;
|
||||
|
||||
public SessionSkillRowViewModel(SessionSkillDto dto, bool isSelected)
|
||||
{
|
||||
Name = dto.Name;
|
||||
Description = dto.Description;
|
||||
SourceUrl = dto.SourceUrl;
|
||||
PinnedRef = dto.PinnedRef;
|
||||
AddedAt = dto.AddedAt;
|
||||
_isSelected = isSelected;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user