Skip to content

Commit 0105ca7

Browse files
committed
fix(a11y): use KUI Button instead of native button for clickable regions
Wrapping content in a raw <button> bypasses KUI's focus/styling tokens. Use the KUI Button primitive instead: - ReportTraceModal: trace-card clickable -> <Button kind=tertiary> (copy button stays a sibling, no nesting). - FileTag: no-file clickable -> <Button kind=tertiary>. Signed-off-by: mschwab <mschwab@nvidia.com>
1 parent fb3f88f commit 0105ca7

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

web/packages/studio/src/components/FileTag/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import { Flex, Tag, TagProps } from '@nvidia/foundations-react-core';
4+
import { Button, Flex, Tag, TagProps } from '@nvidia/foundations-react-core';
55
import { CircleCheck, X, RefreshCw, CircleAlert as ErrorIcon } from 'lucide-react';
66
import { FC, ReactNode, MouseEventHandler } from 'react';
77

@@ -64,9 +64,9 @@ export const FileTag: FC<FileTagProps> = ({
6464
{onClick && <X />}
6565
</Tag>
6666
) : onNoFileClick ? (
67-
<button type="button" onClick={onNoFileClick} className="cursor-pointer">
67+
<Button kind="tertiary" onClick={onNoFileClick} className="h-auto p-0">
6868
{missingFileNameChip}
69-
</button>
69+
</Button>
7070
) : (
7171
<div>{missingFileNameChip}</div>
7272
)}

web/packages/studio/src/components/ReportTraceModal/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,9 @@ export const ReportTraceModal = ({ open, onClose }: ReportTraceModalProps) => {
229229
align="center"
230230
className="p-3 bg-surface-raised rounded-md border border-base"
231231
>
232-
<button
233-
type="button"
234-
className="flex-1 text-left cursor-pointer appearance-none focus:outline-none focus:ring-2 focus:ring-brand"
232+
<Button
233+
kind="tertiary"
234+
className="h-auto flex-1 justify-start p-0 text-left"
235235
aria-label={`View details for ${trace.message}`}
236236
onClick={() => handleViewDetails(trace)}
237237
>
@@ -252,7 +252,7 @@ export const ReportTraceModal = ({ open, onClose }: ReportTraceModalProps) => {
252252
</Text>
253253
)}
254254
</Stack>
255-
</button>
255+
</Button>
256256
<Button kind="tertiary" size="small" onClick={() => handleCopyTrace(trace)}>
257257
<Copy />
258258
</Button>

0 commit comments

Comments
 (0)