Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions packages/ui/src/views/canvas/CanvasHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ const CanvasHeader = ({ chatflow, isAgentCanvas, isAgentflowV2, handleSaveFlow,
</Typography>
{chatflow?.id && (
<Available permission={savePermission}>
<ButtonBase title='Edit Name' sx={{ borderRadius: '50%' }}>
<ButtonBase title='Edit Name' sx={{ borderRadius: '50%' }} onClick={() => setEditingFlowName(true)}>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

While this change correctly improves keyboard accessibility for this button, the fix is incomplete. Several other buttons in this component still have the onClick handler on the Avatar instead of the ButtonBase. To fully address the accessibility issue, please apply the same fix to the following buttons:

  • 'Back' button (lines 256-281)
  • 'Save Name' button (lines 343-363)
  • 'Cancel' button (lines 364-384)

<Avatar
variant='rounded'
sx={{
Expand All @@ -313,7 +313,6 @@ const CanvasHeader = ({ chatflow, isAgentCanvas, isAgentflowV2, handleSaveFlow,
}
}}
color='inherit'
onClick={() => setEditingFlowName(true)}
>
<IconPencil stroke={1.5} size='1.3rem' />
</Avatar>
Expand Down Expand Up @@ -389,7 +388,7 @@ const CanvasHeader = ({ chatflow, isAgentCanvas, isAgentflowV2, handleSaveFlow,
</Stack>
<Box>
{chatflow?.id && (
<ButtonBase title='API Endpoint' sx={{ borderRadius: '50%', mr: 2 }}>
<ButtonBase title='API Endpoint' sx={{ borderRadius: '50%', mr: 2 }} onClick={onAPIDialogClick}>
<Avatar
variant='rounded'
sx={{
Expand All @@ -404,14 +403,13 @@ const CanvasHeader = ({ chatflow, isAgentCanvas, isAgentflowV2, handleSaveFlow,
}
}}
color='inherit'
onClick={onAPIDialogClick}
>
<IconCode stroke={1.5} size='1.3rem' />
</Avatar>
</ButtonBase>
)}
<Available permission={savePermission}>
<ButtonBase title={`Save ${title}`} sx={{ borderRadius: '50%', mr: 2 }}>
<ButtonBase title={`Save ${title}`} sx={{ borderRadius: '50%', mr: 2 }} onClick={onSaveChatflowClick}>
<Avatar
variant='rounded'
sx={{
Expand All @@ -426,13 +424,12 @@ const CanvasHeader = ({ chatflow, isAgentCanvas, isAgentflowV2, handleSaveFlow,
}
}}
color='inherit'
onClick={onSaveChatflowClick}
>
<IconDeviceFloppy stroke={1.5} size='1.3rem' />
</Avatar>
</ButtonBase>
</Available>
<ButtonBase ref={settingsRef} title='Settings' sx={{ borderRadius: '50%' }}>
<ButtonBase ref={settingsRef} title='Settings' sx={{ borderRadius: '50%' }} onClick={() => setSettingsOpen(!isSettingsOpen)}>
<Avatar
variant='rounded'
sx={{
Expand All @@ -446,7 +443,6 @@ const CanvasHeader = ({ chatflow, isAgentCanvas, isAgentflowV2, handleSaveFlow,
color: theme.palette.canvasHeader.settingsLight
}
}}
onClick={() => setSettingsOpen(!isSettingsOpen)}
>
<IconSettings stroke={1.5} size='1.3rem' />
</Avatar>
Expand Down