Files
ClaudeDo/src/ClaudeDo.Ui/Views/Islands/SessionTerminalView.axaml
T
mika kuns 6927805600 fix(ui): stop clipping the last log line in scrollable output
Avalonia 12 leaves ScrollViewer.Padding out of the scroll Extent, so at
maximum offset the content still overhangs the viewport by the padding
height — the last lines were cut off and unreachable even after
ScrollToEnd(). Move the inset onto the content (Margin on the inner
ItemsControl/StackPanel) and leave the ScrollViewer padding-free.

Affects the work console Output/Git/Session tabs, the reusable session
terminal (task + prep log) and the log visualizer.
2026-08-11 09:26:06 +02:00

81 lines
3.8 KiB
XML

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:ClaudeDo.Ui.ViewModels.Islands"
xmlns:loc="using:ClaudeDo.Ui.Localization"
x:Class="ClaudeDo.Ui.Views.Islands.SessionTerminalView"
x:Name="Root">
<Border Classes="terminal" Margin="0">
<DockPanel LastChildFill="True">
<!-- ── Terminal header bar ── -->
<Grid DockPanel.Dock="Top" ColumnDefinitions="Auto,*,Auto"
Background="{DynamicResource Surface2Brush}"
Height="28">
<!-- Session label -->
<TextBlock Grid.Column="1"
Classes="meta"
Text="{Binding #Root.Label}"
LetterSpacing="0.8"
Foreground="{DynamicResource TextMuteBrush}"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
<!-- LIVE chip -->
<Border Grid.Column="2" Classes="live-chip pulsing"
IsVisible="{Binding #Root.IsRunning}"
Margin="0,0,8,0" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal" Spacing="5" VerticalAlignment="Center">
<Ellipse VerticalAlignment="Center"/>
<TextBlock Text="{loc:Tr session.chipLive}" VerticalAlignment="Center"/>
</StackPanel>
</Border>
<!-- DONE chip -->
<Border Grid.Column="2" Classes="live-chip done"
IsVisible="{Binding #Root.IsDone}"
Margin="0,0,8,0" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal" Spacing="5" VerticalAlignment="Center">
<Ellipse VerticalAlignment="Center" Fill="{DynamicResource MossBrush}"/>
<TextBlock Text="{loc:Tr session.chipDone}" VerticalAlignment="Center"
Foreground="{DynamicResource MossBrush}"/>
</StackPanel>
</Border>
<!-- FAILED chip -->
<Border Grid.Column="2" Classes="live-chip failed"
IsVisible="{Binding #Root.IsFailed}"
Margin="0,0,8,0" VerticalAlignment="Center">
<StackPanel Orientation="Horizontal" Spacing="5" VerticalAlignment="Center">
<Ellipse VerticalAlignment="Center" Fill="{DynamicResource BloodBrush}"/>
<TextBlock Text="{loc:Tr session.chipFailed}" VerticalAlignment="Center"
Foreground="{DynamicResource BloodBrush}"/>
</StackPanel>
</Border>
</Grid>
<!-- ── Log output ── -->
<!-- Inset on the content, not on the ScrollViewer — Avalonia 12 excludes
ScrollViewer.Padding from the Extent, which clips the last log lines. -->
<ScrollViewer Name="LogScroll"
VerticalScrollBarVisibility="Visible"
AllowAutoHide="False">
<ItemsControl ItemsSource="{Binding #Root.Entries}" Margin="10,8,10,12">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="vm:LogLineViewModel">
<Grid ColumnDefinitions="60,*" Margin="0,1">
<!-- Timestamp -->
<TextBlock Grid.Column="0"
Classes="log-ts"
Text="{Binding TimestampFormatted}"/>
<!-- Message text — selectable so the user can copy raw output -->
<SelectableTextBlock Grid.Column="1"
Text="{Binding Text}" Tag="{Binding ClassName}"
Foreground="{Binding Kind, Converter={StaticResource LogKindForeground}}"
TextWrapping="Wrap"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</DockPanel>
</Border>
</UserControl>