fix(ui): session terminal scrolls to end after layout so last line is fully visible

This commit is contained in:
Mika Kuns
2026-04-22 15:42:02 +02:00
parent 5e54275842
commit 7de5510735
2 changed files with 4 additions and 3 deletions

View File

@@ -51,7 +51,7 @@
<!-- ── Log output ── --> <!-- ── Log output ── -->
<ScrollViewer Name="LogScroll" VerticalScrollBarVisibility="Auto" <ScrollViewer Name="LogScroll" VerticalScrollBarVisibility="Auto"
Padding="10,8,10,4"> Padding="10,8,10,12">
<ItemsControl ItemsSource="{Binding Log}"> <ItemsControl ItemsSource="{Binding Log}">
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate DataType="vm:LogLineViewModel"> <DataTemplate DataType="vm:LogLineViewModel">

View File

@@ -1,5 +1,6 @@
using System.Collections.Specialized; using System.Collections.Specialized;
using Avalonia.Controls; using Avalonia.Controls;
using Avalonia.Threading;
using ClaudeDo.Ui.ViewModels.Islands; using ClaudeDo.Ui.ViewModels.Islands;
namespace ClaudeDo.Ui.Views.Islands; namespace ClaudeDo.Ui.Views.Islands;
@@ -17,7 +18,7 @@ public partial class SessionTerminalView : UserControl
private void OnLogChanged(object? sender, NotifyCollectionChangedEventArgs e) private void OnLogChanged(object? sender, NotifyCollectionChangedEventArgs e)
{ {
if (e.Action == NotifyCollectionChangedAction.Add) if (e.Action != NotifyCollectionChangedAction.Add) return;
LogScroll.ScrollToEnd(); Dispatcher.UIThread.Post(() => LogScroll.ScrollToEnd(), DispatcherPriority.Background);
} }
} }