bbovenzi commented on code in PR #71156:
URL: https://github.com/apache/airflow/pull/71156#discussion_r3723259376


##########
airflow-core/src/airflow/ui/src/queries/useLogs.tsx:
##########
@@ -36,10 +41,47 @@ import { parseStreamingLogContent } from "src/utils/logs";
 
 export type ParsedLogEntry = {
   element: JSX.Element | string | undefined;
+  getPlainText?: () => string;
   group?: { id: number; level: number; parentId?: number; type: "header" | 
"line" };
   lineNumber?: number;
 };
 
+type GetLogLineTextOptions = {
+  logLevelFilters?: Array<string>;
+  logMessage: string | StructuredLogMessage;
+  showSource?: boolean;
+  showTimestamp?: boolean;
+  sourceFilters?: Array<string>;
+  translate: TFunction;
+};
+
+/**
+ * Plain-text rendering of a single log line — same pipeline as the log
+ * download, with ANSI escape codes stripped. Used to rebuild copied text for
+ * selected rows the virtualizer has unmounted.
+ */
+export const getLogLineText = ({
+  logLevelFilters,
+  logMessage,
+  showSource,
+  showTimestamp,
+  sourceFilters,
+  translate,
+}: GetLogLineTextOptions): string =>
+  Anser.ansiToText(
+    renderStructuredLog({
+      index: 0,
+      logLevelFilters,
+      logLink: "",
+      logMessage,
+      renderingMode: "text",

Review Comment:
   We are mixing selecting by renderingMode. In order for that to work best, we 
will need to harmonize the two modes more such as the timestamp format and any 
additional elements we add like group header ▶ 



-- 
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]

Reply via email to