diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue index c333da46f..7ca6d20b5 100644 --- a/apps/desktop/src/components/grid/DataGrid.vue +++ b/apps/desktop/src/components/grid/DataGrid.vue @@ -3562,6 +3562,16 @@ const editorThemeAccessor = () => settingsStore.editorSettings.theme; const editorAppAppearance = () => (isDark.value ? "dark" : "light") as import("@/lib/appTheme").AppThemeAppearance; const editorFontSize = () => settingsStore.editorSettings.fontSize; const editorFontFamily = () => settingsStore.editorSettings.fontFamily; +const SIDE_DETAIL_EDITOR_MIN_HEIGHT = 160; +const SIDE_DETAIL_EDITOR_MAX_HEIGHT = 360; +const SIDE_DETAIL_EDITOR_LINE_HEIGHT = 20; +const SIDE_DETAIL_EDITOR_SOFT_WRAP_CHARS = 48; +const sideDetailEditorStyle = computed(() => { + if (cellDetailPanelIsBottom.value) return undefined; + const lines = detailEditValue.value.split(/\r\n|\r|\n/).reduce((total, line) => total + Math.max(1, Math.ceil(line.length / SIDE_DETAIL_EDITOR_SOFT_WRAP_CHARS)), 0); + const height = Math.min(SIDE_DETAIL_EDITOR_MAX_HEIGHT, Math.max(SIDE_DETAIL_EDITOR_MIN_HEIGHT, lines * SIDE_DETAIL_EDITOR_LINE_HEIGHT + 28)); + return { height: `${height}px` }; +}); function getDetailEditor(): UseCellDetailEditorReturn | null { return activeCellDetailTab.value === "valueEditor" ? valueDetailEditor : detailsDetailEditor; @@ -7936,7 +7946,7 @@ const gridContextMenuItems = computed(() => {