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

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
2026-07-27 08:21:33 +03:00
parent bef029b858
commit 6306919ecd
2 changed files with 8 additions and 8 deletions
@@ -70,13 +70,16 @@ export function GenerateGridDialog({
return (
<Dialog open onOpenChange={(next) => !next && onClose()}>
<DialogContent className="max-w-3xl">
{/* Окно не выше экрана: список слотов на неделю длинный, и без ограничения диалог вылезал
за оба края — верх с выбором профиля становился недостижим. Скроллится тело, шапка
и кнопки остаются на месте. */}
<DialogContent className="flex max-h-[90vh] max-w-3xl flex-col">
<DialogHeader>
<DialogTitle>{t('admin.channels.generate.title')}</DialogTitle>
<DialogDescription>{t('admin.channels.generate.hint')}</DialogDescription>
</DialogHeader>
<div className="flex flex-col gap-3 text-sm">
<div className="flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto pr-1 text-sm">
{/* Профиль — то, ради чего окно и открыли: ритм суток задаёт всё остальное. */}
<div className="grid gap-1.5 sm:grid-cols-2">
{(profiles ?? []).map((item) => (
@@ -151,7 +154,7 @@ export function GenerateGridDialog({
{plan.slots.length === 0 ? (
<p className="text-muted-foreground">{t('admin.channels.generate.nothing')}</p>
) : (
<ul className="crt-panel max-h-72 divide-y divide-border overflow-y-auto rounded-md text-xs">
<ul className="crt-panel divide-y divide-border rounded-md text-xs">
{plan.slots.map((slot, index) => (
<PlanRow key={`${slot.weekday}-${slot.start}-${index}`} slot={slot} />
))}