From f19afabff12c145aed5590033a5b0d29390acc7e Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Fri, 21 Aug 2026 21:37:50 +0100 Subject: [PATCH] Stop cutting Query Store errors before the status bar can trim them Same family as #448, different surface. QueryStore.cs cut the message to 80 characters and appended an ellipsis before handing it to StatusText, which already has TextTrimming="CharacterEllipsis". The trimming is the control's job and it does it against the actual available width; doing it again in code threw away text the control would otherwise have kept. It also cost the only way to recover the rest. The bar is one line, so a long message is readable on hover or not at all - SetStatus now sets the tip to the full text, which costs nothing when the message fits and is the difference between a truncated error and a recoverable one when it does not. That applies to every status, not just this one, because every status goes through the same bar with the same one-line constraint. Co-Authored-By: Claude Opus 5 (1M context) --- src/PlanViewer.App/Controls/QuerySessionControl.Editor.cs | 5 +++++ .../Controls/QuerySessionControl.QueryStore.cs | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/PlanViewer.App/Controls/QuerySessionControl.Editor.cs b/src/PlanViewer.App/Controls/QuerySessionControl.Editor.cs index 9a612ccc..a1db6987 100644 --- a/src/PlanViewer.App/Controls/QuerySessionControl.Editor.cs +++ b/src/PlanViewer.App/Controls/QuerySessionControl.Editor.cs @@ -315,6 +315,11 @@ private void SetStatus(string text, bool autoClear = true) StatusText.Text = text; + /* The bar is one line and trims with an ellipsis, so a long message - an error, usually - + is readable only on hover. Setting the tip to the same text costs nothing when it fits and + is the difference between a truncated error and a recoverable one when it does not. */ + ToolTip.SetTip(StatusText, string.IsNullOrEmpty(text) ? null : text); + if (autoClear && !string.IsNullOrEmpty(text)) { var cts = new CancellationTokenSource(); diff --git a/src/PlanViewer.App/Controls/QuerySessionControl.QueryStore.cs b/src/PlanViewer.App/Controls/QuerySessionControl.QueryStore.cs index ca308f82..fe2bf9b8 100644 --- a/src/PlanViewer.App/Controls/QuerySessionControl.QueryStore.cs +++ b/src/PlanViewer.App/Controls/QuerySessionControl.QueryStore.cs @@ -216,7 +216,12 @@ private async void QueryStore_Click(object? sender, RoutedEventArgs e) } catch (Exception ex) { - SetStatus(ex.Message.Length > 80 ? ex.Message[..80] + "..." : ex.Message, autoClear: false); + /* Was cut to 80 characters here before being handed to a status bar that already does + TextTrimming="CharacterEllipsis". The trimming is the bar's job and it does it against + the actual available width; doing it again in code just threw away text the control + would have kept, and with it the tooltip that now carries the full message. Same + family as #448. */ + SetStatus(ex.Message, autoClear: false); return; }