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
3 changes: 3 additions & 0 deletions src/_locales/de/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"Delete Conversation": "Konversation löschen",
"Clear conversations": "Konversationen löschen",
"Settings": "Einstellungen",
"Search": "Suchen",
"Search conversations...": "In Gesprächen suchen...",
"No conversations found": "Keine passenden Konversationen gefunden",
"Feature Pages": "Funktionsseiten",
"Keyboard Shortcuts": "Tastenkombinationen",
"Open Conversation Page": "Konversationsseite öffnen",
Expand Down
3 changes: 3 additions & 0 deletions src/_locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"Delete Conversation": "Delete Conversation",
"Clear conversations": "Clear conversations",
"Settings": "Settings",
"Search": "Search",
"Search conversations...": "Search conversations...",
"No conversations found": "No conversations found",
"Feature Pages": "Feature Pages",
"Keyboard Shortcuts": "Keyboard Shortcuts",
"Open Conversation Page": "Open Conversation Page",
Expand Down
3 changes: 3 additions & 0 deletions src/_locales/es/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"Delete Conversation": "Eliminar conversación",
"Clear conversations": "Borrar todas las conversaciones",
"Settings": "Configuración",
"Search": "Buscar",
"Search conversations...": "Buscar en las conversaciones...",
"No conversations found": "No se encontraron conversaciones coincidentes",
"Feature Pages": "Páginas de características",
"Keyboard Shortcuts": "Atajos de teclado",
"Open Conversation Page": "Abrir página de conversación independiente",
Expand Down
3 changes: 3 additions & 0 deletions src/_locales/fr/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"Delete Conversation": "Supprimer la conversation",
"Clear conversations": "Effacer les conversations",
"Settings": "Paramètres",
"Search": "Rechercher",
"Search conversations...": "Rechercher des conversations...",
"No conversations found": "Aucune conversation correspondante",
"Feature Pages": "Pages de fonctionnalités",
"Keyboard Shortcuts": "Raccourcis clavier",
"Open Conversation Page": "Ouvrir la page de conversation",
Expand Down
3 changes: 3 additions & 0 deletions src/_locales/in/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"Delete Conversation": "Hapus Percakapan",
"Clear conversations": "Hapus Percakapan",
"Settings": "Pengaturan",
"Search": "Cari",
"Search conversations...": "Cari di percakapan...",
"No conversations found": "Tidak ditemukan percakapan yang cocok",
"Feature Pages": "Halaman Fitur",
"Keyboard Shortcuts": "Pintasan Keyboard",
"Open Conversation Page": "Buka Halaman Percakapan",
Expand Down
3 changes: 3 additions & 0 deletions src/_locales/it/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"Delete Conversation": "Elimina la conversazione",
"Clear conversations": "Pulisci le conversazioni",
"Settings": "Impostazioni",
"Search": "Cerca",
"Search conversations...": "Cerca nelle conversazioni...",
"No conversations found": "Nessuna conversazione corrispondente",
"Feature Pages": "Pagine delle funzionalità",
"Keyboard Shortcuts": "Scorciatoie da tastiera",
"Open Conversation Page": "Apri la pagina della conversazione",
Expand Down
3 changes: 3 additions & 0 deletions src/_locales/ja/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"Delete Conversation": "会話を削除",
"Clear conversations": "会話をクリア",
"Settings": "設定",
"Search": "検索",
"Search conversations...": "会話内を検索...",
"No conversations found": "一致する会話が見つかりません",
"Feature Pages": "機能ページ",
"Keyboard Shortcuts": "キーボードショートカット",
"Open Conversation Page": "会話ページを開く",
Expand Down
3 changes: 3 additions & 0 deletions src/_locales/ko/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"Delete Conversation": "대화 삭제",
"Clear conversations": "대화 기록 지우기",
"Settings": "설정",
"Search": "검색",
"Search conversations...": "대화에서 검색...",
"No conversations found": "일치하는 대화가 없습니다",
"Feature Pages": "기능 페이지",
"Keyboard Shortcuts": "키보드 단축키 설정",
"Open Conversation Page": "대화 페이지 열기",
Expand Down
3 changes: 3 additions & 0 deletions src/_locales/pt/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"Delete Conversation": "Excluir Conversa",
"Clear conversations": "Limpar conversas",
"Settings": "Configurações",
"Search": "Pesquisar",
"Search conversations...": "Pesquisar nas conversas...",
"No conversations found": "Nenhuma conversa correspondente",
"Feature Pages": "Páginas de Recursos",
"Keyboard Shortcuts": "Atalhos de Teclado",
"Open Conversation Page": "Abrir Página de Conversa",
Expand Down
3 changes: 3 additions & 0 deletions src/_locales/ru/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"Delete Conversation": "Удалить беседу",
"Clear conversations": "Очистить историю бесед",
"Settings": "Настройки",
"Search": "Поиск",
"Search conversations...": "Искать в беседах...",
"No conversations found": "Подходящих бесед не найдено",
"Feature Pages": "Страницы функций",
"Keyboard Shortcuts": "Горячие клавиши",
"Open Conversation Page": "Открыть страницу бесед",
Expand Down
3 changes: 3 additions & 0 deletions src/_locales/tr/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"Delete Conversation": "Konuşmayı Sil",
"Clear conversations": "Konuşmaları temizle",
"Settings": "Ayarlar",
"Search": "Ara",
"Search conversations...": "Konuşmalarda ara...",
"No conversations found": "Eşleşen konuşma bulunamadı",
"Feature Pages": "Özellik Sayfaları",
"Keyboard Shortcuts": "Klavye Kısayolları",
"Open Conversation Page": "Konuşma Sayfasını Aç",
Expand Down
3 changes: 3 additions & 0 deletions src/_locales/zh-hans/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"Delete Conversation": "删除对话",
"Clear conversations": "清空记录",
"Settings": "设置",
"Search": "搜索",
"Search conversations...": "搜索对话内容...",
"No conversations found": "未找到匹配的聊天记录",
"Feature Pages": "功能页",
"Keyboard Shortcuts": "快捷键设置",
"Open Conversation Page": "打开独立对话页",
Expand Down
3 changes: 3 additions & 0 deletions src/_locales/zh-hant/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
"Delete Conversation": "刪除對話",
"Clear conversations": "清空對話記錄",
"Settings": "設定",
"Search": "搜尋",
"Search conversations...": "搜尋對話紀錄...",
"No conversations found": "沒有符合的對話紀錄",
"Feature Pages": "功能頁面",
"Keyboard Shortcuts": "快速鍵設定",
"Open Conversation Page": "開啟獨立對話頁面",
Expand Down
49 changes: 43 additions & 6 deletions src/components/DeleteButton/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ function DeleteButton({ onConfirm, size, text }) {
const { t } = useTranslation()
const [waitConfirm, setWaitConfirm] = useState(false)
const confirmRef = useRef(null)
const [confirming, setConfirming] = useState(false)
const isMountedRef = useRef(true)

useEffect(() => {
isMountedRef.current = true
return () => {
isMountedRef.current = false
}
}, [])

useEffect(() => {
if (waitConfirm) confirmRef.current.focus()
Expand All @@ -28,25 +37,53 @@ function DeleteButton({ onConfirm, size, text }) {
fontSize: '10px',
...(waitConfirm ? {} : { display: 'none' }),
}}
disabled={confirming}
aria-busy={confirming ? 'true' : 'false'}
aria-hidden={waitConfirm ? undefined : 'true'}
tabIndex={waitConfirm ? 0 : -1}
onMouseDown={(e) => {
e.preventDefault()
e.stopPropagation()
}}
onBlur={() => {
setWaitConfirm(false)
if (!confirming && isMountedRef.current) setWaitConfirm(false)
}}
onClick={() => {
setWaitConfirm(false)
onConfirm()
onClick={async (e) => {
if (confirming) return
e.preventDefault()
e.stopPropagation()
setConfirming(true)
try {
await onConfirm()
if (isMountedRef.current) setWaitConfirm(false)
} catch (err) {
// Keep confirmation visible to allow retry; optionally log
// eslint-disable-next-line no-console
console.error(err)
} finally {
if (isMountedRef.current) setConfirming(false)
}
}}
>
{t('Confirm')}
</button>
<span
title={text}
className="gpt-util-icon"
style={waitConfirm ? { display: 'none' } : {}}
onClick={() => {
role="button"
tabIndex={0}
aria-label={text}
aria-hidden={waitConfirm ? 'true' : undefined}
style={waitConfirm ? { visibility: 'hidden' } : {}}
onKeyDown={(e) => {
Comment on lines +73 to +78
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid aria-hidden on a focusable control

aria-hidden must not be applied to focusable/interactive elements. When hidden, remove it from the tab order.

-        role="button"
-        tabIndex={0}
+        role="button"
+        tabIndex={waitConfirm ? -1 : 0}
         aria-label={text}
-        aria-hidden={waitConfirm ? 'true' : undefined}
-        style={waitConfirm ? { visibility: 'hidden' } : {}}
+        aria-hidden={waitConfirm ? 'true' : undefined}
+        style={waitConfirm ? { visibility: 'hidden', pointerEvents: 'none' } : {}}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
role="button"
tabIndex={0}
aria-label={text}
aria-hidden={waitConfirm ? 'true' : undefined}
style={waitConfirm ? { visibility: 'hidden' } : {}}
onKeyDown={(e) => {
role="button"
tabIndex={waitConfirm ? -1 : 0}
aria-label={text}
aria-hidden={waitConfirm ? 'true' : undefined}
style={waitConfirm ? { visibility: 'hidden', pointerEvents: 'none' } : {}}
onKeyDown={(e) => {
🤖 Prompt for AI Agents
In src/components/DeleteButton/index.jsx around lines 63 to 68, the button
currently sets aria-hidden on a focusable control and uses visibility:hidden
while leaving it in the tab order; remove aria-hidden from the element and when
waitConfirm is true make it unfocusable by setting tabIndex to -1 (or
conditionally omit role/interactive attributes and render a non-interactive
element), and keep the visual hiding (visibility:hidden or display:none) so it
is not reachable by screen readers or keyboard navigation.

if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault()
e.stopPropagation()
setWaitConfirm(true)
}
}}
onClick={(e) => {
e.stopPropagation()
setWaitConfirm(true)
}}
>
Expand Down
1 change: 1 addition & 0 deletions src/config/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ export const defaultConfig = {
selectionToolsNextToInputBox: false,
alwaysPinWindow: false,
focusAfterAnswer: true,
independentPanelCollapsed: true,

apiKey: '', // openai ApiKey

Expand Down
Loading