Skip to content

UI: Fix unresponsive page after closing Clear / Mark-as dialog#67645

Closed
pierrejeambrun wants to merge 2 commits into
apache:mainfrom
astronomer:fix/clear-mark-modal-unresponsive
Closed

UI: Fix unresponsive page after closing Clear / Mark-as dialog#67645
pierrejeambrun wants to merge 2 commits into
apache:mainfrom
astronomer:fix/clear-mark-modal-unresponsive

Conversation

@pierrejeambrun
Copy link
Copy Markdown
Member

Symptom

Open a Clear or Mark-as-success/failed dialog on a Dag Run or task
instance, close it without confirming, and the page becomes
unresponsive — only scroll works. Reopening another dialog doesn't
help; only a hard refresh recovers.

Root cause

The buttons that own these dialogs render them like

{open ? <ClearRunDialog ... open={open} /> : undefined}

When the user closes the dialog, open flips to false and the
parent unmounts the dialog component synchronously. Chakra never
gets to run Dialog.Root's close transition, which is what removes
the body-scroll lock + pointer-events overlay it applies on open.
The overlay stays on document, blocking every click while still
letting wheel events through.

Fix

Drop the conditional wrapper in the five callers (ClearRunButton,
MarkRunAsButton, ClearTaskInstanceButton — three discriminator
branches, MarkTaskInstanceAsButton, and the ClearTaskInstance
mount on the Task Instance Header) and always render the dialog.
lazyMount (already set on every Dialog.Root) defers the very
first mount until the user actually opens the dialog, and the
open prop drives visibility cleanly across subsequent cycles.

ClearRunDialog's useClearDagRunDryRun was the only dry-run
query in this set that didn't already gate on open; adding
enabled: open so the now-always-mounted dialog doesn't fire it
in the background. The four other dialogs already do this.

Screenshots

UI bug-fix with no visual change — the dialog looks the same, it just
stops trapping the page after close. No screenshot can show that;
exercising in the browser is the only way to confirm.

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.7)

Generated-by: Claude Code (Opus 4.7) following the guidelines

…t acting

Opening a Clear or Mark-as-success/failed dialog on a Dag Run or task
instance and closing it without confirming left the page unable to
receive any click (scroll still worked). The cause was the parent
button rendering its dialog with ``{open ? <Dialog .../> : undefined}``,
which yanks the component out of the tree the moment ``open`` flips
to ``false``. Chakra never gets to run ``Dialog.Root``'s close
transition, so the body-scroll lock / ``pointer-events`` overlay it
applies on open stays on the document.

Drop the conditional wrapper in every Clear / Mark-as button (plus the
``ClearTaskInstanceDialog`` mount on the Task Instance Header) so the
dialog stays mounted across open/close cycles. ``lazyMount`` (already
set on every dialog) defers the first mount until the user actually
opens it, and the ``open`` prop drives the visibility transition
cleanly thereafter.

``ClearRunDialog``'s ``useClearDagRunDryRun`` was the only dry-run
query in this set that didn't already gate on ``open``; adding
``enabled: open`` so the now-always-mounted dialog doesn't fire it
in the background.
@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label May 28, 2026
Now that the dialog stays mounted across open/close cycles to let
Chakra's close transition run cleanup, the local form state
(``note``, segmented options, ``preventRunningTask``) survives between
opens too. That re-introduces the leak apache#47071 originally fixed by
remount-on-each-open: type a note, cancel, reopen, and you'd see your
own typed text instead of the run/TI's actual note.

Reset that state in a small effect when ``open`` flips to false, so
each new open starts from the same defaults the freshly-mounted
component would have shown — without giving up the close transition.
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.

1 participant