Refactor Program.cs to use async Run method for improved performance. Update index.html to specify language attribute for accessibility. Enhance BumperTemplateEditor and ScheduleGrid components by replacing divs with buttons for better keyboard accessibility. Improve TemplatePreview sorting logic and optimize episode regex handling. Add close button to ToastItem for better user interaction. Update localization files to include 'close' translations. Refactor CardTitle to ensure screen reader compatibility by explicitly rendering children.
ci / build-backend (push) Successful in 1m34s
ci / build-frontend (push) Successful in 1m0s
ci / tests (push) Successful in 1m58s
ci / sonar (push) Successful in 4m13s

This commit is contained in:
Leonid Pershin
2026-07-26 22:35:36 +03:00
parent b0740503bb
commit 0f0657e523
14 changed files with 75 additions and 26 deletions
@@ -80,11 +80,16 @@ export function BumperTemplateEditor({
return (
<div className="flex flex-col gap-3 rounded-md border border-border bg-muted/30 p-4">
<div
className="flex cursor-pointer items-center justify-between gap-2"
onClick={() => setOpen((o) => !o)}
>
<div className="flex flex-wrap items-center gap-2">
{/* Сворачивание висит на кнопке, а не на всей строке: кликабельный div недоступен с клавиатуры.
Кнопка удаления при этом вынесена наружу — вложенная кнопка внутри кнопки недопустима,
и заодно ей больше не нужен stopPropagation. */}
<div className="flex items-center justify-between gap-2">
<button
type="button"
onClick={() => setOpen((o) => !o)}
aria-expanded={open}
className="flex flex-1 cursor-pointer flex-wrap items-center gap-2 text-left"
>
<ChevronDown
className={`h-4 w-4 shrink-0 text-muted-foreground transition-transform ${open ? 'rotate-180' : ''}`}
/>
@@ -95,16 +100,13 @@ export function BumperTemplateEditor({
? `${Math.round(template.audioDurationSeconds)} ${t('admin.channels.bumperSeconds')}`
: t('admin.channels.bumperDefaultDuration')}
</span>
</div>
</button>
{!template.isDefault && (
<Button
size="sm"
variant="destructive"
disabled={remove.isPending}
onClick={(e) => {
e.stopPropagation()
remove.mutate()
}}
onClick={() => remove.mutate()}
>
{t('common.delete')}
</Button>