From 2c2d9d7fef5bd04470f39b0bd7ea8b189f2c612a Mon Sep 17 00:00:00 2001 From: Abeautifulsnow Date: Thu, 9 Jul 2026 11:59:25 +0800 Subject: [PATCH] feat(objects): add checkbox multi-select and grid view for object browser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(objects): add checkbox column toggle for object browser - Add objectBrowserShowCheckbox setting (default: false) to EditorSettings - Checkbox column hidden by default; auto-shows when any tables are selected - Toolbar button toggles multi-select mode (active state highlighted in primary color) - Clearing the toggle also clears all selections - Add i18n key objects.toggleCheckbox in en/zh-CN Closes #2748 (part 2) * feat(objects): add grid view mode for object browser - Add objectBrowserViewMode setting (list | grid, default: list) to EditorSettings - Toolbar segmented control toggles between list and grid views, persisted across sessions - Grid view renders cards (icon + name + type + row count) in a responsive auto-fill layout - Reuses existing sort, search, filter, multi-select and context menu - Partition children not expandable in grid mode (minimal version) - Add i18n keys objects.viewList/objects.viewGrid across all locales - Backfill objects.toggleCheckbox in es/it/ja/pt-BR/zh-TW (missed in prior commit) Refs #2748 * fix(objects): redesign grid view cards for visual polish - Center-align content (icon + name + metadata) for a proper tile look - Enlarge type icons (h-7) so color coding is visible at a glance - Merge type label and row count on one line with separator - Reduce internal spacing (gap-1.5) and tighten padding - Replace background hover with border glow + shadow for cleaner feedback - Narrow min card width (150px) for denser grid, add align-content:start - Softer rounded-lg corners Refs #2748 * fix(objects): polish grid view card visual details - Add colored circle background behind icons (type-matched opacity-10) - Increase name font from text-xs to text-sm for better legibility - Separate row count into a primary-tinted badge (only shown when > 0) - Keep type label clean without mixing row count inline Refs #2748 * fix(objects): refine grid card min-width, icon shadow, and type label size * @ feat(object-browser): align tile/grid card metadata with list view columns Add the metadata categories present in the list view but missing from the tile/grid card view (objectBrowserViewMode === "grid"): - Size pill (totalBytes) next to the existing rows pill in the stats row - Timestamps row showing created_at · updated_at (per-row conditional) - Comment row (truncated, per-row conditional, with hover tooltip) Each card now shows: icon, name, type label, rows pill, size pill, timestamps (when present), and comment (when present) — matching the same metadata categories the list view displays across its 8 columns. Also fix a pre-existing bug in the list view where the totalBytes column tooltip (:title) used formatObjectBrowserCount instead of formatObjectBrowserBytes, showing a count-formatted number instead of a byte-formatted size string. @ * @ feat(object-browser): add sort selector in toolbar for grid/list views The list view has column header click-to-sort but the grid/tile view had no way to change sort order. Add a compact sort selector in the toolbar that works identically in both views: - Native to show a blank selection. Add a watch on sortKeyOptions that resets sortKey to "name" and sortDirection to "asc" whenever the current key is no longer present. @ * chore(i18n): autofill new translations * perf(object-browser): virtualize tile/grid view with RecycleScroller Replaces the flat v-for over filteredRows with a row-chunked RecycleScroller, matching the list view. Previously, switching to tile mode on a schema with thousands of tables mounted every card and its CustomContextMenu at once, stalling the UI for several seconds. Changes: - gridRows computed: chunks filteredRows into rows of gridColumns cards - ResizeObserver on the grid container drives gridColumns; initial read uses getComputedStyle to match contentRect.width and avoid a 1-frame column jump on mount - objectGridRowHeight computed: item-size adapts to whether the dataset has timestamp/comment rows, minimising wasted row space - watch(gridContainerRef) re-attaches the observer across list<->grid toggles; onBeforeUnmount cleans up - scrollObjectsToTop() resets scroll position on sort, search, object-type filter and view-mode changes - CSS: new .object-browser-grid-wrapper / -scroller / -row classes with will-change / contain parity with the list scroller --------- Co-authored-by: dbx-i18n-bot --- .../src/components/objects/ObjectBrowser.vue | 262 +++++++++++++++++- apps/desktop/src/i18n/locales/en.ts | 6 + apps/desktop/src/i18n/locales/es.ts | 6 + apps/desktop/src/i18n/locales/it.ts | 6 + apps/desktop/src/i18n/locales/ja.ts | 6 + apps/desktop/src/i18n/locales/pt-BR.ts | 6 + apps/desktop/src/i18n/locales/zh-CN.ts | 6 + apps/desktop/src/i18n/locales/zh-TW.ts | 6 + apps/desktop/src/stores/settingsStore.ts | 8 + 9 files changed, 305 insertions(+), 7 deletions(-) diff --git a/apps/desktop/src/components/objects/ObjectBrowser.vue b/apps/desktop/src/components/objects/ObjectBrowser.vue index ed181f51f..6d3d28f44 100644 --- a/apps/desktop/src/components/objects/ObjectBrowser.vue +++ b/apps/desktop/src/components/objects/ObjectBrowser.vue @@ -1,5 +1,5 @@