bito-code-review[bot] commented on code in PR #37973:
URL: https://github.com/apache/superset/pull/37973#discussion_r2927552670
##########
superset-frontend/src/pages/UserInfo/index.tsx:
##########
@@ -159,7 +164,10 @@ export function UserInfo({ user }: { user:
UserWithPermissionsAndRoles }) {
<StyledLayout>
<StyledHeader>{t('Your user information')}</StyledHeader>
<DescriptionsContainer>
- <Collapse defaultActiveKey={['userInfo', 'personalInfo']} ghost>
+ <Collapse
+ defaultActiveKey={['userInfo', 'personalInfo', 'apiKeys']}
+ ghost
+ >
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Conditional defaultActiveKey mismatch</b></div>
<div id="fix">
The defaultActiveKey array unconditionally includes 'apiKeys', but the
corresponding Collapse.Panel is only rendered when
isFeatureEnabled(FeatureFlag.FabApiKeyEnabled) is true. This mismatch can cause
React warnings or unexpected collapse behavior when the feature flag is
disabled. Update defaultActiveKey to conditionally include 'apiKeys' based on
the feature flag.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
````suggestion
<Collapse
defaultActiveKey={['userInfo', 'personalInfo',
...(isFeatureEnabled(FeatureFlag.FabApiKeyEnabled) ? ['apiKeys'] : [])]}
ghost
>
````
</div>
</details>
</div>
<small><i>Code Review Run #676a5d</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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]