Refactor GridScheduleGenerator and related components to improve cursor management and group handling
ci / build-backend (push) Successful in 1m17s
ci / build-frontend (push) Successful in 56s
ci / tests (push) Successful in 1m29s
ci / sonar (push) Successful in 3m34s

Updated the GridScheduleGenerator to reset cursors for slots with no aired positions, ensuring proper state management during rebuilds. Introduced a new method, ResetUnairedCursorsAsync, to handle cursor resets effectively. Enhanced the handling of interstitial groups in the scheduling process, preventing them from being included in slots or fallback groups. Updated related tests to verify the correct behavior of these changes, ensuring robust scheduling logic and accurate group categorization.
This commit is contained in:
Leonid Pershin
2026-07-30 09:55:14 +03:00
parent 5032614773
commit 398b60facc
14 changed files with 317 additions and 31 deletions
@@ -10,6 +10,19 @@ function EntryLabel({ entry }: Readonly<{ entry: ScheduleEntryDto }>) {
if (entry.kind === 'Ad') return <Badge variant="muted">{t('air.ad')}</Badge>
// Аварийный запас и конец вещания подписаны отдельно: у них есть и шоу, и номер серии, и без
// метки полоса роликов из аварийной группы читается как обычная программа — то есть как будто
// сетка так и задумана, хотя на деле это дыра.
if (entry.kind === 'Fallback' || entry.kind === 'SignOff')
return (
<span className="flex min-w-0 items-center gap-2">
<Badge variant="muted" className="shrink-0">
{t(entry.kind === 'Fallback' ? 'air.fallback' : 'air.signOff')}
</Badge>
<span className="min-w-0 truncate text-muted-foreground">{entry.showName ?? '—'}</span>
</span>
)
if (entry.kind === 'Bumper')
return (
<span className="flex min-w-0 items-center gap-2">