Skip to content

Require a selection before responding to a multiple-choice HITL request - #75643

Merged
Lee-W merged 2 commits into
apache:mainfrom
astronomer:hitl-multiple-require-selection
Oct 26, 2026
Merged

Lee-W merged 2 commits into
apache:mainfrom
astronomer:hitl-multiple-require-selection

Conversation

@Lee-W

@Lee-W Lee-W commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Why

When a request is still pending and its Respond button is shown (a multiple=True request, a single-choice request with more than 4 options, or one with preloaded options) and no option is chosen, the form now disables Respond and shows a "Select at least one option" hint. handleSubmit also returns early in that state, so an empty chosen_options is never sent. Requests rendered as per-option buttons (4 or fewer options, not multiple) and Approve/Reject requests behave as before.

What

When a multiple=True request is still pending and has no option chosen, the form now disables Respond and shows a "Select at least one option" hint (new response.selectAtLeastOne key, added in en and zh-TW). handleSubmit also returns early in that state, so an empty chosen_options is never sent. Preselected defaults and single-choice requests behave as before.

image image

closes: #75532


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: [Claude] following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Lee-W added 2 commits October 26, 2026 19:04
Disable Respond and show a "Select at least one option" hint when a
multiple=True Human-in-the-loop request has no option chosen, instead of
sending an empty chosen_options that the API rejects with a generic 422.

Related: apache#75532
…tions

- Block the Respond button on an empty selection whenever it replaces the option buttons, not only for multiple-choice requests
- Treat an empty string or missing value as empty for single-choice requests
@Lee-W
Lee-W force-pushed the hitl-multiple-require-selection branch from 30a8a61 to 80c652c Compare October 26, 2026 10:11
@Lee-W
Lee-W requested a review from amoghrajesh October 26, 2026 10:12
@Lee-W
Lee-W enabled auto-merge (squash) October 26, 2026 10:33
@Lee-W
Lee-W merged commit a15d352 into apache:main Oct 26, 2026
80 checks passed
@Lee-W
Lee-W deleted the hitl-multiple-require-selection branch October 26, 2026 12:19
aaiss0927 added a commit to aaiss0927/airflow-1 that referenced this pull request Oct 28, 2026
Add the five missing Korean translations to restore key parity with
the English locale. These keys were added to the English locale after
the open batch PR apache#75415 branched, so they are not covered there:

- dag.json: versions.pathOccurrences_one/_other,
  versions.pathOccurrencesAtLeast_one/_other (added by apache#75433)
- hitl.json: response.selectAtLeastOne (added by apache#75643)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
choo121600 pushed a commit that referenced this pull request Oct 29, 2026
* i18n(ko): add missing translations(Oct 27)

Add the five missing Korean translations to restore key parity with
the English locale. These keys were added to the English locale after
the open batch PR #75415 branched, so they are not covered there:

- dag.json: versions.pathOccurrences_one/_other,
  versions.pathOccurrencesAtLeast_one/_other (added by #75433)
- hitl.json: response.selectAtLeastOne (added by #75643)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* i18n(ko): add translations for keys introduced in #75326

Covers the three keys added to en after this branch was cut:
xcom.columns.timestamp (browse), dagDetails.bundleVersion (common,
matching the existing versionDetails.bundleVersion wording), and the
sort aria-label (components).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A18rBgPJ6X4oXAzsecJjnz

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Human-in-the-loop form gives a generic "Validation Error" when no option is chosen

2 participants