From ee08f356e9a8f37cd96ca9b350a55b77a496d234 Mon Sep 17 00:00:00 2001 From: ptma Date: Thu, 13 Aug 2026 11:40:22 +0800 Subject: [PATCH] feat(grid): flatten multiline cell text --- .../editor/EditorSettingsDialog.vue | 16 +++++++++ apps/desktop/src/components/grid/DataGrid.vue | 11 +++--- apps/desktop/src/i18n/locales/en.ts | 2 ++ apps/desktop/src/i18n/locales/es.ts | 2 ++ apps/desktop/src/i18n/locales/it.ts | 2 ++ apps/desktop/src/i18n/locales/ja.ts | 2 ++ apps/desktop/src/i18n/locales/ko.ts | 2 ++ apps/desktop/src/i18n/locales/pt-BR.ts | 2 ++ apps/desktop/src/i18n/locales/zh-CN.ts | 2 ++ apps/desktop/src/i18n/locales/zh-TW.ts | 2 ++ .../lib/__tests__/dataGrid/cellValue.spec.ts | 36 +++++++++++++------ .../dataGrid/dataGridRuntime.spec.ts | 4 +++ .../lib/dataGrid/canvasDataGridRenderer.ts | 4 ++- apps/desktop/src/lib/dataGrid/cellValue.ts | 34 ++++++++++-------- .../src/lib/settings/editorSettingsDraft.ts | 1 + .../src/lib/settings/settingsSearch.ts | 1 + apps/desktop/src/stores/settingsStore.ts | 4 +++ 17 files changed, 97 insertions(+), 30 deletions(-) diff --git a/apps/desktop/src/components/editor/EditorSettingsDialog.vue b/apps/desktop/src/components/editor/EditorSettingsDialog.vue index 06badb6fd7..eebe1aee64 100644 --- a/apps/desktop/src/components/editor/EditorSettingsDialog.vue +++ b/apps/desktop/src/components/editor/EditorSettingsDialog.vue @@ -321,6 +321,7 @@ const editQueryResultMaxRows = ref(settingsStore.editorSettings.queryResultMaxRo const editInfiniteScroll = ref(settingsStore.editorSettings.infiniteScroll); const editRegexMaxMatchCount = ref(settingsStore.editorSettings.regexMaxMatchCount); const editAutoCalculateTotalRows = ref(settingsStore.editorSettings.autoCalculateTotalRows); +const editFlatteningMultiLineText = ref(settingsStore.editorSettings.flatteningMultiLineText); const editTableColumnTemplateRows = ref(tableColumnTemplateRowsFromSettings(settingsStore.editorSettings.tableColumnTemplateFields)); const editTableColumnTemplateDatabaseType = ref(TABLE_COLUMN_TEMPLATE_DATABASE_TYPES[0] ?? "mysql"); const editSqlVariableSyntaxOverrides = ref(normalizeSqlVariableSyntaxOverrides(settingsStore.editorSettings.sqlVariableSyntaxOverrides)); @@ -488,6 +489,7 @@ function currentEditorSettingsDraft(): EditorSettingsDraft { compactColumnHeaderActions: editCompactColumnHeaderActions.value, dataGridQuickEntry: editDataGridQuickEntry.value, dataGridAutoTransposeSingleRow: editDataGridAutoTransposeSingleRow.value, + flatteningMultiLineText: editFlatteningMultiLineText.value, pageSize: editPageSize.value, tableOpenPageSize: editTableOpenPageSize.value, queryResultMaxRowsEnabled: editQueryResultMaxRowsEnabled.value, @@ -761,6 +763,7 @@ function syncEditorSettingsDraftFromStore() { editCompactColumnHeaderActions.value = settingsStore.editorSettings.compactColumnHeaderActions; editDataGridQuickEntry.value = settingsStore.editorSettings.dataGridQuickEntry; editDataGridAutoTransposeSingleRow.value = settingsStore.editorSettings.dataGridAutoTransposeSingleRow; + editFlatteningMultiLineText.value = settingsStore.editorSettings.flatteningMultiLineText; editPageSize.value = settingsStore.editorSettings.pageSize; editTableOpenPageSize.value = settingsStore.editorSettings.tableOpenPageSize; editQueryResultMaxRowsEnabled.value = settingsStore.editorSettings.queryResultMaxRowsEnabled; @@ -1006,6 +1009,7 @@ function resetDefaultsForTab(tab: SettingsCategory) { editCompactColumnHeaderActions.value = DEFAULT_EDITOR_SETTINGS.compactColumnHeaderActions; editDataGridQuickEntry.value = DEFAULT_EDITOR_SETTINGS.dataGridQuickEntry; editDataGridAutoTransposeSingleRow.value = DEFAULT_EDITOR_SETTINGS.dataGridAutoTransposeSingleRow; + editFlatteningMultiLineText.value = DEFAULT_EDITOR_SETTINGS.flatteningMultiLineText; editPageSize.value = DEFAULT_EDITOR_SETTINGS.pageSize; editTableOpenPageSize.value = DEFAULT_EDITOR_SETTINGS.tableOpenPageSize; editQueryResultMaxRowsEnabled.value = DEFAULT_EDITOR_SETTINGS.queryResultMaxRowsEnabled; @@ -1074,6 +1078,7 @@ function resetAllDefaults() { editCompactColumnHeaderActions.value = DEFAULT_EDITOR_SETTINGS.compactColumnHeaderActions; editDataGridQuickEntry.value = DEFAULT_EDITOR_SETTINGS.dataGridQuickEntry; editDataGridAutoTransposeSingleRow.value = DEFAULT_EDITOR_SETTINGS.dataGridAutoTransposeSingleRow; + editFlatteningMultiLineText.value = DEFAULT_EDITOR_SETTINGS.flatteningMultiLineText; editPageSize.value = DEFAULT_EDITOR_SETTINGS.pageSize; editTableOpenPageSize.value = DEFAULT_EDITOR_SETTINGS.tableOpenPageSize; editQueryResultMaxRowsEnabled.value = DEFAULT_EDITOR_SETTINGS.queryResultMaxRowsEnabled; @@ -4877,6 +4882,17 @@ onUnmounted(() => { +
+
+ +

+ {{ t("settings.flatteningMultiLineTextDescription") }} +

+
+ +