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.
This commit is contained in:
Maurice
2026-09-08 17:35:40 +02:00
committed by Maurice
parent 900e4806ad
commit 9fa0ceaf49
29 changed files with 172 additions and 17 deletions
@@ -31,6 +31,15 @@ export interface PlacesSidebarProps {
selectedPlaceId: number | null
onPlaceClick: (placeId: number | null) => void
onAddPlace: () => void
/**
* Create a place and drop it straight into the day that is open.
*
* Only reachable while a day is selected, which is what the split button in
* the header is about: the pool is one click away from the plan, and adding a
* place you already know belongs to today should not need a second trip
* through the day picker.
*/
onAddPlaceToSelectedDay?: () => void
onAssignToDay: (placeId: number, dayId: number) => void
onEditPlace: (place: Place) => void
onDeletePlace: (placeId: number) => void