-
+
!book.deletedAt) ? ( = ({ bookKeys, onCloseBook }) => { + const _ = useTranslation(); const { appService } = useEnv(); const { getConfig, getBookData } = useBookDataStore(); const { getProgress, getViewState, getViewSettings } = useReaderStore(); @@ -75,6 +77,8 @@ const BooksGrid: React.FC = ({ bookKeys, onCloseBook }) => { gridTemplateColumns: gridTemplate.columns, gridTemplateRows: gridTemplate.rows, }} + role='main' + aria-label={_('Books Grid')} > {bookKeys.map((bookKey, index) => { const bookData = getBookData(bookKey); diff --git a/apps/readest-app/src/app/reader/components/FoliateViewer.tsx b/apps/readest-app/src/app/reader/components/FoliateViewer.tsx index a8933b15..e006c693 100644 --- a/apps/readest-app/src/app/reader/components/FoliateViewer.tsx +++ b/apps/readest-app/src/app/reader/components/FoliateViewer.tsx @@ -15,6 +15,8 @@ import { usePagination } from '../hooks/usePagination'; import { useFoliateEvents } from '../hooks/useFoliateEvents'; import { useProgressSync } from '../hooks/useProgressSync'; import { useProgressAutoSave } from '../hooks/useProgressAutoSave'; +import { useAutoFocus } from '@/hooks/useAutoFocus'; +import { useTranslation } from '@/hooks/useTranslation'; import { useKOSync } from '../hooks/useKOSync'; import { applyFixedlayoutStyles, @@ -62,6 +64,7 @@ const FoliateViewer: React.FC<{ gridInsets: Insets; contentInsets: Insets; }> = ({ bookKey, bookDoc, config, gridInsets, contentInsets: insets }) => { + const _ = useTranslation(); const { appService, envConfig } = useEnv(); const { themeCode, isDarkMode } = useThemeStore(); const { settings } = useSettingsStore(); @@ -81,6 +84,8 @@ const FoliateViewer: React.FC<{ const [loading, setLoading] = useState(false); const docLoaded = useRef(false); + useAutoFocus({ ref: containerRef }); + useEffect(() => { const timer = setTimeout(() => setToastMessage(''), 2000); return () => clearTimeout(timer); @@ -410,7 +415,10 @@ const FoliateViewer: React.FC<{ <>
diff --git a/apps/readest-app/src/app/reader/components/FooterBar.tsx b/apps/readest-app/src/app/reader/components/FooterBar.tsx index a8d5a6ff..72025b84 100644 --- a/apps/readest-app/src/app/reader/components/FooterBar.tsx +++ b/apps/readest-app/src/app/reader/components/FooterBar.tsx @@ -173,7 +173,8 @@ const FooterBar: React.FC = ({ return ( <>