* fix(ui): allow mouse interaction with LightTooltip interactive content (#1120)
- Remove pointer-events-none from tooltip content so mouse can enter it
- Add tooltipRef to detect hover state on the tooltip itself
- Replace immediate close with scheduleClose (100ms delay) on mouse leave
- Add onPointerDown handler that skips close for clicks inside tooltip
- Extend isTriggerActive() to check tooltip hover alongside trigger hover
Fixes#1120
* fix(ui): prevent click handler from firing on macOS Ctrl+click (#1188)
macOS: Ctrl+click fires both click and contextmenu events.
Elements with both @click and @contextmenu would trigger unwanted
navigation (ObjectBrowser table row, SqlLibraryPanel folder/file,
QueryHistory entry) alongside the context menu.
Fix: add a capture-phase click listener that stops propagation
when ctrlKey is true. This prevents the click from reaching Vue
handlers while the separate contextmenu event is unaffected.
- Add explain_query tool with structured EXPLAIN result, gated on supports_explain_plan()
- Add supports_sql_query() to gate execute_query/get_sample_data for non-SQL DBs (Redis, ES, MongoDB, etc.)
- Split agent loop tool dispatch: execute_query runs sequentially, all others run in parallel via join_all
- Wire explain_query result button to ExplainPlanViewer in AiAssistant + App.vue
- Fix O(n²) agentSteps rebuild: incremental O(1) push per event during streaming
- finally block falls back to full rebuild only when streaming push did not occur
* docs: design query result run tabs
* feat(query): add result run model helpers
* feat(query): persist result run metadata
* feat(query): record switchable result runs
* feat(query): sync active result run state
* feat(query): cache result run payloads
* feat(query): render result run tabs
* docs: design query result archives
* feat(query): add result archive codec
* feat(query): restore result archives
* feat(query): add result archive actions
* fix(query): toggle execution summary view
* fix(query): avoid archive compression backpressure
* feat(query): remove result runs
* chore: remove local spec docs from pr
AiAssistant.vue:
- Tool call steps now support click-to-expand/collapse for SQL args
and results (expandedSteps set); chevron rotates on open
- Remove fixed-open result display (was always visible, no toggle)
- Max result height raised to 48 (max-h-48) with scroll
ai.ts (buildModePromptLines agent branch):
- Replace vague "prioritize SQL" hint with explicit tool-use
instruction: must call execute_query, not just emit SQL text
- List available tools (list_tables, get_columns, execute_query,
get_sample_data) so LLM knows what it can call
- Clarify allowed statement types for execute_query
Move tool calling from non-streaming (complete) API calls to real
streaming SSE, so text, reasoning, and tool call arguments all arrive
incrementally — users see the AI think and act in real time.
- Extract ~370 lines of non-streaming tool-call functions from
agent_loop.rs (call_with_tools, call_openai_with_tools,
call_claude_with_tools, call_gemini_with_tools) and replace with
a single ai::stream_with_tools() dispatch call.
- Add streaming-with-tools infrastructure to ai.rs (~550 lines):
- StreamToolEvent enum: Chunk, ToolCallStart, ToolCallDelta,
ToolCallComplete — provider-agnostic, feeds into the
StreamingToolCallAccumulator
- stream_claude_with_tools(): parse SSE content_block_start/delta/
stop events, incremental input_json_delta for tool arguments
- stream_openai_with_tools(): parse SSE delta.tool_calls with
incremental function.arguments
- stream_gemini_with_tools(): parse SSE functionCall (Gemini
sends complete objects, not deltas — emit as one chunk)
- Cancellation support via tokio::select! in every streaming loop
- Extended timeout for reasoning models (600s vs 120s)
- StreamingToolCallAccumulator: collect partial tool call fragments
from streaming deltas, then deserialize into complete ToolCall
objects in index order once the stream ends.
Add visual indicators so users can distinguish readonly connections from
read-write connections at a glance:
- Sidebar: show a lock icon badge on readonly connection nodes
- Tab bar: show a lock icon with tooltip on tabs with readonly connections
- Add isConnectionReadonly() helper in tabPresentation.ts
- Add readOnlyBadge i18n key for all 6 locales (en, zh-CN, zh-TW, es, it, pt-BR)
Turso is a distributed SQLite database built on libSQL, offering HTTP-based
connectivity with auth token authentication. This change adds full support:
- New DatabaseType::Turso and PoolKind::Turso variants
- TursoClient driver using libSQL HTTP pipeline API (/v2/pipeline)
- Bearer token auth via password or url_params (auth_token=)
- Multi-statement batch pipeline for transactional integrity
- Standalone BEGIN/COMMIT/ROLLBACK treated as no-ops (pipeline is auto-commit)
- Full metadata support: tables, columns, indexes, foreign keys, triggers, DDL
- Frontend: connection form, SQL completion (SQLite syntax), capability sets
- Built-in databases (SQLite/Turso/DuckDB/RQLite/Access) placed first in selector
- Unit tests (15) + integration tests against live libsql-server (12)
- Single connection pool, skips TCP probe
Closes#948
Root cause: macOS emits a synthetic click event when the right mouse
button is released while holding Control. The outside-dismiss handler
was listening for click events in capture phase, which caught this
synthetic event and closed the menu right after it opened.
Fix: switch from click to pointerdown (with event.button === 0 guard)
for outside-dismiss detection. pointerdown fires on press before
contextmenu, so the right-button event (button:2) is filtered out
before the menu even opens, and the synthetic click is never seen.
MongoDB shell syntax like db.collection.find({}) was incorrectly
parsed as SQL, causing a "sql parser error" diagnostic in the editor.
Added MongoDB guards in shouldRunSqlSemanticDiagnostics and
refreshSemanticDiagnostics, matching existing Elasticsearch logic.
Also fix a pre-existing TiDB cloud URL param ordering test failure.
Row detail dialog was using displayableColumnIndexes instead of
visibleColumnIndexes, causing columns hidden via "hide null columns"
or manual hiding to still appear in the detail view.
- Add Navicat numeric ConnType codes (1-9) to typeMap for correct DB type mapping
- Add port-based inference fallback (6379→Redis, 27017→MongoDB, etc.)
- Expand typeMap with ClickHouse, Snowflake, KingbaseES, GaussDB, OceanBase
- Skip unrecognized connections instead of silently falling back to MySQL
- Extend hexToRgba() to handle rgba/rgb input passthrough
- Add pipette button with native color picker + text input in popover
- Custom color and preset colors are mutually exclusive
start_tunnel() and start_chain() had a check-then-act race condition:
multiple concurrent callers could all see an empty cache and each
spawn a new SSH tunnel. The tunnel that lost the insert race was
orphaned, causing queries routed through it to fail.
Use double-check locking with stale entry eviction: hold the lock for
the cache lookup, release it during the slow SSH handshake, then
re-check under the lock before inserting. If another caller already
created the tunnel, abort the duplicate and return the existing port.
Also check handle liveness on cache hits so that callers don't get a
dead port back when the background tunnel task has exited.
Add a matching re-check in the MongoDB connection pool creation path.
Add idle_timeout_secs connection option (default 60s) to preempt
server-side connection idle timeouts that cause "unexpected end of
file" errors on pooled MongoDB connections.
Reject MongoDB queries in the generic SQL execution path before any
pool or session-key creation. Previously, a typo in a MongoDB shell
command would fall through to executeMulti / execute_sql_statement,
which called get_or_create_pool_for_session and leaked a session-scoped
MongoDB Client (and SSH tunnel resources) before eventually returning
"Use MongoDB-specific commands".
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* feat(grid): add layer preview for geometry columns with Leaflet map
* fix: restore dev:backend script with env vars and cargo watch
* chore: update pnpm-lock.yaml for leaflet and dom-to-image-more dependencies
---------
Co-authored-by: dqn <someonegdeng@qq.com>
Frontend: add regex-based MongoDB URL parser to handle multi-host URIs
that the WHATWG URL parser rejects. Backend: separate
server_selection_timeout from connect_timeout for multi-host URIs to
prevent topology discovery from being cancelled by tokio timeout.
DOM mode: replace box-shadow with outline to avoid stacking with row border-b.
Canvas mode: draw row border before selected cell overlay so selection uses
uniform color on all four sides; clamp top edge to prevent canvas clipping.
coercePostgresArrayValue() only handled JSON [...] format but editor
outputs PG {...} format. When the user entered and exited edit mode
without changes, the string "{1,2,3}" failed to parse back to an
array, creating a false dirty detection via strict equality.
Add parsePostgresArrayText() recursive descent parser and return
oldValue reference when parsed result is equivalent.
- Route SELECT * FROM <index> through /_search for simple browses; aggregates/projections stay on /_sql
- Drive completion columns from /_mapping (flattened dotted fields, multi-fields)
- Switch editor completion to SQL when the active statement starts with SELECT/WITH on ES
- Skip generic SQL semantic diagnostics for ES (hyphenated wildcard indices caused 500s)
- Wire ES into server-side pagination plan; derive completion context from line blocks
- Fix result-grid pagination exceeding in-memory result sets (allRowsLoaded)
Three independent connection-list bugs:
1. Multi-select drag only moved one row. The drag system tracks a single
draggedId and ignored selectedTreeNodeIds. The drop callback now expands
to the full selection when the grabbed row is part of it, and the store
gains reorderSidebarEntries() to move them together.
2. Clicking the blank tree area didn't clear the selection (notably in
double-click activation mode). Row clicks now stopPropagation and the
tree containers clear the selection on click, so only blank clicks reset.
3. Creating a group then submitting an empty name dissolved ALL groups.
Enter (@keydown.enter) and the following @blur both fired finishRenameGroup;
the first call rebuilt the tree and recycled props.node onto another group,
so the second deleted the wrong one, cascading. Guard against double
invocation and treat an empty name as a cancel (never delete here — deleting
a group stays in the context menu).
Verified end-to-end on the web build: multi-select drag nests both
connections under the group; blank-click clears selection; empty-name Enter
keeps all groups intact. pnpm check is green.
Co-authored-by: vrustx <vrustx@vrustxdeMac-mini.local>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
After an app update (typically >15min since last use), the on-disk schema
tree cache is past its TTL and counts as stale. When "locate in sidebar"
loads the connection's databases, the stale cache is served synchronously
and an async `refreshStaleTreeNode` fires in the background; that refresh
replaces the database node with a fresh one whose tables haven't loaded
yet, evicting the node that locate just populated. By the time
`findNodePathForActiveTab` runs, the target table isn't in the tree, so
locate only reaches the database. After a restart the cache is fresh, no
refresh races, and locate works — matching the report.
Make `ensureTreeLoadedForTab` accept `{ force }` (loads everything via
awaited calls, bypassing the stale-cache fire-and-forget path) and, in
`locateActiveTabInSidebar`, retry once with force when the first
`findNodePath` misses. Fresh-cache locates still succeed on the first
pass and never force (no regression); `refreshStaleTreeNode` is untouched.
Co-authored-by: vrustx <vrustx@vrustxdeMac-mini.local>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The data grid header only showed column names, and column types were
available only via tableMeta (open-table view). Arbitrary query results
(e.g. `select * from pg_depend`) therefore showed no type at all, which
is exactly the case the reporter hit.
Backend: add `column_types` to QueryResult (serde-default, backward
compatible) and populate it for the native drivers where the type is
readily available — PostgreSQL, MySQL, SQL Server, ClickHouse. Other
drivers leave it empty for now (no behavior change); schemaless stores
(Mongo/Redis/ES) have no column types.
Frontend: render a type row under each column name in the grid header,
color-coded by type. The type is resolved from tableMeta first (richer,
includes precision) and falls back to the query result's column_types by
index. Add a `showColumnTypesInHeader` setting (default on) and keep the
msgpack tab-result cache compatible. The source-selection logic is
extracted to lib/dataGridColumnType.ts with unit tests.
Co-authored-by: vrustx <vrustx@vrustxdeMac-mini.local>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The sidebar already supports multi-select, so deletion now resolves the context-clicked selected connection set before confirming. Connection removal gained a batched path to persist once while pruning sidebar layout, pins, active state, connection errors, and stale selection for every removed connection.
Constraint: No new dependencies and existing single-connection delete behavior must remain available.\nRejected: Delete every selected tree item regardless of type | mixed tree selections could unexpectedly remove connections while table/object deletion has separate SQL confirmation behavior.\nConfidence: high\nScope-risk: narrow\nTested: pnpm fmt; pnpm test; pnpm typecheck; pnpm lint; pnpm build\nNot-tested: Manual desktop UI interaction against a running Tauri window
Co-authored-by: caisin <caisin@caisins-Mac-mini.local>
When editing SQL with concrete tables already referenced (a FROM clause,
a "table." qualifier, or an INSERT column list), column completions only
carried `computeBoost + keyBoost (0/500)` — lower than keyword boosts
(1200-1900) — so the table's own columns were interleaved among keywords
instead of ranking at the top where the user expects them.
Give columns a relevance boost (+2000) in these referenced-table contexts
so they rank above plain keywords. Added a unit test asserting columns
outrank keywords when a table is referenced.
Co-authored-by: vrustx <vrustx@vrustxdeMac-mini.local>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The bottom-docked cell detail side panel could not be resized and its
details view still used the old three-block "value / raw value / formatted
JSON" layout, causing the issues reported on macOS:
- bottom layout had no resize handle and a fixed, too-small height
- "value" showed the grid's (truncated) display value while "raw value"
showed the original — redundant for JSON, and shown inconsistently
(only when the two happened to differ)
- the "formatted value" block rendered the grid-truncated display value,
which is incomplete and confusing inside the detail view
Changes:
- side panel bottom layout: add a top-edge row-resize handle and make the
height adjustable (reuse clampCellDetailPanelSize, support vertical drag)
- unify the side panel details view with the cell-detail dialog: a single
value area showing the original value plus a "format JSON" toggle button
- drop the redundant "raw value" / "formatted value" blocks in both the
side panel and the dialog (the dialog change also addresses the #528
follow-up where the truncated "formatted value" block was confusing)
Co-authored-by: vrustx <vrustx@vrustxdeMac-mini.local>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
When app restarts, table data shows "data unavailable" but Mod+R didn't
work because the DataGrid component wasn't mounted. Fixed by handling
the reload emit directly in handleModRTarget. Also added kbd-styled
shortcut hint (⌘R / Ctrl+R) on the data-unavailable placeholder.
Address the follow-up UI feedback on the data detail dialogs:
- cell detail: toggle between raw value and formatted JSON inside a single
value area (via a "format JSON" button) instead of stacking the value,
formatted value and formatted JSON blocks, removing the redundancy.
- kill horizontal scrollbars: add break-words to the formatted-value block,
and constrain row/column detail value columns with w-full max-w-0 so long
unbroken values wrap instead of overflowing the table.
- row detail: column name uses break-words instead of break-all to stop long
names from wrapping character-by-character.
- unify footer button layout across the three detail dialogs (bulk-copy
actions on the left, copy-name on the right).
- add a search box to row & column detail to filter fields by name / value /
row number (filterDataGridDetailFields + unit tests).
- i18n: add detailSearchPlaceholder / detailSearchNoMatch for all 6 locales.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Database connection context menus now show a copy action when the connection has enabled transport layers. The action starts or reuses the ordered transport chain, copies the final local forwarding port, and keeps runtime config cached so later disconnect cleanup can stop the created tunnel.
Constraint: Local testing sometimes needs external tools to connect through DBX's generated proxy/tunnel endpoint
Rejected: Copy full host:port endpoint | user specifically asked for the port and existing tunnel host is always localhost
Rejected: Require an active pool before copying | local test workflows may need the tunnel before opening the DBX connection
Confidence: high
Scope-risk: moderate
Tested: pnpm test -- packages/app-tests/connectionTransport.test.ts (ran full app-tests: 862 passed)
Tested: pnpm typecheck
Tested: pnpm exec oxlint --vue-plugin apps/desktop/src/components/sidebar/TreeItem.vue apps/desktop/src/lib/connectionTransport.ts apps/desktop/src/lib/api.ts apps/desktop/src/lib/tauri.ts apps/desktop/src/lib/http.ts
Tested: cargo check -p dbx-core -p dbx-web
Tested: cargo check -p dbx
Tested: cargo fmt --check --all
Co-authored-by: caisin <caisin@caisins-Mac-mini.local>
* Preserve ordered SSH and proxy connection layers
Replace separate SSH/proxy connection fields with ordered transport_layers while keeping legacy migration and secret fallback paths intact. The UI now edits SSH tunnel/proxy layers in configured order without a global SSH enable gate.
Constraint: Existing saved SSH tunnels, proxy settings, and secret-store keys must continue to load through migration.
Rejected: Folding proxy fields into SshTunnelConfig | mixes proxy semantics into an SSH-specific structure.
Confidence: high
Scope-risk: moderate
Directive: Keep SSH/proxy structs provider-specific; put cross-layer chaining in transport_layer_tunnel orchestration.
Tested: git diff --check; cargo fmt --check; cargo check --workspace; cargo test -p dbx-core --lib; vue-tsc --noEmit --project apps/desktop/tsconfig.json; tsc -p packages/node-core/tsconfig.json --noEmit; oxlint --vue-plugin apps/desktop/src; tsx --tsconfig apps/desktop/tsconfig.json --test packages/app-tests/*.test.ts; tsx --test packages/node-core/tests/*.test.ts
Not-tested: Live external SSH/proxy/database endpoint integration.
* Keep ordered transport changes CI-format clean
Constraint: CI pnpm check failed only on oxfmt formatting for two desktop TypeScript files
Confidence: high
Scope-risk: narrow
Directive: Keep generated/editor config changes out of this PR fix commit
Tested: PATH="/Volumes/data/code/rust/dbx/node_modules/.bin:/Users/hekx/.codex/tmp/arg0/codex-arg0nuL34n:/Users/hekx/.cargo/bin:/Users/hekx/.local/bin:/opt/homebrew/opt/llvm/bin:/opt/homebrew/opt/libpq/bin:/Volumes/data/Users/hekx/.opencode/bin:/Users/hekx/.bun/bin:/Volumes/data/sdks/flutter/bin:/Volumes/data/Users/hekx/.cargo/bin:/Users/hekx/.local/bin:/opt/homebrew/opt/llvm/bin:/opt/homebrew/opt/libpq/bin:/Volumes/data/Users/hekx/.opencode/bin:/Users/hekx/.bun/bin:/Volumes/data/Users/hekx/Library/pnpm:/Volumes/data/sdks/flutter/bin:/Volumes/data/Users/hekx/.cargo/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/pkg/env/global/bin:/opt/X11/bin:/Library/Apple/usr/bin:/Applications/Wireshark.app/Contents/MacOS:/usr/local/go/bin:/opt/homebrew/bin:/opt/podman/bin:/Applications/Ghostty.app/Contents/MacOS" rtk node scripts/run-check.mjs
Not-tested: GitHub Actions rerun not observed locally
* Keep Rust checks warning-clean
Constraint: cargo clippy --workspace --all-targets --all-features -- -D warnings failed across core, web, and tauri crates
Rejected: Broad workspace-level clippy suppression | kept allows local to long-argument command/API boundaries
Confidence: high
Scope-risk: moderate
Directive: Preserve src-tauri/tauri.conf.json as an unrelated local change outside this commit
Tested: rtk cargo clippy --workspace --all-targets --all-features -- -D warnings
Not-tested: Full GitHub Actions rerun not observed locally
* Reuse existing proxy tunnels on retry
Proxy tunnel startup now mirrors SSH tunnel behavior by returning the existing local port for an active connection id instead of replacing the managed handle. A second map check aborts a just-spawned duplicate handle if a concurrent retry won the race before insertion, preventing orphaned listeners while keeping the change narrow.
Constraint: Reviewer requested proxy tunnel behavior align with SSH local-port reuse
Rejected: Always overwrite and abort the previous handle | less consistent with SSH behavior and churns listeners during retries
Confidence: high
Scope-risk: narrow
Tested: cargo fmt --check --all
Tested: cargo test -p dbx-core db::proxy_tunnel::tests::start_tunnel_reuses_existing_local_port
Tested: cargo clippy -p dbx-core --all-targets -- -D warnings
---------
Co-authored-by: hekx <hekx@momandeMac-mini.local>
Co-authored-by: caisin <caisin@caisins-Mac-mini.local>
- Fix PostgreSQL function highlighting by disabling doubleDollarQuotedStrings
in extended PostgreSQL dialect, enabling PL/pgSQL syntax highlighting
inside $ blocks
- Add complete custom editor theme system with multi-theme management
(create, rename, duplicate, delete), visual color editor (12 colors),
JSON import/export, real-time preview, and 12 preset color schemes
- Add background/foreground color customization with system theme defaults
- Optimize EditorSettingsDialog layout: 2-column grid with font selector
taking available space and theme dropdown grouped with custom theme button
- Add i18n support for custom theme UI (en, zh-CN, zh-TW, es)
- Fix Tauri production build by adding custom-protocol feature
- Update .gitignore for temporary build artifacts
Closes t8y2#788
Co-authored-by: Sam <14344444@@qq.com>