Skip to content

Fix import error stack traces not visible when modal opens#67597

Open
shashbha14 wants to merge 5 commits into
apache:mainfrom
shashbha14:fix/dag-import-error-stack-trace-visible-67456
Open

Fix import error stack traces not visible when modal opens#67597
shashbha14 wants to merge 5 commits into
apache:mainfrom
shashbha14:fix/dag-import-error-stack-trace-visible-67456

Conversation

@shashbha14
Copy link
Copy Markdown
Contributor

Closes #67456
Problem- The import errors modals (DAG and Plugin) rendered accordion items collapsed by default. Users had to manually expand each item to see the stack trace ,making the error information effectively hidden.
Fix-
Added controlled 'value'/'onValueChange' accordion state to both 'DAGImportErrorsModal' and 'PluginImportErrorsModal.' A 'useEffect' auto-expands all visible items whenever data loads or the page changes, so stack traces are immediately visible when the modal opens.

@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label May 27, 2026
Comment thread airflow-core/newsfragments/67597.bugfix.rst Outdated
Comment on lines +67 to +70
useEffect(() => {
setOpenItems(filteredErrors.slice((page - 1) * PAGE_LIMIT, page * PAGE_LIMIT).map((err) => err.source));
}, [filteredErrors, page]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, we should always try to avoid mixing useState and useEffect https://react.dev/learn/you-might-not-need-an-effect

And if it really is necessary then we should leave a comment justifying it.

Comment on lines +89 to +92
<Accordion.Root
collapsible
multiple
onValueChange={(details) => setOpenItems(details.value)}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use key and defaultValue in order to manage the openIds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Import error stack trace not visible to the user

3 participants