From 0a359aa7054e9dc817c727249f00683d6c4ebae3 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Fri, 30 Aug 2024 13:39:30 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=90=20a11y:=20Accessible=20Conversatio?= =?UTF-8?q?n=20Menu=20Options=20(#3864)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: type issues * feat: Fix document title setting in Conversation component * style: new chat theme * fix: No keyboard access to chat menus in the chat history #3788 * fix: Menu button in the chat history area does not indicate its state #3823 * refactor: use ariakit for DropdownPopup * style: update sticky z-index in NewChat component * style: update ConvoOptions menu button styling --- .../components/Chat/ExportAndShareMenu.tsx | 22 +-- client/src/components/Conversations/Convo.tsx | 69 ++++++---- .../ConvoOptions/ConvoOptions.tsx | 27 ++-- client/src/components/Nav/NewChat.tsx | 8 +- client/src/components/ui/DropdownPopup.tsx | 126 +++++++----------- client/src/localization/languages/Eng.ts | 1 + 6 files changed, 122 insertions(+), 131 deletions(-) diff --git a/client/src/components/Chat/ExportAndShareMenu.tsx b/client/src/components/Chat/ExportAndShareMenu.tsx index a550bf3564..7ef6c2ba2d 100644 --- a/client/src/components/Chat/ExportAndShareMenu.tsx +++ b/client/src/components/Chat/ExportAndShareMenu.tsx @@ -1,9 +1,10 @@ -import { useState } from 'react'; -import { Upload, Share2 } from 'lucide-react'; +import { useState, useId } from 'react'; import { useRecoilValue } from 'recoil'; +import * as Ariakit from '@ariakit/react'; +import { Upload, Share2 } from 'lucide-react'; import { ShareButton } from '~/components/Conversations/ConvoOptions'; -import { Button, DropdownPopup } from '~/components/ui'; import { useMediaQuery, useLocalize } from '~/hooks'; +import { DropdownPopup } from '~/components/ui'; import { ExportModal } from '../Nav'; import store from '~/store'; @@ -13,11 +14,13 @@ export default function ExportAndShareMenu({ isSharedButtonEnabled: boolean; }) { const localize = useLocalize(); - const conversation = useRecoilValue(store.conversationByIndex(0)); - const [isPopoverActive, setIsPopoverActive] = useState(false); const [showExports, setShowExports] = useState(false); + const [isPopoverActive, setIsPopoverActive] = useState(false); const [showShareDialog, setShowShareDialog] = useState(false); + + const menuId = useId(); const isSmallScreen = useMediaQuery('(max-width: 768px)'); + const conversation = useRecoilValue(store.conversationByIndex(0)); const exportable = conversation && @@ -60,20 +63,19 @@ export default function ExportAndShareMenu({ return ( <>