diff --git a/src/components/AppShell.tsx b/src/components/AppShell.tsx index dacb5d09..e6fa6374 100644 --- a/src/components/AppShell.tsx +++ b/src/components/AppShell.tsx @@ -1,5 +1,6 @@ import { useCallback, useContext, useEffect, useRef, useState } from 'react' import { cn } from '@/lib/utils' +import { useIsMobile } from '@/hooks/use-mobile' import { Outlet, Link, useLocation, useNavigate } from 'react-router' import { CanAccess, @@ -443,7 +444,7 @@ function AppSidebar() { - {/* Footer links — hidden when collapsed */} + {/* Footer links + version — hidden when collapsed */} {!collapsed && (
{FOOTER_LINKS.map(({ label, href }) => ( @@ -455,18 +456,13 @@ function AppSidebar() { {label} ))} -
- )} - - - - {!collapsed && ( -
- + v{pkg.version}
)} + +
) @@ -594,6 +590,7 @@ function getBrowser(): string { function SupportPanel() { const { isOpen, close } = useContext(SupportPanelContext) + const isMobile = useIsMobile() const { data: user } = useGetIdentity<{ name: string; email: string }>() const location = useLocation() @@ -722,23 +719,12 @@ function SupportPanel() { const pageUrl = location.pathname - return ( + const panelBody = (
- {/* Drag handle */} -
- -
{/* Panel header */}
@@ -1017,6 +1003,36 @@ function SupportPanel() { )}
+ ) + + if (isMobile) { + if (!isOpen) return null + + return ( +
+ {panelBody} +
+ ) + } + + return ( +
+
+ {panelBody}
) } @@ -1146,14 +1162,14 @@ function ShellHeader() {
- {/* Search bar — hidden on mobile, visible sm+ */} -
+ {/* Search bar — hidden on mobile, visible tablet+ */} +
{/* Mobile search icon */} @@ -1246,7 +1261,6 @@ function SidebarAutoCollapse() { function AppShellInner({ children }: { children?: React.ReactNode }) { const { open: sidebarOpen, setOpen: setSidebarOpen } = useSidebar() const [panelOpen, setPanelOpen] = useState(false) - // Remember whether the sidebar was open when the panel was triggered const sidebarWasOpen = useRef(false) const openPanel = () => { @@ -1261,7 +1275,9 @@ function AppShellInner({ children }: { children?: React.ReactNode }) { } return ( - + diff --git a/src/components/OcotilloPageHeader.tsx b/src/components/OcotilloPageHeader.tsx index db796c39..872e24bc 100644 --- a/src/components/OcotilloPageHeader.tsx +++ b/src/components/OcotilloPageHeader.tsx @@ -1,5 +1,6 @@ import type { ReactNode } from 'react' import { Box, Skeleton, SxProps, Theme, Typography } from '@mui/material' +import { cn } from '@/lib/utils' /** Shared CardHeader layout for Ocotillo list and show pages. */ export const ocotilloCardHeaderProps: { sx: SxProps } = { @@ -9,11 +10,13 @@ export const ocotilloCardHeaderProps: { sx: SxProps } = { gap: { xs: 1.5, md: 3 }, '.MuiCardHeader-content': { alignSelf: 'flex-start', + minWidth: 0, }, '.MuiCardHeader-action': { alignSelf: { xs: 'flex-end', md: 'flex-start' }, mr: 0, pt: { xs: 0.5, md: 1 }, + maxWidth: '100%', }, }, } @@ -69,6 +72,14 @@ export function OcotilloHeaderButtons({ className?: string }) { return ( -
{children}
+
+ {children} +
) } diff --git a/src/components/card/CoreWellInfo.tsx b/src/components/card/CoreWellInfo.tsx index a7f8a441..cd139dab 100644 --- a/src/components/card/CoreWellInfo.tsx +++ b/src/components/card/CoreWellInfo.tsx @@ -1,6 +1,27 @@ import { Box, Paper, Skeleton, Typography } from '@mui/material' +import { CORE_WELL_INFO_STATS_MIN_PX } from '@/constants/breakpoints' import { IWell } from '@/interfaces/ocotillo' +const statCellSx = (index: number) => ({ + px: 2, + py: 1.5, + borderColor: 'divider', + borderTop: index > 0 ? '1px solid' : 'none', + borderLeft: 'none', + [`@container (min-width: ${CORE_WELL_INFO_STATS_MIN_PX}px)`]: { + borderTop: 'none', + borderLeft: index > 0 ? '1px solid' : 'none', + }, +}) + +const statsGridSx = { + display: 'grid', + gridTemplateColumns: '1fr', + [`@container (min-width: ${CORE_WELL_INFO_STATS_MIN_PX}px)`]: { + gridTemplateColumns: 'repeat(3, 1fr)', + }, +} as const + export const CoreWellInfoCard = ({ well }: { well?: IWell }) => { if (!well) { return @@ -34,18 +55,13 @@ export const CoreWellInfoCard = ({ well }: { well?: IWell }) => { ] return ( - - + + {stats.map((stat, i) => ( - 0 ? '1px solid' : 'none', - borderColor: 'divider', - }} - > + { } const LoadingBar = () => ( - - + + {Array.from({ length: 3 }).map((_, i) => ( - 0 ? '1px solid' : 'none', - borderColor: 'divider', - }} - > + diff --git a/src/components/editing/EditPanelLayout.tsx b/src/components/editing/EditPanelLayout.tsx index 4cb8acad..4f891d73 100644 --- a/src/components/editing/EditPanelLayout.tsx +++ b/src/components/editing/EditPanelLayout.tsx @@ -57,50 +57,51 @@ export function EditPanelLayout({ useEditPanelWidth(resizeEnabled) if (pinPanel === 'sticky') { + const showPanelShell = open || !isMobile + return (
{children}
- {isMobile ? ( - open ? ( -
- {panel} -
- ) : null - ) : ( + {showPanelShell ? (
+ {!isMobile && open && resizeEnabled ? ( + + ) : null} {open ? (
- {resizeEnabled ? ( - - ) : null} {panel}
) : null}
- )} + ) : null}
) } diff --git a/src/components/ui/sidebar.tsx b/src/components/ui/sidebar.tsx index 64c84189..9048df98 100644 --- a/src/components/ui/sidebar.tsx +++ b/src/components/ui/sidebar.tsx @@ -187,7 +187,7 @@ function Sidebar({ return (