Refactor RunPlayHistory to optimize play retrieval logic and enhance StoragePanelSkeleton accessibility
Updated the RunPlayHistory class to improve the logic for retrieving the latest play by using LINQ's Max method, ensuring that empty play lists are handled correctly. Additionally, modified the StoragePanelSkeleton component to replace the div with an output element for better accessibility, allowing screen readers to recognize the loading status more effectively.
This commit is contained in:
@@ -33,7 +33,9 @@ export function StoragePanelSkeleton() {
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-4" role="status" aria-label={t('common.loading')}>
|
||||
// <output> вместо role="status": у него та же роль нативно, и её видят читалки,
|
||||
// которые про ARIA-роль на div знают хуже.
|
||||
<output className="flex flex-col gap-4" aria-label={t('common.loading')}>
|
||||
<Card>
|
||||
<CardContent className="flex flex-col gap-4">
|
||||
<div className="flex flex-wrap items-center justify-between gap-2">
|
||||
@@ -92,6 +94,6 @@ export function StoragePanelSkeleton() {
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
</output>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user