From ab343b0a7bfac3e47d48054330cce65c5aea6aed Mon Sep 17 00:00:00 2001 From: Maurice Date: Wed, 7 Oct 2026 22:06:40 +0200 Subject: [PATCH] fix(client): a phone turned sideways stays in the phone layout The phone shell was chosen by width alone, and most phones are wider than 767px in landscape, so turning one swapped the whole route tree for the desktop planner and an open sheet, its input and the map position were lost. The phone query now also covers a touch screen under 500px tall, which no tablet is. It lives in one place: the shell, the planner and todo hooks, the warnings banner, dialog focus and the stylesheets read it, and six components that measured the window once on mount now follow it. --- client/src/components/Collab/CollabNotes.tsx | 4 +- client/src/components/Files/FileManager.tsx | 2 +- client/src/components/Map/MapView.tsx | 11 +++-- client/src/components/Map/MapViewGL.tsx | 3 +- .../src/components/Planner/PlaceFormModal.tsx | 2 +- .../Planner/TransitJourneyModal.tsx | 3 +- .../components/Planner/TransitSearchPanel.tsx | 3 +- .../Planner/TripWarningsBanner.test.tsx | 14 +++--- .../components/Planner/TripWarningsBanner.tsx | 12 +---- .../src/components/Planner/transitDisplay.tsx | 3 +- client/src/components/Todo/useTodoList.ts | 9 +--- client/src/components/shared/dialogFocus.ts | 3 +- client/src/index.css | 8 ++-- client/src/mobile/useIsPhone.ts | 29 +++++++++--- .../pages/tripPlanner/useTripPlanner.test.tsx | 27 ++++++++---- .../src/pages/tripPlanner/useTripPlanner.ts | 9 +--- client/tests/unit/mobile/useIsPhone.test.ts | 44 +++++++++++++++++-- 17 files changed, 119 insertions(+), 67 deletions(-) diff --git a/client/src/components/Collab/CollabNotes.tsx b/client/src/components/Collab/CollabNotes.tsx index bcb729172..31331097b 100644 --- a/client/src/components/Collab/CollabNotes.tsx +++ b/client/src/components/Collab/CollabNotes.tsx @@ -24,6 +24,7 @@ import { NoteCard } from './CollabNotesCard' import { FilePreviewPortal } from './CollabNotesFilePreviewPortal' import { AuthedImg } from './CollabNotesAuthedImg' import { safeExternalHref } from '../../utils/safeUrl' +import { useIsPhone } from '../../mobile/useIsPhone' // ── Main Component ────────────────────────────────────────────────────────── interface CollabNotesProps { @@ -343,6 +344,7 @@ function CollabNotesGrid(S: NotesState) { sortedNotes, currentUser, canEdit, handleUpdateNote, setPendingDeleteNoteId, setEditingNote, setViewingNote, setPreviewFile, getCategoryColor, tripId, t, } = S + const isPhone = useIsPhone() return (
{sortedNotes.length === 0 ? ( @@ -352,7 +354,7 @@ function CollabNotesGrid(S: NotesState) { /* ── Notes grid — 2 columns ── */
{sortedNotes.map(note => ( diff --git a/client/src/components/Files/FileManager.tsx b/client/src/components/Files/FileManager.tsx index cf5db4418..34cd121c3 100644 --- a/client/src/components/Files/FileManager.tsx +++ b/client/src/components/Files/FileManager.tsx @@ -44,7 +44,7 @@ export default function FileManager(props: FileManagerProps) { {showTrash ? : }