Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix(a11y): give the scroll-to-bottom button an accessible name (#9160)

thinhlpg091adb56f42c
diff --git a/web-app/src/components/ai-elements/conversation.tsx b/web-app/src/components/ai-elements/conversation.tsx
index 7240dbf23..ae1e11488 100644
--- a/web-app/src/components/ai-elements/conversation.tsx
+++ b/web-app/src/components/ai-elements/conversation.tsx
@@ -1,5 +1,6 @@
import { Button } from '@/components/ui/button'
import { cn } from '@/lib/utils'
+import { useTranslation } from '@/i18n/react-i18next-compat'
import { IconArrowDown } from '@tabler/icons-react'
import type { ComponentProps } from 'react'
import { useCallback, memo } from 'react'
@@ -71,6 +72,7 @@ export const ConversationScrollButton = ({
className,
...props
}: ConversationScrollButtonProps) => {
+ const { t } = useTranslation()
const { isAtBottom, scrollToBottom } = useStickToBottomContext()
const handleScrollToBottom = useCallback(() => {
@@ -88,9 +90,11 @@ export const ConversationScrollButton = ({
size="icon"
type="button"
variant="outline"
+ aria-label={t('common:scrollToBottom')}
+ title={t('common:scrollToBottom')}
{...props}
>
- <IconArrowDown className="size-4" />
+ <IconArrowDown className="size-4" aria-hidden="true" />
</Button>
)
)