{{ targetLabel || t("editor.noDatabase") }}
@@ -504,6 +517,7 @@ watch(
v-for="(column, index) in columns"
:key="column.id"
:class="column.markedForDrop ? 'bg-destructive/5 opacity-60' : ''"
+ :data-new-column-row="!column.original ? 'true' : undefined"
>
@@ -516,6 +530,7 @@ watch(
v-model="column.name"
class="h-6 min-w-28 text-[11px]"
:disabled="isColumnNameDisabled(column)"
+ data-column-name-input
/>
|
diff --git a/packages/app-tests/tableStructureEditorPresentation.test.ts b/packages/app-tests/tableStructureEditorPresentation.test.ts
index f977b7ec71..55947217bf 100644
--- a/packages/app-tests/tableStructureEditorPresentation.test.ts
+++ b/packages/app-tests/tableStructureEditorPresentation.test.ts
@@ -70,3 +70,13 @@ test("structure editor keeps the table body vertically scrollable", () => {
assert.match(source, /class="flex h-full min-h-0 flex-col"/);
assert.match(source, //);
});
+
+test("new column input is focused after adding a field", () => {
+ assert.match(source, /import \{ computed, nextTick, onMounted, ref, watch \} from "vue"/);
+ assert.match(source, /async function addColumn/);
+ assert.match(source, /activeTab\.value = "columns"/);
+ assert.match(source, /await nextTick\(\)/);
+ assert.match(source, /data-new-column-row="true"/);
+ assert.match(source, /data-column-name-input/);
+ assert.match(source, /input\?\.focus\(\)/);
+});
|