This is an automated email from the ASF dual-hosted git repository.

elizabeth pushed a commit to branch elizabeth/fix-resize-bug
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 3490a19789c59dfab2e63a8eecd32bd22ecd702b
Author: Geido <[email protected]>
AuthorDate: Mon Jul 28 12:19:14 2025 +0300

    fix(NavBar): Add brand text back (#34318)
---
 superset-frontend/src/features/home/Menu.test.tsx | 39 +++++++++++++++++++++++
 superset-frontend/src/features/home/Menu.tsx      |  9 +++++-
 2 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/superset-frontend/src/features/home/Menu.test.tsx 
b/superset-frontend/src/features/home/Menu.test.tsx
index 530a86fbc3..9b8102ee38 100644
--- a/superset-frontend/src/features/home/Menu.test.tsx
+++ b/superset-frontend/src/features/home/Menu.test.tsx
@@ -612,3 +612,42 @@ test('should render an extension component if one is 
supplied', async () => {
 
   expect(extension[0]).toBeInTheDocument();
 });
+
+test('should render the brand text if available', async () => {
+  useSelectorMock.mockReturnValue({ roles: [] });
+
+  const modifiedProps = {
+    ...mockedProps,
+    data: {
+      ...mockedProps.data,
+      brand: {
+        ...mockedProps.data.brand,
+        text: 'Welcome to Superset',
+      },
+    },
+  };
+
+  render(<Menu {...modifiedProps} />, {
+    useRouter: true,
+    useQueryParams: true,
+    useRedux: true,
+    useTheme: true,
+  });
+
+  const brandText = await screen.findByText('Welcome to Superset');
+  expect(brandText).toBeInTheDocument();
+});
+
+test('should not render the brand text if not available', async () => {
+  useSelectorMock.mockReturnValue({ roles: [] });
+  const text = 'Welcome to Superset';
+  render(<Menu {...mockedProps} />, {
+    useRouter: true,
+    useQueryParams: true,
+    useRedux: true,
+    useTheme: true,
+  });
+
+  const brandText = screen.queryByText(text);
+  expect(brandText).not.toBeInTheDocument();
+});
diff --git a/superset-frontend/src/features/home/Menu.tsx 
b/superset-frontend/src/features/home/Menu.tsx
index d61bd1e35c..3670ccbcfb 100644
--- a/superset-frontend/src/features/home/Menu.tsx
+++ b/superset-frontend/src/features/home/Menu.tsx
@@ -52,6 +52,8 @@ const StyledHeader = styled.header`
         display: none;
       }
       & .ant-image{
+        display: contents;
+        height: 100%;
         padding: ${theme.sizeUnit}px
           ${theme.sizeUnit * 2}px
           ${theme.sizeUnit}px
@@ -87,7 +89,7 @@ const StyledHeader = styled.header`
         padding-left: ${theme.sizeUnit * 4}px;
         padding-right: ${theme.sizeUnit * 4}px;
         margin-right: ${theme.sizeUnit * 6}px;
-        font-size: ${theme.sizeUnit * 4}px;
+        font-size: ${theme.fontSizeLG}px;
         float: left;
         display: flex;
         flex-direction: column;
@@ -322,6 +324,11 @@ export function Menu({
           >
             {renderBrand()}
           </Tooltip>
+          {brand.text && (
+            <div className="navbar-brand-text">
+              <span>{brand.text}</span>
+            </div>
+          )}
           <MainNav
             mode={showMenu}
             data-test="navbar-top"

Reply via email to