From 9fa0ceaf49fba1b2017972e1fde8b587cee3cce9 Mon Sep 17 00:00:00 2001 From: Maurice Date: Tue, 8 Sep 2026 17:35:40 +0200 Subject: [PATCH] feat(places): add a place straight into the day that is open The places pool sits one click away from the plan, and a place you already know belongs to today had to go through the day picker afterwards to get there. With a day open, the add button splits: the left half still opens an empty form, the right half opens one that assigns the place to that day on save. The plumbing was already there. placeFormDayId has assigned a freshly created place to a day since #1998; nothing in the places rail ever set it. The main label shortens to "New place" while the split is out, so both buttons fit side by side in the rail without either one truncating. The second button stays mounted and collapsed rather than unmounted, so it has something to animate out of: width, padding and opacity over 180ms, and nothing at all under prefers-reduced-motion. Collapsed it is also out of the tab order and hidden from screen readers, because a zero-width button is still focusable otherwise. Both columns of the place form are 320px now. Two panels of different widths flanking one form read as a mistake rather than as a hierarchy, and neither of them is the more important one. --- .../Collections/CollectionPicker.tsx | 5 +- .../components/Planner/PlacesSidebar.test.tsx | 33 +++++++++ .../Planner/PlacesSidebarHeader.tsx | 67 +++++++++++++++---- .../components/Planner/usePlacesSidebar.ts | 9 +++ client/src/pages/TripPlannerPage.tsx | 5 +- .../src/pages/TripPlannerPage.wiring.test.tsx | 1 + shared/src/i18n/ar/places.ts | 3 + shared/src/i18n/br/places.ts | 3 + shared/src/i18n/ca/places.ts | 3 + shared/src/i18n/cs/places.ts | 3 + shared/src/i18n/de/places.ts | 3 + shared/src/i18n/en/places.ts | 3 + shared/src/i18n/es/places.ts | 3 + shared/src/i18n/fr/places.ts | 3 + shared/src/i18n/gr/places.ts | 3 + shared/src/i18n/hu/places.ts | 3 + shared/src/i18n/id/places.ts | 3 + shared/src/i18n/it/places.ts | 3 + shared/src/i18n/ja/places.ts | 3 + shared/src/i18n/ko/places.ts | 3 + shared/src/i18n/nl/places.ts | 3 + shared/src/i18n/pl/places.ts | 3 + shared/src/i18n/ru/places.ts | 3 + shared/src/i18n/sv/places.ts | 3 + shared/src/i18n/tr/places.ts | 3 + shared/src/i18n/uk/places.ts | 3 + shared/src/i18n/vi/places.ts | 3 + shared/src/i18n/zh-TW/places.ts | 3 + shared/src/i18n/zh/places.ts | 3 + 29 files changed, 172 insertions(+), 17 deletions(-) diff --git a/client/src/components/Collections/CollectionPicker.tsx b/client/src/components/Collections/CollectionPicker.tsx index 1b51e9490..5e6ff0117 100644 --- a/client/src/components/Collections/CollectionPicker.tsx +++ b/client/src/components/Collections/CollectionPicker.tsx @@ -183,7 +183,10 @@ export default function CollectionPicker({ bias, onSelect, t }: CollectionPicker ] return ( -