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.
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user