diff --git a/changelog/entries/unreleased/bug/data_source_context_was_not_reset_after_a_data_source_creati.json b/changelog/entries/unreleased/bug/data_source_context_was_not_reset_after_a_data_source_creati.json
new file mode 100644
index 0000000000..5feb7c3569
--- /dev/null
+++ b/changelog/entries/unreleased/bug/data_source_context_was_not_reset_after_a_data_source_creati.json
@@ -0,0 +1,9 @@
+{
+ "type": "bug",
+ "message": "Data source context was not reset after a data source creation",
+ "issue_origin": "github",
+ "issue_number": null,
+ "domain": "builder",
+ "bullet_points": [],
+ "created_at": "2026-03-04"
+}
\ No newline at end of file
diff --git a/changelog/entries/unreleased/bug/resolved_an_issue_which_caused_ai_field_formulas_to_appear_t.json b/changelog/entries/unreleased/bug/resolved_an_issue_which_caused_ai_field_formulas_to_appear_t.json
new file mode 100644
index 0000000000..765437189d
--- /dev/null
+++ b/changelog/entries/unreleased/bug/resolved_an_issue_which_caused_ai_field_formulas_to_appear_t.json
@@ -0,0 +1,9 @@
+{
+ "type": "bug",
+ "message": "Resolved an issue which caused AI field formulas to appear twice in the UI.",
+ "issue_origin": "github",
+ "issue_number": null,
+ "domain": "database",
+ "bullet_points": [],
+ "created_at": "2026-03-18"
+}
\ No newline at end of file
diff --git a/premium/web-frontend/modules/baserow_premium/components/views/form/FormViewModePreviewSurvey.vue b/premium/web-frontend/modules/baserow_premium/components/views/form/FormViewModePreviewSurvey.vue
index 59cb4e6075..22e4725966 100644
--- a/premium/web-frontend/modules/baserow_premium/components/views/form/FormViewModePreviewSurvey.vue
+++ b/premium/web-frontend/modules/baserow_premium/components/views/form/FormViewModePreviewSurvey.vue
@@ -55,8 +55,9 @@
type="primary"
size="large"
@click="next()"
- >Next
+ {{ $t('action.next') }}
+
-
+
{{
create
@@ -19,7 +19,7 @@
:data-source="dataSource"
:builder="builder"
:page="dataSourcePage"
- :default-values="dataSource"
+ :default-values="currentDefaultValues"
:integrations="integrations"
:create="create"
:application-context-additions="{
@@ -77,18 +77,18 @@ export default {
props: {
dataSourceId: { type: Number, required: false, default: null },
},
- emits: ['updated'],
+ emits: ['updated', 'data-source-created'],
data() {
return {
loading: false,
- actualDataSourceId: this.dataSourceId,
changed: false,
+ currentDefaultValues: {},
}
},
computed: {
submitIsDisabled() {
return (
- this.loading || !this.changed || this.$refs.dataSourceForm?.v$.$anyError
+ this.loading || !this.changed || this.$refs.dataSourceForm.v$.$anyError
)
},
dataSources() {
@@ -108,7 +108,7 @@ export default {
return [...this.dataSources, ...this.sharedDataSources]
},
create() {
- return !this.actualDataSourceId
+ return !this.dataSourceId
},
isShared() {
return !this.create && this.dataSource?.page_id === this.sharedPage.id
@@ -117,9 +117,7 @@ export default {
if (this.create) {
return undefined
}
- return this.allDataSources.find(
- ({ id }) => id === this.actualDataSourceId
- )
+ return this.allDataSources.find(({ id }) => id === this.dataSourceId)
},
integrations() {
return this.$store.getters['integration/getIntegrations'](this.builder)
@@ -143,14 +141,22 @@ export default {
]
},
},
+ watch: {
+ dataSource(newValue) {
+ this.currentDefaultValues = { ...this.dataSource }
+ },
+ },
methods: {
...mapActions({
actionFetchIntegrations: 'integration/fetch',
actionCreateDataSource: 'dataSource/create',
actionUpdateDataSource: 'dataSource/update',
}),
+ onShow() {
+ this.currentDefaultValues = { ...this.dataSource }
+ },
onValuesChanged(values) {
- if (!this.actualDataSourceId) {
+ if (!this.dataSourceId) {
this.changed = true
return
}
@@ -159,6 +165,10 @@ export default {
)
if (differences.length) {
+ this.currentDefaultValues = {
+ ...this.currentDefaultValues,
+ ...Object.fromEntries(differences),
+ }
this.changed = true
}
},
@@ -172,7 +182,7 @@ export default {
page: this.currentPage,
values,
})
- this.actualDataSourceId = createdDataSource.id
+ this.$emit('data-source-created', createdDataSource)
} else {
const differences = Object.fromEntries(
Object.entries(values).filter(
diff --git a/web-frontend/modules/builder/components/page/header/DataSourceContext.vue b/web-frontend/modules/builder/components/page/header/DataSourceContext.vue
index e82d1054c2..e16e436da2 100644
--- a/web-frontend/modules/builder/components/page/header/DataSourceContext.vue
+++ b/web-frontend/modules/builder/components/page/header/DataSourceContext.vue
@@ -112,9 +112,9 @@
diff --git a/web-frontend/modules/core/components/formula/FormulaInputField.vue b/web-frontend/modules/core/components/formula/FormulaInputField.vue
index 07751895fe..5d87731f32 100644
--- a/web-frontend/modules/core/components/formula/FormulaInputField.vue
+++ b/web-frontend/modules/core/components/formula/FormulaInputField.vue
@@ -165,6 +165,7 @@ export default {
hoveredFunctionNode: null,
isHandlingModeChange: false,
intersectionObserver: null,
+ isEditorInitialized: false,
}
},
computed: {
@@ -348,6 +349,11 @@ export default {
},
mode(newMode, oldMode) {
+ // In Vue 3, watchers can fire during the initial render cycle before
+ // mounted() completes. Skip if editor hasn't been initialized yet.
+ if (!this.isEditorInitialized) {
+ return
+ }
// Skip automatic recreation if we're handling it manually in handleModeChange
if (this.isHandlingModeChange) {
return
@@ -437,6 +443,7 @@ export default {
}),
},
})
+ this.isEditorInitialized = true
},
recreateEditor(formula = null) {
const currentFormula =
diff --git a/web-frontend/modules/integrations/localBaserow/components/services/LocalBaserowServiceForm.vue b/web-frontend/modules/integrations/localBaserow/components/services/LocalBaserowServiceForm.vue
index c03046a035..927d72835e 100644
--- a/web-frontend/modules/integrations/localBaserow/components/services/LocalBaserowServiceForm.vue
+++ b/web-frontend/modules/integrations/localBaserow/components/services/LocalBaserowServiceForm.vue
@@ -146,7 +146,7 @@ export default {
)
},
databases() {
- return this.selectedIntegration?.context_data.databases || []
+ return this.selectedIntegration?.context_data?.databases || []
},
},
watch: {