codeant-ai-for-open-source[bot] commented on code in PR #40978:
URL: https://github.com/apache/superset/pull/40978#discussion_r3523801565
##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx:
##########
@@ -228,6 +241,21 @@ 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 => {
+ const parentMask = dataMaskSelected?.[pId];
+ return (
+ parentDefaultToFirstItem[pId] &&
+ parentMask?.filterState?.value === undefined
+ );
Review Comment:
✅ **Customized review instruction saved!**
**Instruction:**
> In native filter readiness guards, treat only `undefined` as the pending
auto-select state; do not treat `null` as pending because `null` represents an
explicitly cleared selection (for example after Clear All).
**Applied to:**
- `superset-frontend/src/dashboard/components/nativeFilters/**`
---
💡 *To manage or update this instruction, visit: [CodeAnt AI
Settings](https://app.codeant.ai/org/settings/learnings)*
--
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]