From 6306919ecd9f59dcfc183557c929f3f0cc277680 Mon Sep 17 00:00:00 2001 From: Leonid Pershin Date: Mon, 27 Jul 2026 08:21:33 +0300 Subject: [PATCH] Refactor GridPlanner and GenerateGridDialog for improved functionality and UI Updated the GridPlanner class to streamline fallback group handling by removing unnecessary notes and clarifying comments. Enhanced the GenerateGridDialog component to limit its height for better usability, ensuring that the dialog remains accessible even with long slot lists. Adjusted layout properties to improve scrolling behavior and overall user experience. --- .../Programming/Templates/Generate/GridPlanner.cs | 7 ++----- .../admin/channels/components/GenerateGridDialog.tsx | 9 ++++++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/src/TeleWave.Application/Programming/Templates/Generate/GridPlanner.cs b/backend/src/TeleWave.Application/Programming/Templates/Generate/GridPlanner.cs index 88ca380..8c3edba 100644 --- a/backend/src/TeleWave.Application/Programming/Templates/Generate/GridPlanner.cs +++ b/backend/src/TeleWave.Application/Programming/Templates/Generate/GridPlanner.cs @@ -79,13 +79,10 @@ public sealed class GridPlanner( .Week.SelectMany(day => GridCoverage.Gaps(existing, day, run.DayStart)) .Sum(gap => gap.To - gap.From); + // Аварийная группа отдаётся отдельным полем, а не замечанием: замечания — про то, что пошло + // не так, а это штатное действие, и в предпросмотре у него своя строка. var fallback = groups.MaxBy(g => g.UnitCount); var needsFallback = template.FallbackGroupId is null && fallback is not null; - if (needsFallback) - run.Note( - $"Аварийной группы у сетки не было — ею станет «{fallback!.Name}»: без неё паузы " - + "между слотами останутся пустыми." - ); var everyDaySpan = mode == GridGenerationMode.Rebuild && profile.Weekend.Count > 0 ? 5 : 7; var covered = slots.Sum(s => s.DurationMinutes * (s.Weekday is null ? everyDaySpan : 1)); diff --git a/frontend/src/features/admin/channels/components/GenerateGridDialog.tsx b/frontend/src/features/admin/channels/components/GenerateGridDialog.tsx index 11c6d74..4fb30d6 100644 --- a/frontend/src/features/admin/channels/components/GenerateGridDialog.tsx +++ b/frontend/src/features/admin/channels/components/GenerateGridDialog.tsx @@ -70,13 +70,16 @@ export function GenerateGridDialog({ return ( !next && onClose()}> - + {/* Окно не выше экрана: список слотов на неделю длинный, и без ограничения диалог вылезал + за оба края — верх с выбором профиля становился недостижим. Скроллится тело, шапка + и кнопки остаются на месте. */} + {t('admin.channels.generate.title')} {t('admin.channels.generate.hint')} -
+
{/* Профиль — то, ради чего окно и открыли: ритм суток задаёт всё остальное. */}
{(profiles ?? []).map((item) => ( @@ -151,7 +154,7 @@ export function GenerateGridDialog({ {plan.slots.length === 0 ? (

{t('admin.channels.generate.nothing')}

) : ( -
    +
      {plan.slots.map((slot, index) => ( ))}