superset icon indicating copy to clipboard operation
superset copied to clipboard

fix(config): Wire LOGO_TARGET_PATH and document custom spinner usage

Open shashbha14 opened this issue 10 months ago • 2 comments

SUMMARY This PR addresses user confusion regarding customizing the loading icon and resolves a bug where LOGO_TARGET_PATH was being ignored by the default theme system in Superset 6.0.0.

Specifically, it:

  1. Documents Custom Loading Icon: Explicitly documents brandSpinnerUrl in THEME_DEFAULT within config.py. This clarifies that users can set a custom GIF/image loader via config without needing to replace source files or rebuild assets.
  2. Fixes Logo Link: Updates THEME_DEFAULT to correctly use LOGO_TARGET_PATH for brandLogoHref. Previously, LOGO_TARGET_PATH was ignored by the default theme, forcing users to override the entire theme object just to change the logo link.
  3. Clarifies Configuration: Added comments to APP_ICON, LOGO_TOOLTIP, LOGO_RIGHT_TEXT, and APP_ICON_WIDTH (deprecation note) to clarify their interaction with THEME_DEFAULT or their deprecated status.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A (Configuration and Documentation changes only)

TESTING INSTRUCTIONS To verify these changes locally:

  1. Verify Logo Link Fix:

    • In superset_config.py, set LOGO_TARGET_PATH = "https://custom.url".
    • Restart Superset and click the top-left logo.
    • Result: It should navigate to https://custom.url (previously it would stay on / unless the theme was overridden).
  2. Verify Custom Spinner:

    • In superset_config.py, set:
      THEME_DEFAULT = {
          "token": {
              "brandSpinnerUrl": "/static/assets/images/my-custom-spinner.gif"
          }
      }
      
    • Restart Superset.
    • Result: The custom GIF should appear during loading.

ADDITIONAL INFORMATION

  • [x] Has associated issue: Fixes #36940
  • [ ] Required feature flags:
  • [ ] Changes UI
  • [ ] Includes DB Migration (follow approval process in SIP-59)
    • [ ] Migration is atomic, supports rollback & is backwards-compatible
    • [ ] Confirm DB migration upgrade and downgrade tested
    • [ ] Runtime estimates and downtime expectations provided
  • [ ] Introduces new feature or API
  • [ ] Removes existing feature or API

shashbha14 avatar Jan 07 '26 12:01 shashbha14

Code Review Agent Run #3272be

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 4e6b533..4e6b533
    • superset/config.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

bito-code-review[bot] avatar Jan 07 '26 12:01 bito-code-review[bot]

Deploy Preview for superset-docs-preview ready!

Name Link
Latest commit 552a9cbd54729b56b9e07b05eac2398d64937267
Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/69978337ba3eb1000803448f
Deploy Preview https://deploy-preview-36951--superset-docs-preview.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify avatar Jan 07 '26 12:01 netlify

Looks simple enough, but can you perhaps add a simple test where you add a LOGO_TARGET_PATH and assert that it shows up in the code?

rusackas avatar Jan 12 '26 18:01 rusackas

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 66.44%. Comparing base (9968393) to head (24b7e03). :warning: Report is 1253 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #36951       +/-   ##
===========================================
+ Coverage        0   66.44%   +66.44%     
===========================================
  Files           0      668      +668     
  Lines           0    51391    +51391     
  Branches        0     5794     +5794     
===========================================
+ Hits            0    34148    +34148     
- Misses          0    15855    +15855     
- Partials        0     1388     +1388     
Flag Coverage Δ
hive 41.43% <ø> (?)
mysql 64.55% <ø> (?)
postgres 64.62% <ø> (?)
presto 41.45% <ø> (?)
python 66.42% <ø> (?)
sqlite 64.22% <ø> (?)
unit 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Jan 12 '26 18:01 codecov[bot]

I've added a test to help see this through.

rusackas avatar Feb 19 '26 21:02 rusackas

Code Review Agent Run #570c3f

Actionable Suggestions - 0
Additional Suggestions - 2
  • tests/unit_tests/config_test.py - 2
    • Incomplete test coverage · Line 317-335
      The test docstring states it verifies behavior when LOGO_TARGET_PATH is set, but the implementation only checks the default case. Since THEME_DEFAULT is evaluated at import time, setting LOGO_TARGET_PATH after import won't change it. Consider either updating the docstring to reflect only testing the default, or modifying the test to properly validate the 'or' logic by directly testing THEME_DEFAULT with different values.
    • Redundant assertion · Line 330-332
      The assertion `assert (custom_path or "/") == custom_path` merely verifies Python's built-in 'or' short-circuiting, which doesn't add value to testing the config logic.
Review Details
  • Files reviewed - 2 · Commit Range: 4e6b533..24b7e03
    • superset/config.py
    • tests/unit_tests/config_test.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

bito-code-review[bot] avatar Feb 19 '26 22:02 bito-code-review[bot]