Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/PlanViewer.App/Controls/QuerySessionControl.Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sets the tooltip whenever SetStatus is called, but the 3-second auto-clear a few lines below only resets StatusText.Text = "" — it never calls ToolTip.SetTip(StatusText, null). So after an auto-clearing status message times out, the tooltip on the now-empty status bar still holds the previous (possibly long) text until the next SetStatus call overwrites it. Since this PR's whole point is "let people recover the full message via hover," the stale tip should probably be cleared in that same Dispatcher.UIThread.Post callback below.


if (autoClear && !string.IsNullOrEmpty(text))
{
var cts = new CancellationTokenSource();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
Loading