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:
@@ -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} />
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user