kartik00052 opened a new pull request, #73564:
URL: https://github.com/apache/airflow/pull/73564
### Summary
Implements the split-button pattern (GitHub-style) for the "Trigger Dag"
control in the React UI.
### Problem
When a DAG run with a config is selected (e.g. the Dag Details page of that
run), the entire
Trigger button turns into a dropdown. Every click now opens a menu first,
and the plain
"Trigger" action takes an extra interaction, so triggering a run no longer
works with the one
click users expect. The dropdown also hides its options behind a button that
looks exactly like
the previous single-action control.
### Solution
Keep the main part of the button always acting as the plain trigger (opens
the trigger form in
one click, exactly as before), and add an always-visible caret next to it
that opens a menu with
"Trigger with config" (opens the existing `TriggerDAGForm`/modal) and, when
a previously
selected run carried a config, "Trigger again with this config" (prefills
the form from that
run, the behaviour previously shown by #56406).
- Main button behaviour is unchanged for all call sites (`DagCardActions`,
the Dags list cell,
and `DetailsLayout`), including the `variant` / `withText` props, the
"manual runs not
allowed" disabled state and its tooltip.
- The caret is a normal button with an `aria-label`, part of a Chakra
`ButtonGroup attached`, so
it renders as a cohesive split control. Its `Menu` is fully
keyboard-navigable (the searchable
Chakra menu) with the reference `ids` wired for the tooltip.
- New i18n keys `triggerDag.triggerOptions` and
`triggerDag.triggerWithConfig` added to the
`components` namespace in `en` (the authoritative source locale). Nested
keys fall back to `en`
for other locales via the configured `fallbackLng`; the other locale files
carry only real
translations, per repo convention.
### Related issue
closes: #73177
Note: related open PR #70413 adds a recent-config dropdown *inside* the
trigger form
(closes #69820). This PR is orthogonal to it — it fixes the button itself so
the default action
is always reachable with one click (option (b) of #73177). Both can coexist;
they target
different layers of the same UX problem.
### Tests added
New `TriggerDAGButton.test.tsx` covering:
- main click opens the trigger form and does not open the dropdown
- caret click opens the menu with "Trigger with config"
- the "Trigger with config" item opens the trigger form
- "Trigger again with this config" appears (and prefills) only when a
selected run has config
- no config-run selected -> only the "Trigger with config" item is present
- keyboard: `ArrowDown` on the caret opens the menu and `Enter` activates an
item
- both button parts are disabled when manual runs are not allowed
Validated with `pnpm lint` and `pnpm test` (148 of 150 test files pass; the
sole failure is a
pre-existing 5s timeout in `src/queryClient.test.ts` reproducible on a clean
checkout).
### Breaking changes
None.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (please specify the tool below)
<!--
Generated-by: opencode (big-pickle) 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]