Skip to content
Draft
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 @@ -49,7 +49,7 @@ describe('DebugInfo', () => {
it('renders a disabled trigger when debug info is unavailable', () => {
render(<DebugInfo />)

const trigger = screen.getByRole('button')
const trigger = screen.getByRole('button', { name: 'plugin.debugInfo.title' })
expect(trigger).toBeDisabled()
})

Expand All @@ -63,7 +63,7 @@ describe('DebugInfo', () => {
const user = userEvent.setup()
render(<DebugInfo />)

const trigger = screen.getByRole('button')
const trigger = screen.getByRole('button', { name: 'plugin.debugInfo.title' })
expect(trigger).toBeEnabled()

// Popover is closed initially — content not rendered yet
Expand Down
7 changes: 4 additions & 3 deletions web/app/components/plugins/plugin-page/debug-info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function DebugInfo({
const { t } = useTranslation()
const docLink = useDocLink()
const { data: info, isLoading } = useDebugKey()
const title = t(($) => $[`${i18nPrefix}.title`], { ns: 'plugin' })
const trigger = triggerContent ?? <span aria-hidden className="i-ri-bug-line size-4" />
const triggerClassNames = cn(
!triggerClassName && 'size-full p-2 text-components-button-secondary-text',
Expand All @@ -42,7 +43,7 @@ function DebugInfo({

if (!info) {
return (
<Button variant={triggerVariant} className={triggerClassNames} disabled>
<Button variant={triggerVariant} className={triggerClassNames} aria-label={title} disabled>
{trigger}
</Button>
)
Expand All @@ -52,7 +53,7 @@ function DebugInfo({
<Popover>
<PopoverTrigger
render={
<Button variant={triggerVariant} className={triggerClassNames}>
<Button variant={triggerVariant} className={triggerClassNames} aria-label={title}>
{trigger}
</Button>
}
Expand All @@ -62,7 +63,7 @@ function DebugInfo({
popupClassName="border-0 bg-transparent p-0 shadow-none"
>
<PluginSidecarPanel
title={t(($) => $[`${i18nPrefix}.title`], { ns: 'plugin' })}
title={title}
footer={
<div className="flex w-full shrink-0 flex-col items-start">
<div className="flex w-full shrink-0 items-center justify-end gap-2 px-4 pt-2 pb-4">
Expand Down