diff --git a/src/Nonemm.App/Windows/TelnetWindow.axaml b/src/Nonemm.App/Windows/TelnetWindow.axaml
index 2a69155..81066d8 100644
--- a/src/Nonemm.App/Windows/TelnetWindow.axaml
+++ b/src/Nonemm.App/Windows/TelnetWindow.axaml
@@ -9,16 +9,20 @@
+
+
-
+
-
-
+
@@ -29,8 +33,7 @@
+ DoubleTapped="OnJumpToSpot">
diff --git a/src/Nonemm.App/Windows/TelnetWindow.axaml.cs b/src/Nonemm.App/Windows/TelnetWindow.axaml.cs
index 099b097..a234b30 100644
--- a/src/Nonemm.App/Windows/TelnetWindow.axaml.cs
+++ b/src/Nonemm.App/Windows/TelnetWindow.axaml.cs
@@ -17,7 +17,9 @@ namespace Nonemm.App.Windows;
/// clicking a spot line puts the radio on it.
public sealed partial class TelnetWindow : RefreshableWindow
{
- private const int LinesKept = 500;
+ /// A node can send a spot a second for many hours, so the window keeps
+ /// the last thousand lines and no more.
+ private const int LinesKept = 1000;
private static IBrush SpotColour => Themes.Brush(Themes.Current.Multipliers);
@@ -29,7 +31,7 @@ public sealed partial class TelnetWindow : RefreshableWindow
private readonly Action tune;
private readonly List history = [];
private int recalled = -1;
- private bool paused;
+ private bool scrollPending;
public TelnetWindow(AppSession session, Action tune)
{
@@ -141,7 +143,8 @@ public sealed partial class TelnetWindow : RefreshableWindow
private void OnConnectionChanged(object? sender, bool connected) =>
Dispatcher.UIThread.Post(Refresh);
- /// `strong` marks the lines from a preferred spotter.
+ /// `strong` marks the lines from a preferred spotter. The view stays on the
+ /// newest line; a burst of lines is scrolled once, after the last of them.
private void Show(string line, IBrush? colour, bool strong = false) => Dispatcher.UIThread.Post(() =>
{
while (Traffic.Items.Count >= LinesKept)
@@ -154,25 +157,16 @@ public sealed partial class TelnetWindow : RefreshableWindow
Foreground = colour,
FontWeight = strong ? FontWeight.Bold : FontWeight.Normal,
});
- if (!paused && Traffic.Items.Count > 0)
+ if (!scrollPending)
{
- Traffic.ScrollIntoView(Traffic.Items.Count - 1);
+ scrollPending = true;
+ Dispatcher.UIThread.Post(ScrollToNewest, DispatcherPriority.Background);
}
- Refresh();
});
- /// Scrolling stops while the pointer is over the traffic, so a line can be
- /// read or copied while the node keeps sending.
- private void OnTrafficEntered(object? sender, PointerEventArgs e)
+ private void ScrollToNewest()
{
- paused = true;
- PausedText.IsVisible = true;
- }
-
- private void OnTrafficExited(object? sender, PointerEventArgs e)
- {
- paused = false;
- PausedText.IsVisible = false;
+ scrollPending = false;
if (Traffic.Items.Count > 0)
{
Traffic.ScrollIntoView(Traffic.Items.Count - 1);