You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "korbit-ai[bot] (via GitHub)" <gi...@apache.org> on 2025/03/25 08:22:40 UTC

Re: [PR] fix: fix bug where dashboard did not enter fullscreen mode. [superset]

korbit-ai[bot] commented on code in PR #32839:
URL: https://github.com/apache/superset/pull/32839#discussion_r2011553006


##########
superset-frontend/src/dashboard/components/Header/useHeaderActionsDropdownMenu.tsx:
##########
@@ -97,11 +97,13 @@ export const useHeaderActionsMenu = ({
           showPropertiesModal();
           break;
         case MenuKeys.ToggleFullscreen: {
+          const isCurrentlyStandalone =
+            getUrlParam(URL_PARAMS.standalone) === 1;

Review Comment:
   ### Invalid Type Comparison <sub>![category Functionality](https://img.shields.io/badge/Functionality-0284c7)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   Direct comparison with number 1 is incorrect as getUrlParam likely returns a string, not a number.
   
   ###### Why this matters
   This type coercion can lead to unexpected behavior when comparing string '1' with number 1 using strict equality (===). The comparison will always be false even when the parameter is '1'.
   
   ###### Suggested change ∙ *Feature Preview*
   Use string comparison or explicit conversion:
   ```typescript
   const isCurrentlyStandalone = String(getUrlParam(URL_PARAMS.standalone)) === '1';
   ```
   or
   ```typescript
   const isCurrentlyStandalone = Number(getUrlParam(URL_PARAMS.standalone)) === 1;
   ```
   
   
   ###### Provide feedback to improve future suggestions
   [![Nice Catch](https://img.shields.io/badge/👍%20Nice%20Catch-71BC78)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/74039c5e-3a9d-4837-a3d5-14261deaf7da/upvote) [![Incorrect](https://img.shields.io/badge/👎%20Incorrect-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/74039c5e-3a9d-4837-a3d5-14261deaf7da?what_not_true=true)  [![Not in Scope](https://img.shields.io/badge/👎%20Out%20of%20PR%20scope-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/74039c5e-3a9d-4837-a3d5-14261deaf7da?what_out_of_scope=true) [![Not in coding standard](https://img.shields.io/badge/👎%20Not%20in%20our%20standards-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/74039c5e-3a9d-4837-a3d5-14261deaf7da?what_not_in_standard=true) [![Other](https://img.shields.io/badge/👎%20Other-white)](https://app.korbit.ai/feedback/aa91ff46-6083-4491-9416-b83dd1994b51/74039c5e-3a9d-4837-a3d5-14261deaf7da)
   </details>
   
   <sub>
   
   💬 Looking for more details? Reply to this comment to chat with Korbit.
   </sub>
   
   <!--- korbi internal id:96185117-a268-445b-937a-0fcf7ebfbcea -->
   
   [](96185117-a268-445b-937a-0fcf7ebfbcea)



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org