Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix(import): keep the source file visible after the import finishes

李子凡6348108ace24
diff --git a/apps/desktop/src/components/import/TableImportDialog.vue b/apps/desktop/src/components/import/TableImportDialog.vue
index d7330cd966..0c8ba48902 100644
--- a/apps/desktop/src/components/import/TableImportDialog.vue
+++ b/apps/desktop/src/components/import/TableImportDialog.vue
@@ -367,14 +367,16 @@ const createColumnSummaries = computed(() =>
const parseOptions = computed<api.TableImportParseOptions>(() => taskParseOptions(sourceFormat.value, selectedSheet.value));
const terminalStatus = computed(() => !!progress.value?.status && ["done", "error", "cancelled"].includes(progress.value.status));
const displayedElapsedMs = computed(() => resolveTableImportElapsed(liveElapsedMs.value, progress.value?.elapsedMs, terminalStatus.value));
-// Source file the live progress belongs to (#13164): the queue runs one file
-// at a time, so the running task is whatever activeTaskIndex points at; the
-// single-file path has no task entry and reads the preview directly.
+// Source file the progress belongs to (#13164): the queue runs one file at a
+// time, so the active task is whatever activeTaskIndex points at; the
+// single-file path has no task entry and reads the preview directly. The file
+// stays visible once the run finishes, so the completion screen still says
+// which file was imported (#13495).
const activeImportFile = computed(() => {
- if (wizardStep.value !== "execution" || !running.value) return "";
+ if (wizardStep.value !== "execution") return "";
if (isBatchImport.value) {
const task = batchTasks.value[activeTaskIndex.value];
- return task?.status === "running" ? task.preview.filePath || task.preview.fileName || "" : "";
+ return task ? task.preview.filePath || task.preview.fileName || "" : "";
}
return preview.value?.filePath || "";
});
diff --git a/apps/desktop/src/components/import/__tests__/TableImportDialog.currentFile.spec.ts b/apps/desktop/src/components/import/__tests__/TableImportDialog.currentFile.spec.ts
index 690ad1ae41..8eed14f7d7 100644
--- a/apps/desktop/src/components/import/__tests__/TableImportDialog.currentFile.spec.ts
+++ b/apps/desktop/src/components/import/__tests__/TableImportDialog.currentFile.spec.ts
@@ -268,7 +268,7 @@ afterEach(() => {
});
describe("TableImportDialog current source file display (#13164)", () => {
- it("shows the running file while a batch import is queued and hides it once finished", async () => {
+ it("keeps the source file on screen after a batch import finishes", async () => {
holdImportInProgress();
await mountDialog([new File(["workbook"], "rows.xlsx")]);
await startImport();
@@ -287,11 +287,12 @@ describe("TableImportDialog current source file display (#13164)", () => {
resolveRunningImport?.();
await flushAsyncUpdates();
- expect(currentFileValue()).toBeUndefined();
+ // The completion screen still names the file that was imported (#13495).
+ expect(currentFileValue()).toBe("/tmp/rows.xlsx");
expect(mocks.importTableFile).toHaveBeenCalledTimes(3);
});
- it("shows the single-file source while its import runs", async () => {
+ it("shows the single-file source while its import runs and after it finishes", async () => {
mocks.previewTableImportFile.mockImplementation(() => Promise.resolve(delimitedPreview()));
holdImportInProgress();
await mountDialog([new File(['amount,note\n"12,50",plain'], "rows.csv")]);
@@ -301,7 +302,7 @@ describe("TableImportDialog current source file display (#13164)", () => {
resolveRunningImport?.();
await flushAsyncUpdates();
- expect(currentFileValue()).toBeUndefined();
+ expect(currentFileValue()).toBe("/tmp/rows.csv");
});
it("keeps the current file visible on the minimized floating indicator", async () => {