You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "KatalKavya96 (via GitHub)" <gi...@apache.org> on 2025/09/24 22:24:17 UTC
[PR] UI: Add Expand/Collapse all to XComs page [airflow]
KatalKavya96 opened a new pull request, #56083:
URL: https://github.com/apache/airflow/pull/56083
UI: Restore “Expand/Collapse all” on XComs page
closes: #56061
### What’s changed
- Added Expand all / Collapse all controls to the XComs page toolbar, matching the Audit Logs page.
- Plumbed a boolean open state (via Chakra’s useDisclosure) into the XComs table and forwarded it to each row’s value renderer.
- Updated XComEntry to accept an optional open prop and pass collapsed: !open to RenderedJsonField so JSON objects/arrays expand or collapse globally.
- Kept scalar values rendering as plain text; added lightweight URL auto-linking for better readability.
### Rationale
- The Audit Logs page exposes a global expand/collapse control for JSON content, but XComs did not. This restores UI parity and improves usability when scanning large XCom payloads.
### Implementation notes
- No API or backend changes.
- Reused existing i18n keys from Audit Logs for button labels (auditLog.actions.expandAllExtra, auditLog.actions.collapseAllExtra).
- No changes to table sorting, pagination, or filters.
### Demo Video
https://github.com/user-attachments/assets/ef7273bd-2169-488a-88c0-2fc1d9f59043
--
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] UI: Add Expand/Collapse all to XComs page [airflow]
Posted by "KatalKavya96 (via GitHub)" <gi...@apache.org>.
KatalKavya96 commented on PR #56083:
URL: https://github.com/apache/airflow/pull/56083#issuecomment-3339905974
@RoyLee1224 Sure i will re apply all changes that are unrelated and removed. Thanks for the review
--
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] UI: Add Expand/Collapse all to XComs page [airflow]
Posted by "KatalKavya96 (via GitHub)" <gi...@apache.org>.
KatalKavya96 commented on PR #56083:
URL: https://github.com/apache/airflow/pull/56083#issuecomment-3355697678
Thanks a lot @bbovenzi , @pierrejeambrun , and @RoyLee1224 for reviewing and giving your time on this PR. Really appreciate the feedback and guidance that helped get this in smoothly.
--
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] UI: Add Expand/Collapse all to XComs page [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun merged PR #56083:
URL: https://github.com/apache/airflow/pull/56083
--
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] UI: Add Expand/Collapse all to XComs page [airflow]
Posted by "RoyLee1224 (via GitHub)" <gi...@apache.org>.
RoyLee1224 commented on code in PR #56083:
URL: https://github.com/apache/airflow/pull/56083#discussion_r2383126540
##########
airflow-core/src/airflow/ui/src/pages/XCom/XComEntry.tsx:
##########
Review Comment:
It seems there might be a few unrelated changes and refactors included as well. For example, the renderTextWithLinks function was reworked, and the clipboard button was removed.
To keep make it easier to review, would it be possible to scale it back to just the necessary changes for the new feature? Thanks!
##########
airflow-core/src/airflow/ui/src/pages/XCom/XComEntry.tsx:
##########
@@ -72,31 +87,22 @@ export const XComEntry = ({ dagId, mapIndex, runId, taskId, xcomKey }: XComEntry
taskId,
xcomKey,
});
- // When deserialize=true, the API returns a stringified representation
- // so we don't need to JSON.stringify it again
- const xcomValue = data?.value;
- const isObjectOrArray = Array.isArray(xcomValue) || (xcomValue !== null && typeof xcomValue === "object");
- const valueFormatted = typeof xcomValue === "string" ? xcomValue : JSON.stringify(xcomValue, undefined, 4);
- return isLoading ? (
- <Skeleton
- data-testid="skeleton"
- display="inline-block"
- height="10px"
- width={200} // TODO: Make Skeleton take style from column definition
- />
- ) : (
+ const value = data?.value;
+
+ const valueFormatted = value === undefined ? "" : typeof value === "string" ? value : JSON.stringify(value);
+
+ if (isLoading) {
+ return <Skeleton data-testid="skeleton" display="inline-block" height="10px" width={200} />;
+ }
+
+ return (
<HStack>
- {isObjectOrArray ? (
- <RenderedJsonField content={xcomValue as object} enableClipboard={false} />
+ {isObjectLike(value) ? (
+ <RenderedJsonField content={value} jsonProps={{ collapsed: !open }} />
) : (
<Text>{renderTextWithLinks(valueFormatted)}</Text>
)}
- {xcomValue === undefined || xcomValue === null ? undefined : (
Review Comment:
The copy-to-clipboard button seems to be missing for non-JSON/string values now.
<img width="1834" height="783" alt="CleanShot 2025-09-26 at 14 03 12" src="https://github.com/user-attachments/assets/ae6f3071-36f5-41d7-a172-326f76bb6e74" />
--
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] UI: Add Expand/Collapse all to XComs page [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #56083:
URL: https://github.com/apache/airflow/pull/56083#issuecomment-3355602125
### Backport successfully created: v3-1-test
<table>
<tr>
<th>Status</th>
<th>Branch</th>
<th>Result</th>
</tr>
<tr>
<td>✅</td>
<td>v3-1-test</td>
<td><a href="https://github.com/apache/airflow/pull/56285"><img src="https://img.shields.io/badge/PR-56285-blue" alt="PR Link"></a></td>
</tr>
</table>
--
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] UI: Add Expand/Collapse all to XComs page [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #56083:
URL: https://github.com/apache/airflow/pull/56083#discussion_r2389102675
##########
airflow-core/src/airflow/ui/src/pages/XCom/index.ts:
##########
@@ -18,3 +18,4 @@
*/
export { XCom } from "./XCom";
+export { XComEntry } from "./XComEntry";
Review Comment:
Don't think this is necessary
--
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