albraa911sa-lgtm commented on code in PR #41052:
URL: https://github.com/apache/superset/pull/41052#discussion_r3413971528


##########
superset-frontend/src/SqlLab/components/SqlEditorTabHeader/index.tsx:
##########
@@ -131,96 +150,116 @@ const SqlEditorTabHeader: FC<Props> = ({ queryEditor }) 
=> {
     return statusColors[state] || theme.colorIcon;
   };
   return (
-    <TabTitleWrapper>
-      <MenuDotsDropdown
-        trigger={['click']}
-        overlay={
-          <Menu
-            items={[
-              {
-                className: 'close-btn',
-                key: '1',
-                onClick: () => actions.removeQueryEditor(qe),
-                'data-test': 'close-tab-menu-option',
-                label: (
-                  <>
-                    <IconContainer>
-                      <Icons.CloseOutlined
-                        iconSize="l"
-                        css={css`
-                          verticalalign: middle;
-                        `}
-                      />
-                    </IconContainer>
-                    {t('Close tab')}
-                  </>
-                ),
-              } as MenuItemType,
-              {
-                key: '2',
-                onClick: renameTab,
-                'data-test': 'rename-tab-menu-option',
-                label: (
-                  <>
-                    <IconContainer>
-                      <Icons.EditOutlined
-                        css={css`
-                          verticalalign: middle;
-                        `}
-                        iconSize="l"
-                      />
-                    </IconContainer>
-                    {t('Rename tab')}
-                  </>
-                ),
-              } as MenuItemType,
-              {
-                key: '4',
-                onClick: () => actions.removeAllOtherQueryEditors(qe),
-                'data-test': 'close-all-other-menu-option',
-                label: (
-                  <>
-                    <IconContainer>
-                      <Icons.CloseOutlined
-                        iconSize="l"
-                        css={css`
-                          vertical-align: middle;
-                        `}
-                      />
-                    </IconContainer>
-                    {t('Close all other tabs')}
-                  </>
-                ),
-              } as MenuItemType,
-              {
-                key: '5',
-                onClick: () => actions.cloneQueryToNewTab(qe, false),
-                'data-test': 'clone-tab-menu-option',
-                label: (
-                  <>
-                    <IconContainer>
-                      <Icons.CopyOutlined
-                        iconSize="l"
-                        css={css`
-                          vertical-align: middle;
-                        `}
-                      />
-                    </IconContainer>
-                    {t('Duplicate tab')}
-                  </>
-                ),
-              } as MenuItemType,
-            ]}
+    <>
+      <TabTitleWrapper>
+        <MenuDotsDropdown
+          trigger={['click']}
+          overlay={
+            <Menu
+              items={[
+                {
+                  className: 'close-btn',
+                  key: '1',
+                  onClick: () => actions.removeQueryEditor(qe),
+                  'data-test': 'close-tab-menu-option',
+                  label: (
+                    <>
+                      <IconContainer>
+                        <Icons.CloseOutlined
+                          iconSize="l"
+                          css={css`
+                            verticalalign: middle;
+                          `}
+                        />
+                      </IconContainer>
+                      {t('Close tab')}
+                    </>
+                  ),
+                } as MenuItemType,
+                {
+                  key: '2',
+                  onClick: openRenameModal,
+                  'data-test': 'rename-tab-menu-option',
+                  label: (
+                    <>
+                      <IconContainer>
+                        <Icons.EditOutlined
+                          css={css`
+                            verticalalign: middle;
+                          `}
+                          iconSize="l"
+                        />
+                      </IconContainer>
+                      {t('Rename tab')}
+                    </>
+                  ),
+                } as MenuItemType,
+                {
+                  key: '4',
+                  onClick: () => actions.removeAllOtherQueryEditors(qe),
+                  'data-test': 'close-all-other-menu-option',
+                  label: (
+                    <>
+                      <IconContainer>
+                        <Icons.CloseOutlined
+                          iconSize="l"
+                          css={css`
+                            vertical-align: middle;
+                          `}
+                        />
+                      </IconContainer>
+                      {t('Close all other tabs')}
+                    </>
+                  ),
+                } as MenuItemType,
+                {
+                  key: '5',
+                  onClick: () => actions.cloneQueryToNewTab(qe, false),
+                  'data-test': 'clone-tab-menu-option',
+                  label: (
+                    <>
+                      <IconContainer>
+                        <Icons.CopyOutlined
+                          iconSize="l"
+                          css={css`
+                            vertical-align: middle;
+                          `}
+                        />
+                      </IconContainer>
+                      {t('Duplicate tab')}
+                    </>
+                  ),
+                } as MenuItemType,
+              ]}
+            />
+          }
+        />
+        <TabTitle>{qe.name}</TabTitle>{' '}
+        <StatusIcon
+          className="status-icon"
+          iconSize="m"
+          iconColor={getStatusColor(queryState, theme)}
+        />{' '}
+      </TabTitleWrapper>
+      <StandardModal
+        show={isRenameModalOpen}
+        title={t('Rename tab')}
+        onHide={handleRenameCancel}
+        onSave={handleRenameConfirm}
+        saveDisabled={!newTitle.trim()}
+        destroyOnClose
+      >
+        <ModalInputWrapper>
+          <Input
+            value={newTitle}
+            onChange={e => setNewTitle(e.target.value)}
+            onPressEnter={handleRenameConfirm}
+            data-test="rename-tab-input"
+            autoFocus
           />

Review Comment:
   Agreed — added `aria-label={t('New tab name')}` to the Input so screen 
readers announce the field purpose explicitly.



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