mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-27 07:07:31 +00:00
feat(client): show Dawarich stays, routes and marks where they belong
The trip planner and the journal get a "From Dawarich" list: the stays recorded for those dates, each one a row that can be dismissed or turned into a place or an entry after a review step that shows time, name, note and day. A place that came from a recording carries the Dawarich mark next to its name so its origin stays visible afterwards. The recorded route lies over the trip and journal maps as an overlay, coloured per day and cut along the reader's own timezone rather than UTC. It is fetched for the window on screen and never stored. The Atlas gets its own panel beside the map for the countries and cities the recordings prove, and the wish list is ticked off there, on the day of the visit, undoably. The phone has its own take on all of it, in the mobile shell's colours and with native sheets.
This commit is contained in:
@@ -10,6 +10,10 @@ import { MobileDayPickerSheet } from './PlacesSidebarMobileDayPicker'
|
||||
import { ListImportModal } from './PlacesSidebarListImportModal'
|
||||
import { PlacesBulkCategoryModal } from './PlacesBulkCategoryModal'
|
||||
import SaveTripPlacesToListModal from '../Collections/SaveTripPlacesToListModal'
|
||||
import DawarichSuggestionsPanel from '../Dawarich/DawarichSuggestionsPanel'
|
||||
import { formatDayOption } from '../Dawarich/dawarichSuggestionModel'
|
||||
import { refreshTripAfterAccept } from '../Dawarich/dawarichTripRefresh'
|
||||
import { useTranslation } from '../../i18n'
|
||||
|
||||
const PlacesSidebar = React.memo(function PlacesSidebar(props: PlacesSidebarProps) {
|
||||
const S = usePlacesSidebar(props)
|
||||
@@ -19,8 +23,10 @@ const PlacesSidebar = React.memo(function PlacesSidebar(props: PlacesSidebarProp
|
||||
fileImportOpen, setFileImportOpen, sidebarDropFile, setSidebarDropFile, tripId, pushUndo,
|
||||
ctxMenu, isMobile, pendingDeleteIds, setPendingDeleteIds, onBulkDeleteConfirm,
|
||||
categories, selectedIds, exitSelectMode, onBulkChangeCategory, categoryPickerOpen, setCategoryPickerOpen,
|
||||
collectionsEnabled, saveToListOpen, setSaveToListOpen,
|
||||
collectionsEnabled, saveToListOpen, setSaveToListOpen, days,
|
||||
} = S
|
||||
// The sidebar hook carries `t` but not the locale; day labels need both.
|
||||
const { locale } = useTranslation()
|
||||
// Below lg the places sit in their own tab with no plan beside them to drag
|
||||
// into. A coarse pointer no longer disables the drag on its own — tablets
|
||||
// reach it through a long press (#1616).
|
||||
@@ -59,6 +65,26 @@ const PlacesSidebar = React.memo(function PlacesSidebar(props: PlacesSidebarProp
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Stays Dawarich recorded on these dates, waiting to be reviewed (#2279).
|
||||
Above the list because that is what they become, and the panel renders
|
||||
nothing at all when there is nothing pending — an integration that is
|
||||
connected and quiet should be invisible rather than a permanent empty
|
||||
card. */}
|
||||
<div style={{ padding: '0 12px 8px', flexShrink: 0 }}>
|
||||
<DawarichSuggestionsPanel
|
||||
tripId={tripId}
|
||||
trips={[{ id: tripId, label: t('dawarich.accept.thisTrip') }]}
|
||||
daysForTrip={() => days.map(day => ({
|
||||
id: day.id,
|
||||
...formatDayOption(day.day_number, day.date, locale, t),
|
||||
}))}
|
||||
// The place it just created belongs on the map and in the list
|
||||
// now, not after a reload.
|
||||
onAccepted={() => { void refreshTripAfterAccept(tripId) }}
|
||||
initiallyCollapsed
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Liste */}
|
||||
<PlacesList {...S} />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user