From a0d4a314679b94947bfd35ce8b842a6bd7e4eac1 Mon Sep 17 00:00:00 2001 From: zipg Date: Tue, 28 Jul 2026 21:11:59 +0800 Subject: [PATCH] feat(hbase): improve desktop connections and table operations --- apps/desktop/public/icons/database/hbase.svg | 3 + apps/desktop/src/components/grid/DataGrid.vue | 5 +- .../components/grid/DataGridPagination.vue | 34 +++-- .../grid/__tests__/DataGridSurfaces.spec.ts | 20 +++ .../src/components/hbase/HBaseBrowser.vue | 12 +- .../src/components/icons/DatabaseIcon.vue | 1 + .../src/components/layout/AppTabBar.vue | 8 +- .../layout/__tests__/AppTabBar.spec.ts | 8 ++ .../sidebar/SidebarTreeRuntimeHost.vue | 65 +++++++-- .../sidebar/sidebarTreeDeleteShortcut.spec.ts | 108 +++++++++++++++ .../src/lib/hbase/hbaseBrowserPreferences.ts | 20 +++ .../lib/sidebar/sidebarTreeDeleteShortcut.ts | 32 +++++ .../queryStore.database-open.spec.ts | 20 +++ apps/desktop/src/stores/queryStore.ts | 4 + crates/dbx-core/src/storage.rs | 131 +++++++++++++++--- .../app-tests/hbaseBrowserRefresh.test.ts | 70 ++++++++++ src-tauri/src/commands/connection.rs | 23 +++ 17 files changed, 514 insertions(+), 50 deletions(-) create mode 100644 apps/desktop/public/icons/database/hbase.svg create mode 100644 apps/desktop/src/lib/__tests__/sidebar/sidebarTreeDeleteShortcut.spec.ts create mode 100644 apps/desktop/src/lib/hbase/hbaseBrowserPreferences.ts create mode 100644 apps/desktop/src/lib/sidebar/sidebarTreeDeleteShortcut.ts create mode 100644 packages/app-tests/hbaseBrowserRefresh.test.ts diff --git a/apps/desktop/public/icons/database/hbase.svg b/apps/desktop/public/icons/database/hbase.svg new file mode 100644 index 0000000000..1e0df2e379 --- /dev/null +++ b/apps/desktop/public/icons/database/hbase.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue index f212f52c40..7897735d53 100644 --- a/apps/desktop/src/components/grid/DataGrid.vue +++ b/apps/desktop/src/components/grid/DataGrid.vue @@ -299,6 +299,7 @@ interface DataGridProps { totalRowCount?: number; totalRowCountIsExact?: boolean; paginationTotalRowCount?: number; + paginationEnabled?: boolean; totalRowCountLoading?: boolean; loading?: boolean; cacheKey?: string; @@ -319,6 +320,7 @@ const props = withDefaults(defineProps(), { // Vue casts absent Boolean props to false unless a default is explicit. // Regular grids have exact totals; document stores opt into lower-bound totals. totalRowCountIsExact: true, + paginationEnabled: true, // Omitted row-action limits must keep normal table-data editing. allowInsertRows: undefined, allowDeleteRows: undefined, @@ -461,7 +463,7 @@ const compactColumnHeaderActions = computed(() => settingsStore.editorSettings.c const dataGridRenderMode = computed(() => settingsStore.editorSettings.dataGridRenderMode); const dataGridSearchMode = computed(() => settingsStore.editorSettings.dataGridSearchMode); const compactDataGridToolbar = computed(() => dataGridTopbarWidth.value > 0 && dataGridTopbarWidth.value < DATA_GRID_COMPACT_TOPBAR_WIDTH); -const infiniteScrollEnabled = computed(() => settingsStore.editorSettings.infiniteScroll); +const infiniteScrollEnabled = computed(() => props.paginationEnabled && settingsStore.editorSettings.infiniteScroll); const infiniteScrollMaxRows = computed(() => settingsStore.editorSettings.infiniteScrollMaxRows); const expandedCellEditor = ref<{ rowId: number; col: number } | null>(null); @@ -9178,6 +9180,7 @@ const gridContextMenuItems = computed(() => { (); +withDefaults( + defineProps<{ + paginationEnabled?: boolean; + selectionSummary: { cellCount: number; rowCount: number } | null; + selectionSummarySumText: string; + loading: boolean; + infiniteScrollEnabled: boolean; + infiniteScrollAllLoaded: boolean; + pageSize: number; + pageSizeMenuItems: LightDropdownItem[]; + exportMenuItems: LightDropdownItem[]; + currentPage: number; + canGoNextPage: boolean; + canJumpLastPage: boolean; + }>(), + { paginationEnabled: true }, +); const customPageSizeInput = defineModel("customPageSizeInput", { default: "" }); @@ -47,10 +51,10 @@ const emit = defineEmits<{ -