Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export function ApplyActions(props: ApplyActionsProps) {
<div className="flex items-center">
<ToolbarButtonWithTooltip
data-testid="codeblock-toolbar-reject"
aria-label="Reject all diffs"
onClick={onClickReject}
tooltipContent={`Reject all (${getMetaKeyLabel()}⇧⌫)`}
>
Expand All @@ -47,6 +48,7 @@ export function ApplyActions(props: ApplyActionsProps) {

<ToolbarButtonWithTooltip
data-testid="codeblock-toolbar-accept"
aria-label="Accept all diffs"
onClick={props.onClickAccept}
tooltipContent={`Accept all (${getMetaKeyLabel()}⇧⏎)`}
>
Expand All @@ -69,6 +71,7 @@ export function ApplyActions(props: ApplyActionsProps) {
>
<button
data-testid="codeblock-toolbar-apply"
aria-label="Apply changes"
className="text-lightgray flex cursor-pointer items-center border-none bg-transparent pl-0 text-xs outline-none hover:brightness-125"
onClick={props.onClickApply}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export function CopyButton({ text }: CopyButtonProps) {
<ToolTip place="top" content="Copy Code">
<HoverItem className="!p-0">
<div
role="button"
aria-label={copied ? "Code copied" : "Copy code block"}
className="text-lightgray flex cursor-pointer items-center border-none bg-transparent text-xs outline-none hover:brightness-125"
onClick={copyText}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export function CreateFileButton({ onClick }: CreateFileButtonProps) {
<HoverItem className="!p-0">
<button
data-testid="codeblock-toolbar-create"
aria-label="Create file with code"
className={`text-lightgray flex items-center border-none bg-transparent pl-0 text-xs text-[${vscForeground}] cursor-pointer outline-none hover:brightness-125`}
onClick={onClick}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export function InsertButton({ onInsert }: InsertButtonProps) {
>
<ToolTip place="top" content="Insert Code">
<div
role="button"
aria-label="Insert at cursor"
className="text-lightgray flex cursor-pointer items-center border-none bg-transparent text-xs outline-none hover:brightness-125"
onClick={onInsert}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export function RunInTerminalButton({ command }: RunInTerminalButtonProps) {

return (
<div
role="button"
aria-label="Run command in terminal"
className={`text-lightgray flex items-center border-none bg-transparent text-xs text-[${vscForeground}] cursor-pointer outline-none hover:brightness-125`}
onClick={runInTerminal}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@ interface ToolbarButtonWithTooltipProps {
children: ReactNode;
tooltipContent: string;
"data-testid"?: string;
"aria-label"?: string;
}

export function ToolbarButtonWithTooltip({
onClick,
children,
tooltipContent,
"data-testid": testId,
"aria-label": ariaLabel,
}: ToolbarButtonWithTooltipProps) {
return (
<ToolTip place="top" content={tooltipContent}>
<div
role="button"
aria-label={ariaLabel ?? tooltipContent}
onClick={(e) => {
e.stopPropagation();
onClick();
Expand Down
2 changes: 2 additions & 0 deletions gui/src/components/gui/HeaderButtonWithToolTip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ interface HeaderButtonWithToolTipProps {
hoverBackgroundColor?: string;
tooltipPlacement?: PlacesType;
testId?: string;
"aria-label"?: string;
}

const HeaderButtonWithToolTip = React.forwardRef<
Expand All @@ -41,6 +42,7 @@ const HeaderButtonWithToolTip = React.forwardRef<
style={props.style}
ref={ref}
tabIndex={props.tabIndex}
aria-label={props["aria-label"] ?? props.text}
>
{props.children}
</HeaderButton>
Expand Down
Loading