mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-04 09:54:14 +00:00
feat(mobile): drag to reorder the day plan, and reach the day sheet from any day
Reordering a day on the phone meant two 15px arrows, while the same list on the web takes a drag. It takes one here too now, via the long-press bridge tablets already use (#1616): it watches only draggable rows inside an opted-in container, waits out a press before claiming the gesture — so a swipe stays a scroll — and replays real drag events, which is why the rows only needed the receiving half. Armed in edit mode and on coarse pointers alone, so go-mode taps and map pans are untouched and the polyfill retired in #1432 stays retired. The arrows stay: they are the accessible path. Both paths go through one mover, so the chronology guard and the undo entry are the same either way. The card header was also the only route into the day sheet, and it rendered only when the day happened to have an accommodation or a weather reading — with the accommodation chip as the sole tap target. A day with neither had no way in. A day pill now leads that row unconditionally, the weather reading is a target too, and the active day chip carries a chevron so the second tap that opens the sheet is visible in map view as well. Closes #1997 Closes #2004
This commit is contained in:
@@ -208,10 +208,13 @@ describe('MPlanTimeline', () => {
|
||||
expect(shell.openSheet).toHaveBeenCalledWith('day', { dayId: 2 })
|
||||
})
|
||||
|
||||
it('FE-MOB-PLTL-007: is left out entirely without chips and without weather', () => {
|
||||
it('FE-MOB-PLTL-007: still renders, with the day pill, without chips or weather (#2004)', () => {
|
||||
const { container } = renderTimeline()
|
||||
|
||||
expect(container.querySelector('.border-b')).toBeNull()
|
||||
// The pill is the only way into the day sheet, so it may not depend on the
|
||||
// day happening to have an accommodation or a weather reading.
|
||||
expect(container.querySelector('.border-b')).not.toBeNull()
|
||||
expect(screen.getByRole('button', { name: 'day.overview' })).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('FE-MOB-PLTL-008: draws the hotel bookend legs above and below the rows', () => {
|
||||
@@ -349,16 +352,15 @@ describe('MPlanTimeline', () => {
|
||||
})
|
||||
|
||||
it('FE-MOB-PLTL-020: read-only members get no tappable connectors', () => {
|
||||
const { container } = renderTimeline({}, { can: vi.fn(() => false) }, { mode: 'edit' })
|
||||
renderTimeline({}, { can: vi.fn(() => false) }, { mode: 'edit' })
|
||||
|
||||
expect(container.querySelector('button')).toBeNull()
|
||||
expect(screen.getByText('7 min').closest('button')).toBeNull()
|
||||
})
|
||||
|
||||
it('FE-MOB-PLTL-020b: go mode keeps the connectors read-only even with edit rights', () => {
|
||||
const { container } = renderTimeline()
|
||||
renderTimeline()
|
||||
|
||||
expect(screen.getByText('7 min').closest('button')).toBeNull()
|
||||
expect(container.querySelector('button')).toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
@@ -439,6 +441,8 @@ describe('MPlanTimeline', () => {
|
||||
renderTimeline({ day: { ...DAY, title: null } }, {}, { mode: 'edit' })
|
||||
|
||||
expect(screen.getByText('planner.dayN:2')).toBeInTheDocument()
|
||||
// …and the day pill next to it stays icon-only so the name is not doubled.
|
||||
expect(screen.getByRole('button', { name: 'day.overview' })).toHaveTextContent('')
|
||||
})
|
||||
|
||||
it('FE-MOB-PLTL-028: the pencil renames the day and Enter commits the change', () => {
|
||||
|
||||
Reference in New Issue
Block a user