You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "wjddn279 (via GitHub)" <gi...@apache.org> on 2026/03/14 09:53:07 UTC

[PR] Fix newline rendering in DAG warning alert UI [airflow]

wjddn279 opened a new pull request, #63588:
URL: https://github.com/apache/airflow/pull/63588

   related: https://github.com/apache/airflow/pull/59430
   
   ### Description
   
   Fixes an issue where newlines (\n) in the message field of the DAG warning API were not being rendered as line breaks in the UI.
   
   ### UI
   
   #### ASIS
   <img width="858" height="105" alt="image" src="https://github.com/user-attachments/assets/dfa2c0d2-bb0e-4401-aa29-372c8a7d2d13" />
   
   #### TOBE
   <img width="855" height="169" alt="image" src="https://github.com/user-attachments/assets/9621a863-5f01-47a6-9eb0-3caf8b916985" />
   
    <!-- SPDX-License-Identifier: Apache-2.0
         https://www.apache.org/licenses/LICENSE-2.0 -->
   
   <!--
   Thank you for contributing!
   
   Please provide above a brief description of the changes made in this pull request.
   Write a good git commit message following this guide: http://chris.beams.io/posts/git-commit/
   
   Please make sure that your code changes are covered with tests.
   And in case of new features or big changes remember to adjust the documentation.
   
   Feel free to ping (in general) for the review if you do not see reaction for a few days
   (72 Hours is the minimum reaction time you can expect from volunteers) - we sometimes miss notifications.
   
   In case of an existing issue, reference it using one of the following:
   
   * closes: #ISSUE
   * related: #ISSUE
   -->
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   <!--
   If generative AI tooling has been used in the process of authoring this PR, please
   change below checkbox to `[X]` followed by the name of the tool, uncomment the "Generated-by".
   -->
   
   - [ ] Yes (please specify the tool below)
   
   <!--
   Generated-by: [Tool Name] following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   -->
   
   ---
   
   * Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)** for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
   * For fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   * When adding dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   * For significant user-facing changes create newsfragment: `{pr_number}.significant.rst`, in [airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments). You can add this file in a follow-up commit after the PR is created so you know the PR number.
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix newline rendering in DAG warning alert UI [airflow]

Posted by "wjddn279 (via GitHub)" <gi...@apache.org>.
wjddn279 commented on PR #63588:
URL: https://github.com/apache/airflow/pull/63588#issuecomment-4090290827

   @shivaam @pierrejeambrun 
   
   thanks for review and suggestion!! I've applied it!


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix newline rendering in DAG warning alert UI [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun merged PR #63588:
URL: https://github.com/apache/airflow/pull/63588


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix newline rendering in DAG warning alert UI [airflow]

Posted by "wjddn279 (via GitHub)" <gi...@apache.org>.
wjddn279 commented on code in PR #63588:
URL: https://github.com/apache/airflow/pull/63588#discussion_r2960272408


##########
airflow-core/src/airflow/ui/src/components/WarningAlert.tsx:
##########
@@ -33,7 +33,9 @@ export const WarningAlert = ({ warning }: Props) => {
 
   return (
     <Alert data-testid="warning-alert" status="warning">
-      <Flex align="center">{warning?.message}</Flex>
+      <Flex align="center" overflowWrap="break-word" whiteSpace="preserve">

Review Comment:
   done!



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix newline rendering in DAG warning alert UI [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #63588:
URL: https://github.com/apache/airflow/pull/63588#discussion_r2960228527


##########
airflow-core/src/airflow/ui/src/components/WarningAlert.tsx:
##########
@@ -33,7 +33,9 @@ export const WarningAlert = ({ warning }: Props) => {
 
   return (
     <Alert data-testid="warning-alert" status="warning">
-      <Flex align="center">{warning?.message}</Flex>
+      <Flex align="center" overflowWrap="break-word" whiteSpace="preserve">

Review Comment:
   `ErrorAlert` is using `wordBreak="break-all"` can you align please.
   
   ```suggestion
         <Flex align="center" whiteSpace="preserve" wordBreak="break-all">
   ```



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix newline rendering in DAG warning alert UI [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #63588:
URL: https://github.com/apache/airflow/pull/63588#discussion_r2954928660


##########
airflow-core/src/airflow/ui/src/components/WarningAlert.tsx:
##########
@@ -33,7 +33,9 @@ export const WarningAlert = ({ warning }: Props) => {
 
   return (
     <Alert data-testid="warning-alert" status="warning">
-      <Flex align="center">{warning?.message}</Flex>
+      <Flex align="center" whiteSpace="pre-wrap">

Review Comment:
   +1 for using the same `whiteSpace="preserve"`, and also add the wordBreak. I'm experiencing poor display if not breaking:
   
   <img width="1164" height="954" alt="Image" src="https://github.com/user-attachments/assets/b452abbd-5813-41e5-b9ea-d6026a724dd2" />



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix newline rendering in DAG warning alert UI [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #63588:
URL: https://github.com/apache/airflow/pull/63588#discussion_r2960228527


##########
airflow-core/src/airflow/ui/src/components/WarningAlert.tsx:
##########
@@ -33,7 +33,9 @@ export const WarningAlert = ({ warning }: Props) => {
 
   return (
     <Alert data-testid="warning-alert" status="warning">
-      <Flex align="center">{warning?.message}</Flex>
+      <Flex align="center" overflowWrap="break-word" whiteSpace="preserve">

Review Comment:
   `ErrorAlert` is using `wordBreak="break-all"` can you align please.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix newline rendering in DAG warning alert UI [airflow]

Posted by "shivaam (via GitHub)" <gi...@apache.org>.
shivaam commented on PR #63588:
URL: https://github.com/apache/airflow/pull/63588#issuecomment-4060584439

   Looks good to me overall


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix newline rendering in DAG warning alert UI [airflow]

Posted by "shivaam (via GitHub)" <gi...@apache.org>.
shivaam commented on code in PR #63588:
URL: https://github.com/apache/airflow/pull/63588#discussion_r2935313059


##########
airflow-core/src/airflow/ui/src/components/WarningAlert.tsx:
##########
@@ -33,7 +33,9 @@ export const WarningAlert = ({ warning }: Props) => {
 
   return (
     <Alert data-testid="warning-alert" status="warning">
-      <Flex align="center">{warning?.message}</Flex>
+      <Flex align="center" whiteSpace="pre-wrap">

Review Comment:
   Nit: ErrorAlert uses whiteSpace="preserve" with wordBreak, while this uses pre-wrap. 
   Both work, but might be worth aligning them for consistency since they render side by side in the same modal. 
   Not a blocker though.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix newline rendering in DAG warning alert UI [airflow]

Posted by "shivaam (via GitHub)" <gi...@apache.org>.
shivaam commented on code in PR #63588:
URL: https://github.com/apache/airflow/pull/63588#discussion_r2935313059


##########
airflow-core/src/airflow/ui/src/components/WarningAlert.tsx:
##########
@@ -33,7 +33,9 @@ export const WarningAlert = ({ warning }: Props) => {
 
   return (
     <Alert data-testid="warning-alert" status="warning">
-      <Flex align="center">{warning?.message}</Flex>
+      <Flex align="center" whiteSpace="pre-wrap">

Review Comment:
   Nit: ErrorAlert uses whiteSpace="preserve" with wordBreak, while this uses pre-wrap. 
   Both work, but might be worth aligning them for consistency since they render side by side in the same modal. They are both used together in the `DAGWarningsModal.tsx` file. 
   
   Not a blocker though.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org