This is an automated email from the ASF dual-hosted git repository.
michael-s-molina pushed a commit to branch 6.2
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/6.2 by this push:
new a1fd226396d fix(nav): prevent full reload when clicking logo; redirect
/ to welcome (#41119)
a1fd226396d is described below
commit a1fd226396dac97598814dd16dc3722f9ebf2064
Author: Michael S. Molina <[email protected]>
AuthorDate: Wed Jun 17 09:27:17 2026 -0300
fix(nav): prevent full reload when clicking logo; redirect / to welcome
(#41119)
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
(cherry picked from commit 59d1b5f3007c11dd6a25f4688b1f963439cbda53)
---
superset-frontend/src/features/home/Menu.tsx | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/superset-frontend/src/features/home/Menu.tsx
b/superset-frontend/src/features/home/Menu.tsx
index 1849e8a2e2d..ca05bfec786 100644
--- a/superset-frontend/src/features/home/Menu.tsx
+++ b/superset-frontend/src/features/home/Menu.tsx
@@ -20,7 +20,7 @@ import { useState, useEffect } from 'react';
import { styled, css, useTheme } from '@apache-superset/core/theme';
import { ensureStaticPrefix } from 'src/utils/assetUrl';
import { ensureAppRoot } from 'src/utils/pathUtils';
-import { getUrlParam } from 'src/utils/urlUtils';
+import { getUrlParam, isUrlExternal } from 'src/utils/urlUtils';
import { MainNav, MenuItem } from '@superset-ui/core/components/Menu';
import { Tooltip, Grid, Row, Col, Image } from '@superset-ui/core/components';
import { GenericLink } from 'src/components';
@@ -151,7 +151,7 @@ const StyledBrandWrapper = styled.div<{ margin?: string }>`
`}
`;
-const StyledBrandLink = styled(Typography.Link)`
+const StyledBrandLink = styled(GenericLink)`
${({ theme }) => css`
align-items: center;
display: flex;
@@ -290,16 +290,24 @@ export function Menu({
const renderBrand = () => {
let link;
if (theme.brandLogoUrl) {
+ const brandHref = ensureAppRoot(theme.brandLogoHref);
+ const brandImage = (
+ <StyledImage
+ preview={false}
+ src={ensureStaticPrefix(theme.brandLogoUrl)}
+ alt={theme.brandLogoAlt || 'Apache Superset'}
+ height={theme.brandLogoHeight}
+ />
+ );
link = (
<StyledBrandWrapper margin={theme.brandLogoMargin}>
- <StyledBrandLink href={ensureAppRoot(theme.brandLogoHref)}>
- <StyledImage
- preview={false}
- src={ensureStaticPrefix(theme.brandLogoUrl)}
- alt={theme.brandLogoAlt || 'Apache Superset'}
- height={theme.brandLogoHeight}
- />
- </StyledBrandLink>
+ {isUrlExternal(brandHref) ? (
+ <Typography.Link className="navbar-brand" href={brandHref}>
+ {brandImage}
+ </Typography.Link>
+ ) : (
+ <StyledBrandLink to={brandHref}>{brandImage}</StyledBrandLink>
+ )}
</StyledBrandWrapper>
);
} else if (isFrontendRoute(window.location.pathname)) {