diff --git a/apps/desktop/src/components/import/TableImportDialog.vue b/apps/desktop/src/components/import/TableImportDialog.vue index 0f05ccee26..ceed827515 100644 --- a/apps/desktop/src/components/import/TableImportDialog.vue +++ b/apps/desktop/src/components/import/TableImportDialog.vue @@ -102,6 +102,7 @@ const progressPercent = computed(() => { if (!p || p.totalRows <= 0) return 0; return Math.min(100, Math.round((p.rowsImported / p.totalRows) * 100)); }); +const currentStepIndex = computed(() => wizardSteps.findIndex((step) => step.value === wizardStep.value)); const targetLabel = computed(() => { const pieces = [selectedConnection.value?.name, props.prefillDatabase, props.prefillSchema, props.prefillTable].filter(Boolean); return pieces.join(" / "); @@ -269,6 +270,34 @@ function canOpenStep(step: TableImportWizardStep) { return false; } +function wizardStepIndex(step: TableImportWizardStep) { + return wizardSteps.findIndex((item) => item.value === step); +} + +function isWizardStepActive(step: TableImportWizardStep) { + return step === wizardStep.value; +} + +function isWizardStepComplete(step: TableImportWizardStep) { + return wizardStepIndex(step) < currentStepIndex.value; +} + +function wizardStepConnectorClass(index: number, leading: boolean) { + return (leading ? index <= currentStepIndex.value : index < currentStepIndex.value) ? "bg-primary/60" : "bg-border"; +} + +function wizardStepTextClass(step: TableImportWizardStep) { + if (isWizardStepActive(step)) return "text-foreground"; + if (isWizardStepComplete(step)) return "text-foreground hover:bg-muted/40"; + return "text-muted-foreground"; +} + +function wizardStepCircleClass(step: TableImportWizardStep) { + if (isWizardStepActive(step)) return "border-primary bg-primary text-primary-foreground shadow-sm"; + if (isWizardStepComplete(step)) return "border-primary/70 bg-background text-primary"; + return "border-border bg-background text-muted-foreground"; +} + async function goNext() { if (wizardStep.value === "options" && !preview.value) { await loadPreview(); @@ -361,8 +390,8 @@ watch([sourceFormat, delimiter, hasHeader, trimValues, emptyStringAsNull, select