Skip to content

Commit df1d95f

Browse files
authored
switch the default grid GroupBy from "None" to "Query Hash" and don't open the first line by default (#305)
1 parent bfb19f2 commit df1d95f

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

src/PlanViewer.App/Controls/QueryStoreGridControl.axaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<StackPanel Spacing="4">
7171
<TextBlock Text="Group by" Foreground="{DynamicResource ForegroundBrush}" FontSize="11"/>
7272
<ComboBox x:Name="GroupByBox" Width="130" Height="36" FontSize="13"
73-
SelectedIndex="0" SelectionChanged="GroupBy_SelectionChanged">
73+
SelectedIndex="1" SelectionChanged="GroupBy_SelectionChanged">
7474
<ComboBoxItem Content="None" Tag="none"/>
7575
<ComboBoxItem Content="Query Hash" Tag="query-hash"/>
7676
<ComboBoxItem Content="Module" Tag="module"/>
@@ -150,7 +150,7 @@
150150
</ContextMenu>
151151
</DataGrid.ContextMenu>
152152
<DataGrid.Columns>
153-
<DataGridTemplateColumn Header="" Width="220" IsVisible="False">
153+
<DataGridTemplateColumn Header="" Width="220" IsVisible="True">
154154
<DataGridTemplateColumn.CellTemplate>
155155
<DataTemplate x:DataType="local:QueryStoreRow">
156156
<StackPanel Orientation="Horizontal" Margin="{Binding IndentMargin}"

src/PlanViewer.App/Controls/QueryStoreGridControl.axaml.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public partial class QueryStoreGridControl : UserControl
4444
private bool _waitStatsSupported; // false until version + capture mode confirmed
4545
private bool _waitStatsEnabled = true;
4646
private bool _waitPercentMode;
47-
private QueryStoreGroupBy _groupByMode = QueryStoreGroupBy.None;
47+
private QueryStoreGroupBy _groupByMode = QueryStoreGroupBy.QueryHash;
4848
private List<QueryStoreRow> _groupedRootRows = new(); // top-level rows for grouped mode
4949

5050
public event EventHandler<List<QueryStorePlan>>? PlansSelected;
@@ -89,6 +89,7 @@ public QueryStoreGridControl(ServerConnection serverConnection, ICredentialServi
8989
// Auto-fetch with default settings on connect
9090
Avalonia.Threading.Dispatcher.UIThread.Post(() =>
9191
{
92+
ReorderColumnsForGroupBy();
9293
Fetch_Click(null, new RoutedEventArgs());
9394
_initialOrderByLoaded = true;
9495
}, Avalonia.Threading.DispatcherPriority.Loaded);
@@ -311,12 +312,7 @@ private async System.Threading.Tasks.Task FetchGroupedPlansAsync(
311312
LoadButton.IsEnabled = true;
312313
SelectToggleButton.Content = "Select All";
313314

314-
// Auto-expand the first root row to the deepest level
315-
if (rootRows.Count > 0)
316-
{
317-
var first = rootRows[0];
318-
ExpandRowRecursive(first);
319-
}
315+
320316

321317
UpdateStatusText();
322318
UpdateBarRatios();

0 commit comments

Comments
 (0)