diff --git a/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/TextValue/TextValueTruncatedMessage.tsx b/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/TextValue/TextValueTruncatedMessage.tsx index 6ed479d0de..ff934e1319 100644 --- a/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/TextValue/TextValueTruncatedMessage.tsx +++ b/webapp/packages/plugin-data-viewer/src/ValuePanelPresentation/TextValue/TextValueTruncatedMessage.tsx @@ -21,6 +21,8 @@ import type { IDatabaseResultSet } from '../../DatabaseDataModel/IDatabaseResult import { QuotaPlaceholder } from '../QuotaPlaceholder'; import { MAX_BLOB_PREVIEW_SIZE } from './MAX_BLOB_PREVIEW_SIZE'; +const MAX_TEXT_CONTENT_SIZE = 1 * 1048576; + interface Props { resultIndex: number; model: IDatabaseDataModel; @@ -44,9 +46,8 @@ export const TextValueTruncatedMessage = observer(function TextValueTrunc return null; } const isTextColumn = formatAction.isText(elementKey); - - const valueSize = - isResultSetContentValue(contentValue) && isNotNullDefined(contentValue.contentLength) ? bytesToSize(contentValue.contentLength) : undefined; + const valueSize = isResultSetContentValue(contentValue) && isNotNullDefined(contentValue.contentLength) ? contentValue.contentLength : undefined; + const canShowMore = valueSize ? valueSize <= MAX_TEXT_CONTENT_SIZE : true; async function pasteFullText() { try { @@ -58,10 +59,11 @@ export const TextValueTruncatedMessage = observer(function TextValueTrunc return ( - {isTextColumn && ( + {isTextColumn && canShowMore && ( )}