bito-code-review[bot] commented on code in PR #44165:
URL: https://github.com/apache/superset/pull/44165#discussion_r4069204341
##########
superset-frontend/src/explore/exploreUtils/index.ts:
##########
@@ -178,7 +178,13 @@ export function mountExploreUrl(
if (force) {
search.force = '1';
}
- search.standalone = DashboardStandaloneMode.HideNav;
+ // Callers pass the active mode through extraSearch (already merged above).
+ // Only default when absent — unconditionally writing HideNav downgrades
+ // mode 2 (hide nav, keep editor controls) to mode 1 (chart only) on every
+ // history.replace an Explore interaction triggers.
+ if (search.standalone === undefined) {
+ search.standalone = DashboardStandaloneMode.HideNav;
+ }
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Impossible undefined comparison</b></div>
<div id="fix">
The guard compares `search.standalone` (typed `string | number` by the
`Record<string, string | number>` cast at index.ts:173) against `undefined`;
under `strictNullChecks` with no `noUncheckedIndexedAccess`, tsc 5.4.5 raises
TS2367 (no overlap), failing the type-check build. The runtime intent is right
— default only when absent — so use `typeof search.standalone === 'undefined'`
(or widen the record type to include `undefined`).
</div>
</div>
<small><i>Code Review Run #914a01</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]