From f7d1b373439aa5bd6a964f914b602a9b65c34f6f Mon Sep 17 00:00:00 2001 From: mika kuns Date: Thu, 4 Jun 2026 09:08:04 +0200 Subject: [PATCH] feat(daily-prep): reuse SessionTerminal for prep log; fix invisible Sort icon; add Broom/List icons Co-Authored-By: Claude Sonnet 4.6 --- src/ClaudeDo.Ui/Design/IslandStyles.axaml | 10 +++- .../Views/Islands/DetailsIslandView.axaml | 29 +++--------- .../Views/Islands/SessionTerminalView.axaml | 12 ++--- .../Islands/SessionTerminalView.axaml.cs | 46 +++++++++++++------ 4 files changed, 54 insertions(+), 43 deletions(-) diff --git a/src/ClaudeDo.Ui/Design/IslandStyles.axaml b/src/ClaudeDo.Ui/Design/IslandStyles.axaml index 2f62fa1..09abb96 100644 --- a/src/ClaudeDo.Ui/Design/IslandStyles.axaml +++ b/src/ClaudeDo.Ui/Design/IslandStyles.axaml @@ -70,8 +70,14 @@ M4 7h16M10 11v6M14 11v6M5 7l1 13a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1l1-13M9 7V4h6v3 - - M7 4v16M7 20l-3-3M7 4l-3 3M14 8h7M14 12h5M14 16h3 + + M4 6 H20 V8 H4 Z M4 11 H16 V13 H4 Z M4 16 H11 V18 H4 Z + + + M11 3 H13 V10 H11 Z M8.5 10 H15.5 V12 H8.5 Z M9 12 H15 L17 21 H7 Z + + + M4 5 H6 V7 H4 Z M8 5 H20 V7 H8 Z M4 11 H6 V13 H4 Z M8 11 H20 V13 H8 Z M4 17 H6 V19 H4 Z M8 17 H20 V19 H8 Z M6 6l12 12M18 6L6 18 diff --git a/src/ClaudeDo.Ui/Views/Islands/DetailsIslandView.axaml b/src/ClaudeDo.Ui/Views/Islands/DetailsIslandView.axaml index 42d0610..d17c4e2 100644 --- a/src/ClaudeDo.Ui/Views/Islands/DetailsIslandView.axaml +++ b/src/ClaudeDo.Ui/Views/Islands/DetailsIslandView.axaml @@ -292,7 +292,10 @@ - + @@ -300,27 +303,9 @@ - - - - - - - - - - - - - - - + diff --git a/src/ClaudeDo.Ui/Views/Islands/SessionTerminalView.axaml b/src/ClaudeDo.Ui/Views/Islands/SessionTerminalView.axaml index f629938..05b6903 100644 --- a/src/ClaudeDo.Ui/Views/Islands/SessionTerminalView.axaml +++ b/src/ClaudeDo.Ui/Views/Islands/SessionTerminalView.axaml @@ -3,7 +3,7 @@ xmlns:vm="using:ClaudeDo.Ui.ViewModels.Islands" xmlns:loc="using:ClaudeDo.Ui.Localization" x:Class="ClaudeDo.Ui.Views.Islands.SessionTerminalView" - x:DataType="vm:DetailsIslandViewModel"> + x:Name="Root"> @@ -14,14 +14,14 @@ @@ -30,7 +30,7 @@ @@ -40,7 +40,7 @@ @@ -55,7 +55,7 @@ VerticalScrollBarVisibility="Visible" AllowAutoHide="False" Padding="10,8,10,12"> - + diff --git a/src/ClaudeDo.Ui/Views/Islands/SessionTerminalView.axaml.cs b/src/ClaudeDo.Ui/Views/Islands/SessionTerminalView.axaml.cs index d70e299..bfc7996 100644 --- a/src/ClaudeDo.Ui/Views/Islands/SessionTerminalView.axaml.cs +++ b/src/ClaudeDo.Ui/Views/Islands/SessionTerminalView.axaml.cs @@ -1,30 +1,50 @@ +using System.Collections; using System.Collections.Specialized; +using Avalonia; using Avalonia.Controls; -using ClaudeDo.Ui.ViewModels.Islands; namespace ClaudeDo.Ui.Views.Islands; public partial class SessionTerminalView : UserControl { + public static readonly StyledProperty EntriesProperty = + AvaloniaProperty.Register(nameof(Entries)); + public static readonly StyledProperty LabelProperty = + AvaloniaProperty.Register(nameof(Label)); + public static readonly StyledProperty IsRunningProperty = + AvaloniaProperty.Register(nameof(IsRunning)); + public static readonly StyledProperty IsDoneProperty = + AvaloniaProperty.Register(nameof(IsDone)); + public static readonly StyledProperty IsFailedProperty = + AvaloniaProperty.Register(nameof(IsFailed)); + + public IEnumerable? Entries { get => GetValue(EntriesProperty); set => SetValue(EntriesProperty, value); } + public string? Label { get => GetValue(LabelProperty); set => SetValue(LabelProperty, value); } + public bool IsRunning { get => GetValue(IsRunningProperty); set => SetValue(IsRunningProperty, value); } + public bool IsDone { get => GetValue(IsDoneProperty); set => SetValue(IsDoneProperty, value); } + public bool IsFailed { get => GetValue(IsFailedProperty); set => SetValue(IsFailedProperty, value); } + + private INotifyCollectionChanged? _subscribedCollection; + public SessionTerminalView() { InitializeComponent(); } - private DetailsIslandViewModel? _boundVm; - - protected override void OnDataContextChanged(EventArgs e) + protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) { - base.OnDataContextChanged(e); - if (_boundVm is not null) - _boundVm.Log.CollectionChanged -= OnLogChanged; - _boundVm = DataContext as DetailsIslandViewModel; - if (_boundVm is not null) - _boundVm.Log.CollectionChanged += OnLogChanged; + base.OnPropertyChanged(change); + if (change.Property != EntriesProperty) return; + + if (_subscribedCollection is not null) + _subscribedCollection.CollectionChanged -= OnEntriesChanged; + + _subscribedCollection = change.NewValue as INotifyCollectionChanged; + + if (_subscribedCollection is not null) + _subscribedCollection.CollectionChanged += OnEntriesChanged; } - private void OnLogChanged(object? sender, NotifyCollectionChangedEventArgs e) + private void OnEntriesChanged(object? sender, NotifyCollectionChangedEventArgs e) { if (e.Action != NotifyCollectionChangedAction.Add) return; - // Scroll after the next layout pass so the freshly-added (wrapping) line - // is measured first — otherwise ScrollToEnd stops short and clips it. EventHandler? handler = null; handler = (_, _) => {