guan404ming commented on code in PR #50746:
URL: https://github.com/apache/airflow/pull/50746#discussion_r2106251118
##########
airflow-core/src/airflow/ui/src/pages/TaskInstance/Logs/TaskLogContent.tsx:
##########
@@ -17,22 +17,39 @@
* under the License.
*/
import { Box, Code, VStack, useToken } from "@chakra-ui/react";
-import type { ReactNode } from "react";
-import { useLayoutEffect } from "react";
+import { useVirtualizer } from "@tanstack/react-virtual";
+import { useLayoutEffect, useRef } from "react";
import { ErrorAlert } from "src/components/ErrorAlert";
import { ProgressBar } from "src/components/ui";
+const EMPTY_ARRAY: Array<JSX.Element | string | undefined> = [];
+
type Props = {
readonly error: unknown;
+ readonly height?: number | string;
readonly isLoading: boolean;
readonly logError: unknown;
- readonly parsedLogs: ReactNode;
+ readonly parsedLogs: Array<JSX.Element | string | undefined> | undefined;
readonly wrap: boolean;
};
-export const TaskLogContent = ({ error, isLoading, logError, parsedLogs, wrap
}: Props) => {
+export const TaskLogContent = ({
+ error,
+ height = "600px",
+ isLoading,
+ logError,
+ parsedLogs = EMPTY_ARRAY,
+ wrap,
+}: Props) => {
const [bgLine] = useToken("colors", ["blue.emphasized"]);
+ const parentRef = useRef(null);
+ const rowVirtualizer = useVirtualizer({
+ count: parsedLogs.length,
+ estimateSize: () => 20,
Review Comment:
Here is the video of `TaskTogPreview`. It seems work well for the preview
https://github.com/user-attachments/assets/00de8c00-6331-452b-9afb-4c7f1b074d30
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]