Copilot commented on code in PR #40978:
URL: https://github.com/apache/superset/pull/40978#discussion_r3398734107
##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx:
##########
@@ -226,6 +231,22 @@ const FilterValue: FC<FilterValueProps> = ({
// direct parents) so the counts line up with `dependencies`, which is
// itself built from the transitive chain by `useFilterDependencies`.
+ // Block if any parent with defaultToFirstItem hasn't auto-selected yet.
+ // Without this, the child fetches unfiltered options before the parent
+ // auto-selects, leading to a stale first-value dispatch that never
+ // gets corrected because subsequent re-selections are not
first-initialization.
+ const hasDefaultFirstParentPending = transitiveParentIds.some(pId => {
Review Comment:
The new readiness short-circuit for `defaultToFirstItem` ancestors is a
subtle ordering fix (it changes when the initial backend request is allowed to
run), but there are no automated tests covering this dependency/auto-select
interaction. Since `FilterValue` already has unit tests, please add coverage
for the dependent-filter scenario (parent defaultToFirstItem pending => child
does not fetch until parent value is set), to prevent regressions.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]