UI: Make dialogs consistent and fix their dark mode background - #71806
Merged
Conversation
Dialog scaffolding was hand-assembled in around fifty places and had drifted apart: close triggers, mount flags, heading sizes and the placement of action buttons all varied, so a dialog's chrome depended on which screen happened to open it. Keeping any of that consistent relied on each author copying the surrounding code correctly, and several dialogs had already diverged. In dark mode Chakra's default panel background resolves much darker than the page background, leaving dialogs looking detached from the app behind them. Light mode resolves both to white, so the discrepancy was easy to miss and had gone unnoticed. Giving the scaffolding a single definition means the chrome is consistent by construction rather than by convention, and puts theming in one place that applies to every dialog at once.
1 task
ryanahamilton
marked this pull request as ready for review
August 19, 2026 00:40
ryanahamilton
requested review from
bbovenzi,
choo121600,
guan404ming,
pierrejeambrun,
shubhamraj-git and
vatsrahul1001
as code owners
August 19, 2026 00:40
bbovenzi
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The UI hand-assembled the same Chakra
Dialogscaffolding in around fifty places, and it had drifted: close triggers,lazyMount/unmountOnExitflags, heading sizes and the placement of action buttons all varied, so a dialog's chrome depended on which screen opened it. Only 7 of ~50 dialogs usedDialog.Footer; the rest hand-rolled a right-aligned<Flex>of buttons inside the body.This adds a shared
Modalcomponent that takes the structure as props, migrates the call sites onto it, and moves dialog theming into the Chakra slot recipe so it applies everywhere at once.Notable user-facing changes
bg.panel, which resolves togray.950in dark mode — far darker than the page, so dialogs looked detached. Both resolve to white in light mode, which is why this went unnoticed. Content now usesbg.brand.mutedtint, and the close button is styled like the nav buttons.footerActions(opt out withhideCancelAction).Points worth a reviewer's attention
footerActionstakes the primary action first so it leads the tab order, whileflexDirection: row-reversestill renders it rightmost. Migrated call sites had theirCancel/Saveorder flipped to suit; passing them in the old order silently swaps the buttons on screen.lazyMountandunmountOnExitnow default totrue. 27 dialogs previously lackedunmountOnExit, so their state now resets on close. This is usually what you want, but it is a behaviour change for those.Dialog.Titlereplaces a plainHeading, which wires uparia-labelledby— the dialog is now announced by its title, which it was not before.DagImportErrorsModal/PluginImportErrorsModalsearch bars). One consequence: a modal with no title and no custom header renders no header, and therefore no close button.Deliberately not migrated
Four dialogs keep raw
Dialogbecause they do not fit the Header/Body/Footer slot order:ClearTaskInstanceConfirmationDialog— has noDialog.Bodyat all and branches tonull; the only user ofDialog.Description.MarkdownModal/DisplayMarkdownButton— aResizableWrappersits betweenDialog.Contentand the Header/Body pair.SearchDagsButton— a five-line command-palette dialog with none of the boilerplateModalexists to remove.The Edge3 provider has 12 more hand-rolled dialogs, but it is a separate distribution that cannot import
airflow-coreUI internals.Testing
Modalhas 12 new tests covering slot overrides, footer ordering and DOM/tab order, the cancel action, andhideCancelActionpnpm lint(ESLint +tsc) andprek run --stage pre-commitcleansize="full"andsize="cover", since Chakra recipe styles are not present in the happy-dom test environmentWas generative AI tooling used to co-author this PR?
Claude Code (Opus 5)