From f5474ff79198a2f5a145d0a9df1bb651ea677ec5 Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Thu, 19 Sep 2024 08:43:09 -0400 Subject: [PATCH] perf(editor): Use virtual scrolling in `RunDataJson.vue` (#10838) --- .../editor-ui/src/components/RunDataJson.vue | 15 +- .../components/__tests__/RunDataJson.test.ts | 28 +- .../__snapshots__/RunDataJson.test.ts.snap | 1575 +++++++++-------- 3 files changed, 823 insertions(+), 795 deletions(-) diff --git a/packages/editor-ui/src/components/RunDataJson.vue b/packages/editor-ui/src/components/RunDataJson.vue index ae8945cdd0..ab7c2a2706 100644 --- a/packages/editor-ui/src/components/RunDataJson.vue +++ b/packages/editor-ui/src/components/RunDataJson.vue @@ -14,6 +14,7 @@ import { nonExistingJsonPath } from '@/constants'; import { useExternalHooks } from '@/composables/useExternalHooks'; import TextWithHighlights from './TextWithHighlights.vue'; import { useTelemetry } from '@/composables/useTelemetry'; +import { useElementSize } from '@vueuse/core'; const LazyRunDataJsonActions = defineAsyncComponent( async () => await import('@/components/RunDataJsonActions.vue'), @@ -45,6 +46,9 @@ const telemetry = useTelemetry(); const selectedJsonPath = ref(nonExistingJsonPath); const draggingPath = ref(null); const displayMode = ref('json'); +const jsonDataContainer = ref(null); + +const { height } = useElementSize(jsonDataContainer); const jsonData = computed(() => executionDataToJson(props.inputData)); @@ -110,7 +114,7 @@ const getListItemName = (path: string) => {