codeant-ai-for-open-source[bot] commented on code in PR #40985:
URL: https://github.com/apache/superset/pull/40985#discussion_r3417417774


##########
superset/views/base.py:
##########
@@ -290,6 +290,7 @@ def menu_data(user: User) -> dict[str, Any]:
             "alt": appbuilder.app_name,
             "tooltip": app.config["LOGO_TOOLTIP"],
             "text": brand_text,
+            "hide_logo": app.config.get("HIDE_NAVBAR_LOGO", False),

Review Comment:
   **Suggestion:** This new flag is documented as "hide the navbar logo", but 
wiring it directly to `brand.hide_logo` also hides `brand.text` in the current 
frontend menu logic, so enabling it removes the entire brand block rather than 
only the logo. Return a dedicated logo-only flag (or adjust the existing 
contract) so hiding the logo does not unintentionally hide brand text. 
[incorrect condition logic]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Navbar brand text disappears when HIDE_NAVBAR_LOGO is enabled.
   - ⚠️ Deployers cannot hide logo while preserving brand text.
   - ⚠️ Branding area becomes blank, confusing end users.
   ```
   </details>
   <details>
   <summary><b>Steps of Reproduction ✅ </b></summary>
   
   ```mdx
   1. In `superset/config.py:387`, enable the documented logo-only flag by 
setting
   `HIDE_NAVBAR_LOGO = True` (config comment at line 386 reads "When True, hide 
the navbar
   logo.").
   
   2. Start Superset so Flask loads this config, then note that `menu_data()` in
   `superset/views/base.py:273-295` passes it through as `"hide_logo":
   app.config.get("HIDE_NAVBAR_LOGO", False)` inside the `brand` object (line 
293 in the PR
   hunk).
   
   3. Observe that `common_bootstrap_payload()` in `superset/views/base.py:540` 
injects
   `menu_data(g.user)` into `bootstrapData.common.menu_data`, which is then 
consumed by the
   React `Menu` component via `src/views/App.tsx:87` and 
`src/views/menu.tsx:41,25`.
   
   4. In the browser, load any main page (e.g. `/superset/welcome`) so
   `src/features/home/Menu.tsx` renders; because `brand.hide_logo` is now true,
   `renderBrand()` returns null (`Menu.tsx:293-295`), the tooltip wrapper is 
skipped
   (`!brand.hide_logo` check at `Menu.tsx:350`), and the brand text is also 
suppressed
   (`brand.text && !brand.hide_logo` at `Menu.tsx:360`), so both the logo and 
the brand text
   disappear instead of only the logo.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=ad0e1f800d404b359a4a966db57c5f2c&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=ad0e1f800d404b359a4a966db57c5f2c&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset/views/base.py
   **Line:** 293:293
   **Comment:**
        *Incorrect Condition Logic: This new flag is documented as "hide the 
navbar logo", but wiring it directly to `brand.hide_logo` also hides 
`brand.text` in the current frontend menu logic, so enabling it removes the 
entire brand block rather than only the logo. Return a dedicated logo-only flag 
(or adjust the existing contract) so hiding the logo does not unintentionally 
hide brand text.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40985&comment_hash=33697164c571e49d371ca79f2580123fd6adb1cc1c99518e3e2761d9d3a59592&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F40985&comment_hash=33697164c571e49d371ca79f2580123fd6adb1cc1c99518e3e2761d9d3a59592&reaction=dislike'>👎</a>



-- 
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]

Reply via email to