From 71a3765c07122f9d2aa175ee51fc326ace90053f Mon Sep 17 00:00:00 2001 From: mika kuns Date: Thu, 4 Jun 2026 20:27:03 +0200 Subject: [PATCH] fix(ui): render Output log directly on the console, not as a nested card MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Output tab embedded SessionTerminalView, which is itself a bordered terminal card with its own header — a card inside the console card. Render the log lines directly on the console body instead (the console already provides the terminal chrome, traffic lights, and status chip), with auto-scroll moved to code-behind. Co-Authored-By: Claude Opus 4.7 --- .../Views/Islands/Detail/WorkConsole.axaml | 32 +++++++++++------ .../Views/Islands/Detail/WorkConsole.axaml.cs | 34 ++++++++++++++++++- 2 files changed, 55 insertions(+), 11 deletions(-) diff --git a/src/ClaudeDo.Ui/Views/Islands/Detail/WorkConsole.axaml b/src/ClaudeDo.Ui/Views/Islands/Detail/WorkConsole.axaml index 6e25b8c..3e85827 100644 --- a/src/ClaudeDo.Ui/Views/Islands/Detail/WorkConsole.axaml +++ b/src/ClaudeDo.Ui/Views/Islands/Detail/WorkConsole.axaml @@ -1,7 +1,6 @@ @@ -139,15 +138,28 @@ - - + + + + + + + + + + + + + diff --git a/src/ClaudeDo.Ui/Views/Islands/Detail/WorkConsole.axaml.cs b/src/ClaudeDo.Ui/Views/Islands/Detail/WorkConsole.axaml.cs index e5edc5d..7efcc15 100644 --- a/src/ClaudeDo.Ui/Views/Islands/Detail/WorkConsole.axaml.cs +++ b/src/ClaudeDo.Ui/Views/Islands/Detail/WorkConsole.axaml.cs @@ -1,8 +1,40 @@ +using System; +using System.Collections.Specialized; using Avalonia.Controls; +using ClaudeDo.Ui.ViewModels.Islands; namespace ClaudeDo.Ui.Views.Islands.Detail; public partial class WorkConsole : UserControl { - public WorkConsole() => InitializeComponent(); + private INotifyCollectionChanged? _log; + + public WorkConsole() + { + InitializeComponent(); + DataContextChanged += OnDataContextChanged; + } + + private void OnDataContextChanged(object? sender, EventArgs e) + { + if (_log is not null) + _log.CollectionChanged -= OnLogChanged; + + _log = (DataContext as DetailsIslandViewModel)?.Log; + + if (_log is not null) + _log.CollectionChanged += OnLogChanged; + } + + private void OnLogChanged(object? sender, NotifyCollectionChangedEventArgs e) + { + if (e.Action != NotifyCollectionChangedAction.Add) return; + EventHandler? handler = null; + handler = (_, _) => + { + LogScroll.LayoutUpdated -= handler; + LogScroll.ScrollToEnd(); + }; + LogScroll.LayoutUpdated += handler; + } }