From cb622a3dd671c840279f9408f430da703464d218 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Thu, 25 Jun 2026 22:35:17 -0700 Subject: [PATCH] Switching to create table from data tab no longer marks as dirty I was getting a confirm() dialog when I clicked outside the dialog on the create table from data page despite not having filled out any fields. --- datasette/static/edit-tools.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/datasette/static/edit-tools.js b/datasette/static/edit-tools.js index 859bac0f..12ddb842 100644 --- a/datasette/static/edit-tools.js +++ b/datasette/static/edit-tools.js @@ -855,17 +855,12 @@ function tableCreateDialogSignature(state) { return ""; } var signature = { - mode: state.mode || "manual", table: state.tableName.value, data: state.dataTextarea ? state.dataTextarea.value : "", dataPrimaryKey: state.dataPkSelect ? state.dataPkSelect.value : TABLE_CREATE_AUTOMATIC_PK, - }; - if (tableCreateIsDataMode(state)) { - signature.previewReady = !!state.dataPreviewReady; - } else { - signature.columns = tableCreateDialogRows(state).map(function (row) { + columns: tableCreateDialogRows(state).map(function (row) { return { name: row.querySelector(".table-create-column-name").value, type: row.querySelector(".table-create-column-type").value, @@ -886,8 +881,8 @@ function tableCreateDialogSignature(state) { } ).value || "", }; - }); - } + }), + }; return JSON.stringify(signature); }