feat(mobile): move a stop to another day from its day in the place sheet

On the phone a stop could only be removed from a day and added to another,
which lost its time and notes. A tap on the day in the place sheet now opens
the same short day list as adding, headed 'Move to another day', and moves
the stop there through the planner's move, so its time, notes and road trip
waypoints come along and a timed stop lands where its time belongs. No new
control in the plan's rows.

Addresses discussion #2583.
This commit is contained in:
Maurice
2026-11-27 23:05:02 +01:00
parent 17c56326e9
commit 9ea489ac97
30 changed files with 78 additions and 9 deletions
@@ -257,6 +257,19 @@ describe('MPlaceSheet', () => {
expect(screen.queryByText('May 1')).not.toBeInTheDocument()
})
it('FE-MOB-PLSH-035: moves the stop to another day from its day chip instead of adding it there (#2583)', () => {
const handleMoveToDay = vi.fn().mockResolvedValue(undefined)
const { planner } = renderSheet(makePlanner({ handleMoveToDay, tripAccommodations: [] }))
const move = screen.getByRole('button', { name: 'Move to another day' })
fireEvent.click(move)
expect(move).toHaveAttribute('aria-expanded', 'true')
fireEvent.click(screen.getByText('Day 3'))
// From day 2 to day 3; without a time the stop goes to the end of the new day.
expect(handleMoveToDay).toHaveBeenCalledWith(11, 2, 3, undefined)
expect(planner.handleAssignToDay).not.toHaveBeenCalled()
expect(screen.queryByText('May 1')).not.toBeInTheDocument()
})
it('FE-MOB-PLSH-011: treats an assignment without participants as everyone joined', async () => {
vi.spyOn(assignmentsApi, 'setParticipants').mockResolvedValue({ participants: [{ user_id: 2, username: 'bob' }] })
renderSheet()