From 423d20bdd7e02895caaf22d2c5df5159398ee141 Mon Sep 17 00:00:00 2001 From: zipg Date: Tue, 21 Jul 2026 17:29:47 +0800 Subject: [PATCH] fix(grid): reset query result sorting on rerun --- apps/desktop/src/components/grid/DataGrid.vue | 12 ++++++----- .../queryStore.hiddenPrimaryKey.spec.ts | 21 +++++++++++++++++++ apps/desktop/src/stores/queryStore.ts | 8 +++++++ 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue index 7ff191742..8c8fc8ce0 100644 --- a/apps/desktop/src/components/grid/DataGrid.vue +++ b/apps/desktop/src/components/grid/DataGrid.vue @@ -35,6 +35,7 @@ import { PanelRight, TableProperties, Database, + Eraser, Columns3, PencilRuler, WandSparkles, @@ -492,7 +493,7 @@ function sortMenuItems(column: string, columnIndex: number) { currentPageDescending: t("grid.sortCurrentPageDescending"), clear: t("grid.clearSort"), }, - icons: { database: Database, ascending: ArrowUp, descending: ArrowDown, clear: ArrowUpDown }, + icons: { database: Database, ascending: ArrowUp, descending: ArrowDown, clear: Eraser }, }); } @@ -7364,7 +7365,7 @@ const gridContextMenuItems = computed(() => { localDescending: t("grid.sortCurrentPageDescending"), clearSort: t("grid.clearSort"), }, - icons: { copy: Copy, columnDetails: TableProperties, database: Database, ascending: ArrowUp, descending: ArrowDown, clearSort: ArrowUpDown }, + icons: { copy: Copy, columnDetails: TableProperties, database: Database, ascending: ArrowUp, descending: ArrowDown, clearSort: Eraser }, actions: { copyName: copyHeaderColumn, copyNames: copyColumnNames, details: openContextColumnDetailDialog, copyAlterSql: copyAlterColumnSql, sort: applyContextSort }, filterSubmenu: filterSubmenu(), }), @@ -7847,9 +7848,10 @@ const gridContextMenuItems = computed(() => { :items="sortMenuItems(col.name, col.actualColIdx)" :open="headerSortMenuOpenColumn === col.actualColIdx" :selected-value="selectedSortMenuValue(col.name, col.actualColIdx)" + check-position="none" align="end" content-class="w-max min-w-28 p-0.5" - item-class="gap-1 px-1.5 py-0.5 text-xs" + item-class="gap-1 rounded-none px-1.5 py-0.5 text-xs" item-icon-class="h-3 w-3" :match-trigger-width="false" @update:open="(value: boolean) => (headerSortMenuOpenColumn = value ? col.actualColIdx : null)" @@ -7858,8 +7860,8 @@ const gridContextMenuItems = computed(() => {