Skip to content

Add split-button caret to Trigger DAG button - #73564

Closed
kartik00052 wants to merge 1 commit into
apache:mainfrom
kartik00052:split-trigger-dag-button-73177
Closed

kartik00052 wants to merge 1 commit into
apache:mainfrom
kartik00052:split-trigger-dag-button-73177

Conversation

@kartik00052

Copy link
Copy Markdown
Contributor

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?
  • Yes (please specify the tool below)

Turn the Trigger Dag control into a split button: the main part always
opens the trigger form in one click, while an always-visible caret
reveals a menu with "Trigger with config" and, when a previously
selected run carried a config, "Trigger again with this config".

Closes: apache#73177

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

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR, closing in favor of #74039 which is closer to being merged.

Also please add screenshots to UI PRs as requested in our contributing policy, this will make review process easier.

@@ -0,0 +1 @@
The Trigger Dag control is now a split button: the main part opens the trigger form in one click, while an always-visible caret reveals a menu with "Trigger with config" and, when a previously selected Dag run carried a config, "Trigger again with this config".

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To remove

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

Labels

None yet

Projects

None yet

2 participants