From 0099e1a262cf208f3d58506dc254fc5ac96ff54f Mon Sep 17 00:00:00 2001 From: skyler <1156263951@qq.com> Date: Fri, 15 May 2026 16:46:54 +0800 Subject: [PATCH] feat(ai): add table mentions Add table mentions to AI context, Ask/Agent mode selection, and related UI/i18n fixes. --- src/components/editor/AiAssistant.vue | 347 +++++++++++++++++++++++++- src/components/grid/DataGrid.vue | 278 +++++++++++++++++++-- src/components/layout/ContentArea.vue | 4 +- src/composables/useDataGridEditor.ts | 32 ++- src/i18n/locales/en.ts | 27 +- src/i18n/locales/es.ts | 4 +- src/i18n/locales/zh-CN.ts | 27 +- src/lib/ai.ts | 70 +++++- src/lib/aiTableMentions.ts | 103 ++++++++ src/lib/dataGridSql.ts | 61 +++++ tests/aiTableMentions.test.ts | 28 +++ tests/dataGridEditor.test.ts | 162 ++++++++++++ tests/dataGridSql.test.ts | 56 +++++ 13 files changed, 1150 insertions(+), 49 deletions(-) create mode 100644 src/lib/aiTableMentions.ts create mode 100644 tests/aiTableMentions.test.ts create mode 100644 tests/dataGridEditor.test.ts diff --git a/src/components/editor/AiAssistant.vue b/src/components/editor/AiAssistant.vue index 2585b80792..7f0ab159f1 100644 --- a/src/components/editor/AiAssistant.vue +++ b/src/components/editor/AiAssistant.vue @@ -1,5 +1,5 @@ @@ -2581,9 +2706,9 @@ defineExpose({ - +
| {{ t("grid.columnName") }} | +{{ t("grid.columnType") }} | +{{ t("grid.tableInfoNullable") }} | +
|---|---|---|
|
+
+
+ {{ column.comment }}
+
+ |
+ {{ column.data_type }} | +{{ column.is_nullable ? "YES" : "NO" }} | +