pierrejeambrun opened a new pull request, #65378:
URL: https://github.com/apache/airflow/pull/65378
Fix log groups (::group::) auto-collapsing whenever the UI auto-refreshes
or the user scrolls the log area. Reported by Booking.com — regression
since 2.9.1.
**Root cause:** two issues combined after the React 18→19 / Chakra UI
2.4→2.10 upgrade (#63158):
1. `LogBlock.onClick` mutated the `unfoldedGroups` array in-place (`.push`,
`.splice`) then passed the **same reference** to `setState`. React 19
uses strict `Object.is` comparison — same reference means the state
update is silently discarded, so `useMemo` never recalculates the
parsed logs with the correct unfolded state.
2. Chakra UI `Tabs` with `isLazy` defaults to `lazyBehavior="unmount"`,
which unmounts inactive tab panels. Any remount resets `useState([])`
to empty, losing the unfolded groups entirely.
**Fix:**
- Use immutable state updates (`[...prev, gId]` / `prev.filter(...)`)
so React detects the state change.
- Add `lazyBehavior="keepMounted"` to the Tabs so panels preserve state
once rendered (still lazy on initial load).
closes: #65200
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Claude Code (Opus 4.6)
Generated-by: Claude Code (Opus 4.6) following [the
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
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]