fix Preserve variable value formatting in edit dialog#58757
Merged
Lee-W merged 3 commits intoapache:mainfrom Nov 29, 2025
Merged
fix Preserve variable value formatting in edit dialog#58757Lee-W merged 3 commits intoapache:mainfrom
Lee-W merged 3 commits intoapache:mainfrom
Conversation
) When editing variables in the UI, JSON values are now displayed with proper formatting (indentation and line breaks) instead of being shown as minified single-line strings. This restores the behavior from Airflow 2.x where variable values were displayed with their original formatting. Fixes apache#58648
Lee-W
approved these changes
Nov 27, 2025
Member
Lee-W
left a comment
There was a problem hiding this comment.
I'm good with this change but would be nice if we can have frontend expert take a look. Thanks!
choo121600
reviewed
Nov 27, 2025
airflow-core/src/airflow/ui/src/pages/Variables/ManageVariable/EditVariableButton.tsx
Outdated
Show resolved
Hide resolved
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Contributor
Author
|
Thanks @Lee-W for the review and merge. |
RoyLee1224
pushed a commit
to RoyLee1224/airflow
that referenced
this pull request
Dec 3, 2025
itayweb
pushed a commit
to itayweb/airflow
that referenced
this pull request
Dec 6, 2025
|
Hi, Is this addressed in PR for Apache Airflow 3.2? It's a significant update from a developer UX perspective |
Lee-W
pushed a commit
to astronomer/airflow
that referenced
this pull request
Feb 23, 2026
(cherry picked from commit f697a0b)
Lee-W
pushed a commit
to astronomer/airflow
that referenced
this pull request
Feb 23, 2026
…ache#58757) (cherry picked from commit f697a0b) Co-authored-by: RickyChen / 陳昭儒 <109416633+rickychen-infinirc@users.noreply.github.com>
Lee-W
pushed a commit
to astronomer/airflow
that referenced
this pull request
Feb 23, 2026
Member
|
looks like a valid backport. just create a backport PR here #62339 |
Lee-W
added a commit
that referenced
this pull request
Feb 23, 2026
Subham-KRLX
pushed a commit
to Subham-KRLX/airflow
that referenced
this pull request
Mar 4, 2026
vatsrahul1001
pushed a commit
that referenced
this pull request
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes the variable editor to preserve JSON formatting when editing variables in the Airflow UI.
Problem:
In Airflow 3.x, variable values are displayed as minified single-line strings in the edit dialog, making it difficult to read and edit structured data like JSON and YAML.
Solution:
Added a
formatValuefunction inEditVariableButton.tsxthat formats JSON values with proper indentation (2 spaces) when the edit dialog is opened. Non-JSON values are preserved as-is.Changes:
EditVariableButton.tsxto addformatValuefunctionJSON.stringify(parsed, null, 2)Testing:
Screenshots:
Before:

Value field shows:
{"key": "val", "key2": "val2"}After:
Value field shows:
Related Issue(s):
Closes #58648