Commit 67d35d28 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix grid cells not filling: flex chain passes height down to surface

The facility-surface grid wasn't stretching to fill available viewport
height because intermediate wrappers broke the flex chain. Now all
parent divs propagate flex-1 and the grid uses 1fr rows.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 8a81093e
...@@ -293,7 +293,7 @@ class="relative border rounded-xl p-3 sm:p-4 text-start transition-all hover:sha ...@@ -293,7 +293,7 @@ class="relative border rounded-xl p-3 sm:p-4 text-start transition-all hover:sha
</div> </div>
{{-- Grid Area --}} {{-- Grid Area --}}
<div class="flex-1 overflow-auto p-3 sm:p-4"> <div class="flex-1 overflow-auto p-3 sm:p-4 flex flex-col">
@if(!empty($gridSegments)) @if(!empty($gridSegments))
@php @php
$maxRow = collect($gridSegments)->max('row') ?? 0; $maxRow = collect($gridSegments)->max('row') ?? 0;
...@@ -304,9 +304,9 @@ class="relative border rounded-xl p-3 sm:p-4 text-start transition-all hover:sha ...@@ -304,9 +304,9 @@ class="relative border rounded-xl p-3 sm:p-4 text-start transition-all hover:sha
$surfaceType = $facility->type->value ?? 'other'; $surfaceType = $facility->type->value ?? 'other';
@endphp @endphp
<div class="overflow-x-auto"> <div class="overflow-x-auto flex-1 flex flex-col">
<div class="facility-surface facility-surface--{{ $surfaceType }} min-w-[400px]" <div class="facility-surface facility-surface--{{ $surfaceType }} min-w-[400px] flex-1"
style="grid-template-columns: repeat({{ $cols }}, minmax(0, 1fr)); {{ $isGrid ? 'grid-template-rows: repeat(' . $rows . ', minmax(120px, 1fr))' : '' }}"> style="grid-template-columns: repeat({{ $cols }}, minmax(0, 1fr)); grid-template-rows: repeat({{ $rows }}, 1fr);">
@foreach($gridSegments as $seg) @foreach($gridSegments as $seg)
@php @php
$segAssignment = collect($assignments)->first(fn($a) => in_array($seg['id'], $a['segment_ids'] ?? [])); $segAssignment = collect($assignments)->first(fn($a) => in_array($seg['id'], $a['segment_ids'] ?? []));
...@@ -324,7 +324,7 @@ class="relative border rounded-xl p-3 sm:p-4 text-start transition-all hover:sha ...@@ -324,7 +324,7 @@ class="relative border rounded-xl p-3 sm:p-4 text-start transition-all hover:sha
'facility-cell--selected': selectedSegments.includes({{ $seg['id'] }}), 'facility-cell--selected': selectedSegments.includes({{ $seg['id'] }}),
'facility-cell--drop-target': highlightedSegment === {{ $seg['id'] }}, 'facility-cell--drop-target': highlightedSegment === {{ $seg['id'] }},
}" }"
class="relative border-e border-b p-3 min-h-[120px] flex flex-col transition-all duration-150 cursor-pointer class="relative border-e border-b p-3 flex flex-col transition-all duration-150 cursor-pointer
{{ !$seg['available'] ? 'facility-cell--unavailable cursor-not-allowed opacity-50' : '' }} {{ !$seg['available'] ? 'facility-cell--unavailable cursor-not-allowed opacity-50' : '' }}
{{ $isExisting ? 'bg-blue-500/15' : '' }} {{ $isExisting ? 'bg-blue-500/15' : '' }}
{{ $isNewGroup ? 'bg-emerald-500/15' : '' }} {{ $isNewGroup ? 'bg-emerald-500/15' : '' }}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment