refactor: replace split-panel with overlay Drawer on Properties and FutureAvailability

650px right Drawer overlays the list instead of compressing it — full list always visible, detail panel has adequate space.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Sutter
2026-05-16 21:25:08 +02:00
parent 2e68638246
commit e13fe470fb
2 changed files with 59 additions and 73 deletions
+11 -17
View File
@@ -1,5 +1,5 @@
import { useState } from 'react' import { useState } from 'react'
import { Box, Chip, Paper, Typography } from '@mui/material' import { Box, Chip, Drawer, Typography } from '@mui/material'
import { useFutureSignals } from '../../hooks/useFutureSignals' import { useFutureSignals } from '../../hooks/useFutureSignals'
import { import {
FutureSignalCard, FutureSignalCard,
@@ -94,9 +94,7 @@ export default function FutureAvailability() {
filteredCount={filtered.length} filteredCount={filtered.length}
/> />
{/* Body */} {/* Signal list — always full width */}
<Box sx={{ flex: 1, display: 'flex', overflow: 'hidden' }}>
{/* Signal list */}
<Box sx={{ flex: 1, overflowY: 'auto', bgcolor: '#f8fafc' }}> <Box sx={{ flex: 1, overflowY: 'auto', bgcolor: '#f8fafc' }}>
{isLoading ? ( {isLoading ? (
<Box sx={{ p: 3 }}> <Box sx={{ p: 3 }}>
@@ -107,7 +105,7 @@ export default function FutureAvailability() {
) : filtered.length === 0 ? ( ) : filtered.length === 0 ? (
<FutureSignalEmptyState context={signals.length === 0 ? 'no-signals' : 'filtered-empty'} /> <FutureSignalEmptyState context={signals.length === 0 ? 'no-signals' : 'filtered-empty'} />
) : ( ) : (
<Box sx={{ bgcolor: 'white', borderRight: '1px solid #e2e8f0' }}> <Box sx={{ bgcolor: 'white' }}>
{filtered.map(signal => ( {filtered.map(signal => (
<FutureSignalCard <FutureSignalCard
key={signal.id} key={signal.id}
@@ -120,24 +118,20 @@ export default function FutureAvailability() {
)} )}
</Box> </Box>
{/* Detail panel */} {/* Detail drawer */}
<Drawer
anchor="right"
open={!!selectedSignal}
onClose={() => setSelectedSignal(null)}
slotProps={{ paper: { sx: { width: 650, boxShadow: '-4px 0 24px rgba(0,0,0,0.10)' } } }}
>
{selectedSignal && ( {selectedSignal && (
<Paper elevation={0} sx={{
width: 360,
flexShrink: 0,
display: 'flex',
flexDirection: 'column',
borderRadius: 0,
borderLeft: '1px solid #e2e8f0',
overflow: 'hidden',
}}>
<FutureSignalDetailPanel <FutureSignalDetailPanel
signal={selectedSignal} signal={selectedSignal}
onClose={() => setSelectedSignal(null)} onClose={() => setSelectedSignal(null)}
/> />
</Paper>
)} )}
</Box> </Drawer>
</Box> </Box>
) )
} }
+8 -16
View File
@@ -1,5 +1,5 @@
import { useState } from 'react' import { useState } from 'react'
import { Box } from '@mui/material' import { Box, Drawer } from '@mui/material'
import { PageHeader } from '../../components/layout' import { PageHeader } from '../../components/layout'
import { useProperties } from '../../hooks/useProperties' import { useProperties } from '../../hooks/useProperties'
import { PropertyFilterBar, PropertyTable, PropertyDetailView } from '../../components/supply' import { PropertyFilterBar, PropertyTable, PropertyDetailView } from '../../components/supply'
@@ -59,8 +59,6 @@ export default function Properties() {
/> />
<PropertyFilterBar filters={filters} onFiltersChange={setFilters} /> <PropertyFilterBar filters={filters} onFiltersChange={setFilters} />
<Box sx={{ display: 'flex', flex: 1, overflow: 'hidden' }}>
{/* Table */}
<Box sx={{ flex: 1, overflowY: 'auto' }}> <Box sx={{ flex: 1, overflowY: 'auto' }}>
<PropertyTable <PropertyTable
properties={filtered} properties={filtered}
@@ -73,22 +71,16 @@ export default function Properties() {
/> />
</Box> </Box>
{/* Detail panel */} <Drawer
{selectedId && ( anchor="right"
<Box open={!!selectedId}
sx={{ onClose={() => setSelectedId(null)}
width: 480, slotProps={{ paper: { sx: { width: 650, boxShadow: '-4px 0 24px rgba(0,0,0,0.10)' } } }}
flexShrink: 0,
borderLeft: '1px solid #e2e8f0',
overflow: 'hidden',
display: 'flex',
flexDirection: 'column',
}}
> >
{selectedId && (
<PropertyDetailView propertyId={selectedId} onClose={() => setSelectedId(null)} /> <PropertyDetailView propertyId={selectedId} onClose={() => setSelectedId(null)} />
</Box>
)} )}
</Box> </Drawer>
</Box> </Box>
) )
} }