bito-code-review[bot] commented on code in PR #42006:
URL: https://github.com/apache/superset/pull/42006#discussion_r3572843758


##########
superset-frontend/src/SqlLab/components/TableExploreTree/TreeNodeRenderer.tsx:
##########
@@ -307,6 +308,7 @@ const TreeNodeRenderer: React.FC<TreeNodeRendererProps> = ({
             <div
               className="side-action-container"
               role="menu"
+              tabIndex={0}

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Inaccessible keyboard focus target</b></div>
   <div id="fix">
   
   The parent container has `role="menu"` and now `tabIndex={0}`, making it 
focusable via Tab key. However, there's no `onKeyDown` handler, so keyboard 
users will land on this element but find no way to interact with it. The 
contained `ActionButton` components show `.action-hover` only on CSS 
`:hover`/`[data-selected='true']`, which won't trigger when the container is 
keyboard-focused. Either add keyboard event handling or remove `tabIndex={0}` 
to avoid creating an inaccessible focus target. ([WAI-ARIA menu 
pattern](https://www.w3.org/WAI/ARIA/apg/patterns/menu/))
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #a839a5</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



##########
superset-frontend/src/SqlLab/components/TableExploreTree/TreeNodeRenderer.tsx:
##########
@@ -239,6 +239,7 @@ const TreeNodeRenderer: React.FC<TreeNodeRendererProps> = ({
         <div
           className="side-action-container"
           role="menu"
+          tabIndex={0}

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Inaccessible keyboard focus target</b></div>
   <div id="fix">
   
   The parent container has `role="menu"` and now `tabIndex={0}`, making it 
focusable via Tab key. However, there's no `onKeyDown` handler, so keyboard 
users will land on this element but find no way to interact with it. The 
contained `ActionButton` components show `.action-hover` only on CSS 
`:hover`/`[data-selected='true']`, which won't trigger when the container is 
keyboard-focused. Either add keyboard event handling or remove `tabIndex={0}` 
to avoid creating an inaccessible focus target. ([WAI-ARIA menu 
pattern](https://www.w3.org/WAI/ARIA/apg/patterns/menu/))
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #a839a5</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



##########
superset-frontend/src/components/Chart/DrillDetail/DrillDetailTableControls.tsx:
##########
@@ -163,6 +163,7 @@ export default function TableControls({
             iconSize="l"
             aria-label={t('Reload')}
             role="button"
+            tabIndex={0}

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Missing keyboard activation handler</b></div>
   <div id="fix">
   
   The reload button has `tabIndex={0}` making it keyboard-focusable, but lacks 
`onKeyDown` to handle activation. Users tabbing to this button cannot trigger 
it with Enter or Space keys. Add a handler that calls `onReload` on Enter/Space 
press.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #a839a5</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



##########
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/ItemTitleContainer.tsx:
##########
@@ -139,6 +139,7 @@ const ItemTitleContainer = forwardRef<HTMLDivElement, 
Props>(
         <ItemTitle
           role="tab"
           key={`item-title-tab-${id}`}
+          tabIndex={0}

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>CWE-1035: Incomplete keyboard support for ARIA 
tab</b></div>
   <div id="fix">
   
   The `role="tab"` element should support keyboard activation by adding an 
`onKeyDown` handler that calls `onChange(id)` when Enter or Space is pressed, 
e.g., `onKeyDown={e => { if (e.key === 'Enter' || e.key === ' ') { 
e.preventDefault(); onChange(id); } }}`. (See also: 
[CWE-1035](https://cwe.mitre.org/data/definitions/1035.html))
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #a839a5</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



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