Refactor GridPlanner and GenerateGridDialog for improved functionality and UI
ci / tests (push) Successful in 2m48s
ci / sonar (push) Successful in 6m30s
ci / build-backend (push) Successful in 2m28s
ci / build-frontend (push) Successful in 1m8s

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.
This commit is contained in:
Leonid Pershin committed 2026-07-27 08:21:33 +03:00
1 parent bef029b858
commit 6306919ecd
2 files changed
+8 -8

No files matched your search

@@ -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));