fix(ui): session terminal scrolls to end after layout so last line is fully visible
This commit is contained in:
@@ -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">
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user