feat(sqlfile): add refresh, locate, and context menu to SQL Files panel (#2715)

* feat(sqlfile): add refresh, locate, and context menu to SQL Files panel

- Add per-folder Refresh and Reveal-in-file-manager buttons on each opened
  folder header, plus a Refresh-all button on the panel toolbar. Re-scan
  prunes expand state for paths that no longer exist after refresh.
- Add right-click context menus (via CustomContextMenu) for files, folders,
  folder headers, and the panel background: open, execute SQL file, reveal
  in file manager, copy path, expand/collapse all, refresh, remove folder.
- Highlight the selected tree row on click/right-click; clicking empty space
  clears the selection.
- Wire "Execute SQL file" from the panel into the App-level
  SqlFileExecutionDialog via connectionStore.sqlFileSource.filePath + a new
  prefillFilePath prop, so the dialog opens with the file preview preloaded.
- Add zh-CN/en strings under sqlFileTree.

* chore(i18n): autofill new translations

* fix(sqlfile): clear prefillFilePath on close, dedupe i18n keys

---------

Co-authored-by: wanqinghua <wanqhua@gmail.com>
Co-authored-by: dbx-i18n-bot <github-actions[bot]@users.noreply.github.com>
Co-authored-by: t8y2 <1156263951@qq.com>
This commit is contained in:
authored and GitHub committed 2026-07-07 10:34:32 +08:00
1 parent 56fbbbfc8e
commit dde8d4584f
12 files changed
+395 -58

No files matched your search

@@ -27,6 +27,7 @@ const open = defineModel<boolean>("open", { default: false });
const props = defineProps<{
prefillConnectionId?: string;
prefillDatabase?: string;
prefillFilePath?: string;
}>();
const store = useConnectionStore();
@@ -410,6 +411,11 @@ watch(
if (connectionId.value) {
loadDatabasesForConnection(connectionId.value);
}
// When opened from the SQL Files panel with a pre-selected file, load its
// preview automatically so the user can review statements before running.
if (props.prefillFilePath) {
void loadPreview(props.prefillFilePath);
}
},
{ immediate: true },
);