feat(ui/logs)_#47619: add toggle for log grouping#51146
feat(ui/logs)_#47619: add toggle for log grouping#51146pierrejeambrun merged 9 commits intoapache:mainfrom
Conversation
jscheffl
left a comment
There was a problem hiding this comment.
Looks good for me. Would propose to merge once the small nit is resolved.
airflow-core/src/airflow/ui/src/pages/TaskInstance/Logs/TaskLogHeader.tsx
Outdated
Show resolved
Hide resolved
|
Closes #47619 Looks like we have a merge conflict too |
|
Functionality-wise. I am wondering if a "Expand/Collapse All" would be better than flattening the logs? I feel that if the logs have groups, we should respect that rather than possibly remove important information. |
|
I’d like to apologize for the incorrect merge I made earlier. I realize it may have caused confusion or disrupted the workflow. |
294263e to
65373d7
Compare
pierrejeambrun
left a comment
There was a problem hiding this comment.
Nice PR thanks, just a few comments in addition to other things mentioned by Brent and Jens.
Looking good and working as expected.
There was a problem hiding this comment.
beside @guan404ming small suggestions, It's almost ready, it would be great if you could also fix the last remaining test @davidfgcorreia so we can merge this :), thanks for your work.
|
Hi, I'm having some trouble running the UI tests. I'm following the instructions in the runner and using pnpm test, but when I try to render a component like this: <AppWrapper initialEntries={["/dags/log_grouping/runs/manual__2025-02-18T12:19/tasks/generate"]} /> I'm not getting the expected mocks. instead, I get a fetch error: stderr | Fetch.onError (file:/root/documentos/PIC/airflow/airflow-core/src/airflow/ui/node_modules/.pnpm/happy-dom@17.4.6/node_modules/happy-dom/src/fetch/Fetch.ts:668:37) It seems like the tests are trying to make a real network request instead of using mocks. Any idea what might be causing this or how I can properly mock the backend for this route? Thanks in advance! |
|
Hi, thanks for bringing this up. This is actually expected behavior. During testing, a few unnecessary requests may still be triggered. However, they have already been bypassed in the setup and should not interfere with the tests. The bypass logic is handled in Feel free to ask more if there is anything need clarification. |
|
Hi, thanks for the clarification! That makes sense good to know the unnecessary requests are already being bypassed in the setup. However, I’m still running into an issue after rebasing. When I try to run the frontend tests, I get the following error: Error: Failed to resolve import "i18next-http-backend" from "src/i18n/config.ts". Does the file exist? Do you have any idea what might be causing this? It seems like the module isn't being resolved correctly after the rebase. Thanks again! |
|
'i18next-http-backend' is likely missing in your node modules. How are you trying to run the UI. Did you refreshed the dependencies (yarn install). |
- Add button in header to enable or disable log grouping - Allow logs to be shown linearly or grouped - Adjust group offset and display Co-authored-by: Francisco Núncio <francisco.nuncio@tecnico.ulisboa.pt>
- Add expand/collapse all functionality for log groups using the "expanded" prop - Ensure initial logs state is collapsed and button shows "Expand All" - Add keyboard shortcut (E) to toggle expand/collapse all log groups - Unify button styles with black background and consistent padding/hover
-Rebase - Refactor TaskLogHeader to use a ButtonGroup with IconButton for expand/collapse, matching the style and behavior of ToggleGroups in the grid view - Warnings on precomit but not on the file i changed
…, and rebase - Added "expand" section with tooltip, expand, and collapse strings to all locale JSON files - Fixed requested issues in the UI related to expand/collapse controls - Performed rebase to update branch with latest changes
|
Thanks! You're right . I hadn't run yarn install after the rebase. Just did it now and that fixed the issue. Appreciate the quick help! |
|
Now I’m hitting another problem when the pre-commit runs. It seems to fail during the TypeScript check with the following error: src/pages/Error.tsx:45:29 - error TS2339: Property 'env' does not exist on type 'ImportMeta'. 45 const isDev = import.meta.env.DEV; Let me know if this is something I should fix on my end or if the pre-commit script needs an adjustment. |
|
We need to add I don't know why this is an issue suddenly |
|
Should I still go ahead and push the changes, even with this error. |
|
You can add the line to the file and push, it will silence the error. (I have updated my previous message, I didn't realize that markdown formatting was messing up what I wrote) |
|
Ok, I’ll take care of that and push the change. |
…18n, and update environment typings Updated log header UI (TaskLogHeader.tsx) to use i18n for expand/collapse/fullscreen tooltips and aria-labels. Fixed and improved expand/collapse controls and tooltips in the UI for accessibility and localization. Updated vite-env.d.ts to ensure correct Vite and ImportMeta type references for the Airflow UI. Minor refactors and cleanup in log and query files to support new i18n keys and UI consistency.
02d276c to
3020034
Compare
Changes to the log grouping UI in useLogs.tsx, using <chakra.details> and <chakra.summary> for grouped log sections. Ensures log groups are rendered with correct expand/collapse behavior and accessibility. Updates the related test (Logs.test.tsx) to match the new log grouping and expand/collapse structure.
|
Everything that was requested has been addressed. |
* feat(ui/logs)_#47619: add toggle for log grouping - Add button in header to enable or disable log grouping - Allow logs to be shown linearly or grouped - Adjust group offset and display Co-authored-by: Francisco Núncio <francisco.nuncio@tecnico.ulisboa.pt> * Fix Button distance * ajust gap betewn butons * feat(ui/logs): logs UX, keyboard accessibility, and code quality - Add expand/collapse all functionality for log groups using the "expanded" prop - Ensure initial logs state is collapsed and button shows "Expand All" - Add keyboard shortcut (E) to toggle expand/collapse all log groups - Unify button styles with black background and consistent padding/hover * feat(ui/logs): unify expand/collapse log controls with grid view style -Rebase - Refactor TaskLogHeader to use a ButtonGroup with IconButton for expand/collapse, matching the style and behavior of ToggleGroups in the grid view - Warnings on precomit but not on the file i changed * feat(i18n/ui): add expand/collapse translations, fix requested issues, and rebase - Added "expand" section with tooltip, expand, and collapse strings to all locale JSON files - Fixed requested issues in the UI related to expand/collapse controls - Performed rebase to update branch with latest changes * feat(i18n/ui): add expand/collapse translations, improve log header i18n, and update environment typings Updated log header UI (TaskLogHeader.tsx) to use i18n for expand/collapse/fullscreen tooltips and aria-labels. Fixed and improved expand/collapse controls and tooltips in the UI for accessibility and localization. Updated vite-env.d.ts to ensure correct Vite and ImportMeta type references for the Airflow UI. Minor refactors and cleanup in log and query files to support new i18n keys and UI consistency. * fix(ui/logs): restore log grouping UI and update related test Changes to the log grouping UI in useLogs.tsx, using <chakra.details> and <chakra.summary> for grouped log sections. Ensures log groups are rendered with correct expand/collapse behavior and accessibility. Updates the related test (Logs.test.tsx) to match the new log grouping and expand/collapse structure. * test(logs): adjust test selectors to handle multiple collapse/expand buttons --------- Co-authored-by: Francisco Núncio <francisco.nuncio@tecnico.ulisboa.pt>
https://www.youtube.com/watch?v=doCR4YM1Rek
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.