Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore(sql-editor): only show 1 line in result cell (#10012)

boojackc253248b6221
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/TableCell.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/TableCell.vue
index 08968bc134..cd6eee5767 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/TableCell.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/DataTable/TableCell.vue
@@ -3,8 +3,7 @@
<div class="relative px-2 py-1" :class="classes" @click="handleClick">
<div
ref="wrapperRef"
- class="overflow-hidden whitespace-pre font-mono"
- :class="valueContainerAdditionalClass"
+ class="whitespace-nowrap font-mono text-start line-clamp-1"
v-html="html"
></div>
<div v-if="clickable" class="absolute right-1 top-1/2 translate-y-[-45%]">
@@ -60,14 +59,6 @@ const database = computed(() => {
return useDatabaseV1Store().getDatabaseByUID(conn.databaseId);
});
-const valueContainerAdditionalClass = computed(() => {
- // Always only show the first line for MongoDB.
- if (database.value.instanceEntity.engine === Engine.MONGODB) {
- return "!whitespace-nowrap";
- }
- return "";
-});
-
const clickable = computed(() => {
if (truncated.value) return true;
if (database.value.instanceEntity.engine === Engine.MONGODB) {
diff --git a/frontend/src/views/sql-editor/EditorCommon/ResultView/DetailPanel.vue b/frontend/src/views/sql-editor/EditorCommon/ResultView/DetailPanel.vue
index d632d73d89..d67e628332 100644
--- a/frontend/src/views/sql-editor/EditorCommon/ResultView/DetailPanel.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/ResultView/DetailPanel.vue
@@ -1,7 +1,7 @@
<template>
<DrawerContent
:title="$t('common.detail')"
- class="w-[100vw-4rem] min-w-[20rem] max-w-[100vw-4rem] md:w-[33vw]"
+ class="w-[100vw-4rem] min-w-[24rem] max-w-[100vw-4rem] md:w-[33vw]"
>
<div
class="h-full flex flex-col gap-y-2"
@@ -56,19 +56,17 @@
</div>
<div>
- <NButton
- v-if="!disallowCopyingData"
- size="small"
- type="primary"
- @click="handleCopy"
- >
+ <NButton v-if="!disallowCopyingData" size="small" @click="handleCopy">
+ <template #icon>
+ <ClipboardIcon class="w-4 h-4" />
+ </template>
{{ $t("common.copy") }}
</NButton>
</div>
</div>
<!-- eslint-disable vue/no-v-html -->
<div
- class="flex-1 overflow-auto whitespace-pre-wrap text-sm"
+ class="flex-1 overflow-auto whitespace-pre-wrap text-sm font-mono border p-2"
:class="disallowCopyingData && 'select-none'"
v-html="html"
></div>
@@ -79,7 +77,7 @@
<script setup lang="ts">
import { onKeyStroke, useClipboard } from "@vueuse/core";
import { escape, get } from "lodash-es";
-import { ChevronDownIcon, ChevronUpIcon } from "lucide-vue-next";
+import { ChevronDownIcon, ChevronUpIcon, ClipboardIcon } from "lucide-vue-next";
import { NButton, NTooltip } from "naive-ui";
import { computed } from "vue";
import { useI18n } from "vue-i18n";