The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.
TypeScript budget-trackercollaborativedockeritinerarymcp-serveroffline-firstopen-sourceopenstreetmappacking-listpwareal-timeself-hostedselfhostedtraveltravel-apptravel-journaltravel-plannertripitwanderlog
feat(journey): take a recorded day over with its stays, chosen, renamed and joined into drafts or one day report
Maurice7c1de6ed821b
diff --git a/client/scripts/feature-pairs.json b/client/scripts/feature-pairs.jsonindex c7908f5bd..bc2ef93ff 100644--- a/client/scripts/feature-pairs.json+++ b/client/scripts/feature-pairs.json@@ -399,6 +399,12 @@"src/mobile/screens/journey/mobileJourneyMeta.ts"]},+ {+ "feature": "Journey day take-over: useJourneyDayImport",+ "hooks": ["src/components/Journey/useJourneyDayImport.ts"],+ "desktop": ["src/components/Journey/JourneyDayImportDialog.tsx"],+ "mobile": ["src/mobile/screens/journey/MJourneyDayImportSheet.tsx"]+ },{"feature": "Journey day recording: useJourneyRecordingDay","hooks": ["src/components/Journey/useJourneyRecordingDay.ts"],@@ -907,6 +913,7 @@"src/mobile/screens/collections/MCollSheetKit.tsx": "Phone only sheet UI primitives for the collections screens (header, footer, pill, eyebrow).","src/mobile/screens/collections/collectionsMobileModel.ts": "Visual constants only the phone collections screens use (category and status specs, swatches, cover gradient).","src/mobile/screens/dashboard/MUserMenu.tsx": "Phone avatar menu with a three state theme cycle the desktop navbar does not have.",+ "src/mobile/screens/journey/MDawarichDaySheet.tsx": "Markup only; the phone frame the Dawarich day sheets (route and stays) render their shared review in.","src/mobile/screens/settings/MConfirmSheet.tsx": "Phone only bottom sheet confirm dialog used across the mobile screens.","src/mobile/screens/settings/MDawarichConnectionSection.tsx": "Already shares hooks/useDawarichConnection with components/Settings/DawarichConnectionSection.tsx.","src/mobile/screens/settings/MMobileDashOrder.tsx": "Phone only setting that orders the mobile dashboard blocks; the desktop has no such setting.",diff --git a/client/src/api/journeyRecordings.test.ts b/client/src/api/journeyRecordings.test.tsindex 4b0e5ad1c..85d0056e3 100644--- a/client/src/api/journeyRecordings.test.ts+++ b/client/src/api/journeyRecordings.test.ts@@ -51,4 +51,22 @@ describe('journeyRecordingsApi', () => {{ method: 'DELETE', path: `${BASE}/2026-05-14`, body: null },]);});++ it('FE-API-JOURNEY-RECORDINGS-002: reviews the stays of a day and takes them over (JRN-02)', async () => {+ const body = { groups: [{ kind: 'single' as const, stays: [{ suggestionId: 3 }] }], skipSuggestionIds: [4] };+ server.use(+ http.post(`${BASE}/2026-05-14/stays/review`, record({ date: '2026-05-14', stays: [] })),+ http.post(`${BASE}/2026-05-14/stays/import`, record({ entries: [], alreadyTaken: [3], skipped: [] }))+ );+ expect(await journeyRecordingsApi.reviewDay(7, '2026-05-14')).toEqual({ date: '2026-05-14', stays: [] });+ expect(await journeyRecordingsApi.takeOverDay(7, '2026-05-14', body)).toEqual({+ entries: [],+ alreadyTaken: [3],+ skipped: [],+ });+ expect(calls).toEqual([+ { method: 'POST', path: `${BASE}/2026-05-14/stays/review`, body: {} },+ { method: 'POST', path: `${BASE}/2026-05-14/stays/import`, body },+ ]);+ });});diff --git a/client/src/api/journeyRecordings.ts b/client/src/api/journeyRecordings.tsindex 1b382c742..3692b76fb 100644--- a/client/src/api/journeyRecordings.ts+++ b/client/src/api/journeyRecordings.ts@@ -1,4 +1,7 @@import type {+ JourneyDayImportRequest,+ JourneyDayImportResult,+ JourneyDayStays,JourneyRecordedDaysResponse,JourneyRecordingPreview,JourneyRecordingPreviewRequest,@@ -13,7 +16,10 @@ const base = (journeyId: number) => `/journeys/${journeyId}/recordings`;/** The preview and the save ask Dawarich first, so they get its longer wait. */const upstream = { timeout: DAWARICH_UPSTREAM_TIMEOUT_MS };-/** JRN-01: the recorded days a journey keeps, previewing one, keeping it and dropping it. */+/**+ * JRN-01: the recorded days a journey keeps, previewing one, keeping it and dropping it.+ * JRN-02: the stays of a day reviewed and taken over as drafts.+ */export const journeyRecordingsApi = {list: (journeyId: number, signal?: AbortSignal): Promise<JourneyRecordedDaysResponse> =>apiClient.get(base(journeyId), { signal }).then((r) => r.data),@@ -27,4 +33,8 @@ export const journeyRecordingsApi = {apiClient.put(`${base(journeyId)}/${date}`, body, upstream).then((r) => r.data),remove: (journeyId: number, date: string): Promise<void> =>apiClient.delete(`${base(journeyId)}/${date}`).then(() => undefined),+ reviewDay: (journeyId: number, date: string, signal?: AbortSignal): Promise<JourneyDayStays> =>+ apiClient.post(`${base(journeyId)}/${date}/stays/review`, {}, { ...upstream, signal }).then((r) => r.data),+ takeOverDay: (journeyId: number, date: string, body: JourneyDayImportRequest): Promise<JourneyDayImportResult> =>+ apiClient.post(`${base(journeyId)}/${date}/stays/import`, body).then((r) => r.data),};diff --git a/client/src/components/Journey/DawarichDayDialog.tsx b/client/src/components/Journey/DawarichDayDialog.tsxnew file mode 100644index 000000000..3210b1213--- /dev/null+++ b/client/src/components/Journey/DawarichDayDialog.tsx@@ -0,0 +1,62 @@+import { useId, type ReactNode } from 'react';+import { useTranslation } from '../../i18n';+import DawarichIcon from '../shared/DawarichIcon';+import { DialogFooter, DialogHeader, DialogShell, DialogTile, NEUTRAL_TINT } from '../shared/DialogShell';++/**+ * The desktop frame of a journey day read from Dawarich (JRN-01, JRN-02): the+ * Dawarich mark, the journey and the day in the head band, what the dialog+ * does under them, the body and the buttons.+ */+export default function DawarichDayDialog({+ journeyTitle,+ date,+ sub,+ onClose,+ footer,+ children,+}: {+ journeyTitle: string;+ date: string;+ sub: string;+ onClose: () => void;+ footer: ReactNode;+ children: ReactNode;+}) {+ const { locale } = useTranslation();+ const labelId = useId();+ const title = new Date(`${date}T00:00:00`).toLocaleDateString(locale, {+ weekday: 'long',+ day: 'numeric',+ month: 'long',+ year: 'numeric',+ });++ return (+ <DialogShell+ onClose={onClose}+ labelledBy={labelId}+ width="detail"+ align="top"+ header={+ <DialogHeader+ tile={+ <DialogTile>+ <DawarichIcon size={26} />+ </DialogTile>+ }+ tint={NEUTRAL_TINT}+ labelId={labelId}+ onClose={onClose}+ eyebrow={journeyTitle}+ title={title}+ sub={sub}+ subWraps+ />+ }+ footer={<DialogFooter>{footer}</DialogFooter>}+ >+ {children}+ </DialogShell>+ );+}diff --git a/client/src/components/Journey/JourneyDayDawarich.test.tsx b/client/src/components/Journey/JourneyDayDawarich.test.tsxindex 2b20b4c75..70ec4a85a 100644--- a/client/src/components/Journey/JourneyDayDawarich.test.tsx+++ b/client/src/components/Journey/JourneyDayDawarich.test.tsx@@ -1,4 +1,4 @@-// FE-JRN-DAYDAW-001 to FE-JRN-DAYDAW-008+// FE-JRN-DAYDAW-001 to FE-JRN-DAYDAW-010/*** The fold a journal day carries for the stays Dawarich recorded on it.*@@ -144,4 +144,27 @@ describe('JourneyDayDawarich', () => {expect(screen.getByText('8:00 AM – 5:08 PM')).toBeInTheDocument()useSettingsStore.setState(s => ({ settings: { ...s.settings, time_format: '24h' } }))})++ it('FE-JRN-DAYDAW-009: beside the shut row, the whole day can be taken over at once (JRN-02)', () => {+ const onTakeOverDay = vi.fn()+ render(+ <JourneyDayDawarich+ suggestions={[stay({ id: 1 })]}+ busyId={null}+ onAccept={vi.fn()}+ onDismiss={vi.fn()}+ onTakeOverDay={onTakeOverDay}+ />,+ )++ fireEvent.click(screen.getByRole('button', { name: 'Take over day' }))++ expect(onTakeOverDay).toHaveBeenCalledTimes(1)+ expect(screen.getByRole('button', { expanded: false })).toBeInTheDocument()+ })++ it('FE-JRN-DAYDAW-010: without the right to take a day over there is no such button', () => {+ fold([stay({ id: 1 })])+ expect(screen.queryByRole('button', { name: 'Take over day' })).not.toBeInTheDocument()+ })})diff --git a/client/src/components/Journey/JourneyDayDawarich.tsx b/client/src/components/Journey/JourneyDayDawarich.tsxindex 4d900cfe5..925dbca5f 100644--- a/client/src/components/Journey/JourneyDayDawarich.tsx+++ b/client/src/components/Journey/JourneyDayDawarich.tsx@@ -1,8 +1,9 @@import React, { useState } from 'react'-import { ChevronDown, ChevronRight } from 'lucide-react'+import { ChevronDown, ChevronRight, ListChecks } from 'lucide-react'import type { DawarichSuggestion, DawarichSuggestionTarget } from '@trek/shared'import { useTranslation } from '../../i18n'import DawarichIcon from '../shared/DawarichIcon'+import { fs } from '../shared/DialogShell'import { SuggestionRow } from '../Dawarich/DawarichSuggestionsPanel'import { timeRange } from '../Dawarich/dawarichSuggestionModel'import { useSettingsStore } from '../../store/settingsStore'@@ -28,6 +29,7 @@ export default function JourneyDayDawarich({busyId,onAccept,onDismiss,+ onTakeOverDay,}: {/** The open stays of this day, in the order they were lived. */suggestions: DawarichSuggestion[]@@ -35,6 +37,8 @@ export default function JourneyDayDawarich({busyId: number | nullonAccept: (suggestion: DawarichSuggestion, target: DawarichSuggestionTarget) => voidonDismiss: (suggestion: DawarichSuggestion) => void+ /** Review the whole day with its stays and route instead of one stay at a time (JRN-02). */+ onTakeOverDay?: () => void}): React.ReactElement | null {const { t } = useTranslation()const is12h = useSettingsStore(s => s.settings.time_format) === '12h'@@ -49,11 +53,12 @@ export default function JourneyDayDawarich({return (<div className="rounded-2xl border border-edge bg-surface-secondary overflow-hidden">+ <div className="flex items-center"><buttontype="button"onClick={() => setOpen(v => !v)}aria-expanded={open}- className="flex w-full items-center gap-2.5 px-3 py-2.5 text-start transition-colors hover:bg-surface-hover"+ className="flex min-w-0 flex-1 items-center gap-2.5 px-3 py-2.5 text-start transition-colors hover:bg-surface-hover">{/* The brand mark in its own colours, which is what tells this row from an entryat a glance. No second label saying "Dawarich": the mark is the label. */}@@ -68,6 +73,20 @@ export default function JourneyDayDawarich({? <ChevronDown size={16} className="shrink-0 text-content-faint" aria-hidden />: <ChevronRight size={16} className="shrink-0 text-content-faint" aria-hidden />}</button>+ {/* The whole day at once, beside the row: choosing, joining and naming+ its stays together beats accepting them one by one. */}+ {onTakeOverDay && (+ <button+ type="button"+ onClick={onTakeOverDay}+ className="me-2 inline-flex shrink-0 items-center gap-1.5 rounded-lg bg-accent px-2.5 py-1.5 font-semibold text-accent-text transition-opacity hover:opacity-90"+ style={fs(12, 'body')}+ >+ <ListChecks size={14} aria-hidden />+ {t('journey.dayImport.open')}+ </button>+ )}+ </div>{open && (<div className="flex flex-col gap-1 pb-2">diff --git a/client/src/components/Journey/JourneyDayImportButton.test.tsx b/client/src/components/Journey/JourneyDayImportButton.test.tsxnew file mode 100644index 000000000..ad80311bd--- /dev/null+++ b/client/src/components/Journey/JourneyDayImportButton.test.tsx@@ -0,0 +1,45 @@+// FE-JRN-DAY-IMPORT-BTN-001 to FE-JRN-DAY-IMPORT-BTN-003+//+// JRN-02: the day header's way into taking a day over with its stays.+import userEvent from '@testing-library/user-event';+import { describe, expect, it, vi } from 'vitest';+import { render, screen } from '../../../tests/helpers/render';+import JourneyDayImportButton from './JourneyDayImportButton';++function renderButton(props: Partial<Parameters<typeof JourneyDayImportButton>[0]> = {}) {+ const onOpen = vi.fn();+ const view = render(+ <JourneyDayImportButton pending={0} canTakeOver needsConnection={false} onOpen={onOpen} {...props} />+ );+ return { onOpen, ...view };+}++describe('JourneyDayImportButton', () => {+ it('FE-JRN-DAY-IMPORT-BTN-001: counts the stays still waiting on the day and opens the take-over', async () => {+ const { onOpen } = renderButton({ pending: 6 });+ const button = screen.getByTestId('journey-day-import');+ expect(button).toHaveTextContent('6');+ expect(button).toHaveAccessibleName('6 stays to review');+ await userEvent.click(button);+ expect(onOpen).toHaveBeenCalledTimes(1);+ });++ it('FE-JRN-DAY-IMPORT-BTN-002: a day with nothing waiting still offers the take-over, without a number', () => {+ renderButton();+ const button = screen.getByTestId('journey-day-import');+ expect(button).toHaveAccessibleName('Take over this day with its stays');+ expect(button.textContent).toBe('');+ });++ it('FE-JRN-DAY-IMPORT-BTN-003: offline it stays dimmed and says why; without Dawarich or the right to edit it is not there', async () => {+ const { onOpen, unmount } = renderButton({ canTakeOver: false, needsConnection: true, pending: 2 });+ const button = screen.getByTestId('journey-day-import');+ expect(button).toHaveAttribute('aria-disabled', 'true');+ await userEvent.click(button);+ expect(onOpen).not.toHaveBeenCalled();+ unmount();++ renderButton({ canTakeOver: false, needsConnection: false });+ expect(screen.queryByTestId('journey-day-import')).not.toBeInTheDocument();+ });+});diff --git a/client/src/components/Journey/JourneyDayImportButton.tsx b/client/src/components/Journey/JourneyDayImportButton.tsxnew file mode 100644index 000000000..ea1fd3d63--- /dev/null+++ b/client/src/components/Journey/JourneyDayImportButton.tsx@@ -0,0 +1,51 @@+import { ListChecks } from 'lucide-react';+import type React from 'react';+import { useTranslation } from '../../i18n';+import { fs } from '../shared/DialogShell';+import { Tooltip } from '../shared/Tooltip';++/**+ * Taking a day over with its stays (JRN-02), in the day header beside the+ * route: for an editor whose Dawarich answers, with the number of stays still+ * waiting on the day; offline it stays, dimmed, and says why.+ */+export default function JourneyDayImportButton({+ pending,+ canTakeOver,+ needsConnection,+ onOpen,+}: {+ /** Stays of the day nobody decided on yet. */+ pending: number;+ canTakeOver: boolean;+ needsConnection: boolean;+ onOpen: () => void;+}): React.ReactElement | null {+ const { t } = useTranslation();+ if (!canTakeOver && !needsConnection) return null;+ const label = !canTakeOver+ ? t('dawarich.error.offline')+ : pending > 0+ ? t('journey.dayImport.pending', { count: pending })+ : t('journey.dayImport.openHint');+ return (+ <Tooltip label={label} placement="top">+ <button+ type="button"+ onClick={canTakeOver ? onOpen : undefined}+ aria-disabled={!canTakeOver}+ aria-label={label}+ data-testid="journey-day-import"+ className="inline-flex h-7 items-center gap-1 rounded-full px-2 text-content-secondary transition-colors aria-disabled:cursor-default aria-disabled:opacity-40 [&:not([aria-disabled=true])]:hover:bg-surface-hover"+ style={{ background: 'var(--vg-surf2)' }}+ >+ <ListChecks size={14} strokeWidth={2.2} aria-hidden="true" />+ {pending > 0 && (+ <span className="font-bold tabular-nums" style={fs(10.5)}>+ {pending}+ </span>+ )}+ </button>+ </Tooltip>+ );+}diff --git a/client/src/components/Journey/JourneyDayImportDialog.test.tsx b/client/src/components/Journey/JourneyDayImportDialog.test.tsxnew file mode 100644index 000000000..7c2a71db4--- /dev/null+++ b/client/src/components/Journey/JourneyDayImportDialog.test.tsx@@ -0,0 +1,156 @@+// FE-JRN-DAYIMPORT-DIALOG-001 to FE-JRN-DAYIMPORT-DIALOG-006+//+// JRN-02: the desktop dialog that takes a recorded day over with its stays. It+// names the journey and the day, shows the stays on the map and in a list to+// choose, rename and join, what the journal holds on the day already and who+// sees the drafts, and writes only on its button.+import userEvent from '@testing-library/user-event';+import { beforeEach, describe, expect, it, vi } from 'vitest';+import { buildDayStay, buildDayStays, buildRecordingPreview } from '../../../tests/helpers/journeyRecording';+import { render, screen, waitFor, within } from '../../../tests/helpers/render';+import JourneyDayImportDialog from './JourneyDayImportDialog';++const repo = vi.hoisted(() => ({+ reviewDay: vi.fn(),+ takeOverDay: vi.fn(),+ preview: vi.fn(),+ save: vi.fn(),+ remove: vi.fn(),+}));+vi.mock('../../repo/journeyRecordingsRepo', () => ({ journeyRecordingsRepo: repo }));++const toast = { success: vi.fn(), error: vi.fn(), warning: vi.fn(), info: vi.fn() };+vi.mock('../shared/Toast', () => ({ useToast: () => toast }));++const map = vi.hoisted(() => ({ props: {} as Record<string, unknown> }));+vi.mock('./JourneyMapAuto', () => ({+ default: (props: Record<string, unknown>) => {+ map.props = props;+ return <div data-testid="day-map" />;+ },+}));++function renderDialog() {+ const props = { onTakenOver: vi.fn(), onKept: vi.fn(), onClose: vi.fn() };+ render(+ <JourneyDayImportDialog+ journeyId={7}+ journeyTitle="Venice"+ date="2026-05-14"+ dayColor="#ff0055"+ storedRoute={undefined}+ {...props}+ />+ );+ return props;+}++const rowOf = (name: string) =>+ screen.getByRole('checkbox', { name: `Take over ${name}` }).closest('[data-stay-id]') as HTMLElement;++beforeEach(() => {+ for (const fn of [...Object.values(repo), ...Object.values(toast)]) fn.mockReset();+ repo.reviewDay.mockResolvedValue(+ buildDayStays({+ entries: [{ id: 3, title: 'Breakfast at the hotel', locationName: null, entryTime: '08:00', isDraft: false }],+ audience: 2,+ })+ );+ repo.preview.mockResolvedValue(buildRecordingPreview());+ repo.takeOverDay.mockResolvedValue({+ entries: [{ id: 5, title: 'Piazza San Marco', stayCount: 2 }],+ alreadyTaken: [],+ skipped: [],+ });+});++describe('JourneyDayImportDialog', () => {+ it('FE-JRN-DAYIMPORT-DIALOG-001: names the journey and the day, and shows the stays, the route and the day so far', async () => {+ renderDialog();++ expect(await screen.findByRole('checkbox', { name: 'Take over Parcheggio' })).toBeChecked();+ expect(screen.getByText('Venice')).toBeInTheDocument();+ expect(screen.getByText(/May 14, 2026/)).toBeInTheDocument();+ expect(screen.getByTestId('day-map')).toBeInTheDocument();+ expect(map.props.entries).toHaveLength(4);+ expect(screen.getByText('Breakfast at the hotel')).toBeInTheDocument();+ expect(screen.getByText(/2 other people on this journey see them/)).toBeInTheDocument();+ expect(within(rowOf('Parcheggio')).getByText('Unconfirmed')).toBeInTheDocument();+ expect(await screen.findByText("Keep the day's route too")).toBeInTheDocument();+ expect(screen.getByRole('button', { name: 'Take over 3 drafts' })).toBeEnabled();+ expect(repo.takeOverDay).not.toHaveBeenCalled();+ });++ it('FE-JRN-DAYIMPORT-DIALOG-002: the same place twice starts joined under one title, and can be kept apart', async () => {+ const user = userEvent.setup();+ renderDialog();+ await screen.findByRole('checkbox', { name: 'Take over Parcheggio' });++ expect(screen.getByRole('textbox', { name: 'Title of the entry' })).toHaveValue('Piazza San Marco');+ await user.click(screen.getByRole('button', { name: 'Keep apart' }));++ expect(screen.queryByRole('textbox', { name: 'Title of the entry' })).not.toBeInTheDocument();+ expect(screen.getByRole('button', { name: 'Take over 4 drafts' })).toBeInTheDocument();+ });++ it('FE-JRN-DAYIMPORT-DIALOG-003: a stay left out is dimmed and counted, and the drafts are written on the button', async () => {+ const user = userEvent.setup();+ const props = renderDialog();+ await screen.findByRole('checkbox', { name: 'Take over Parcheggio' });++ await user.click(screen.getByRole('checkbox', { name: 'Take over Parcheggio' }));+ expect(rowOf('Parcheggio').className).toContain('opacity-60');+ expect(screen.getByText('1 left out')).toBeInTheDocument();+ await user.click(screen.getByRole('button', { name: 'Take over 2 drafts' }));++ await waitFor(() => expect(props.onClose).toHaveBeenCalled());+ expect(repo.takeOverDay).toHaveBeenCalledWith(+ 7,+ '2026-05-14',+ expect.objectContaining({ skipSuggestionIds: [10] })+ );+ expect(props.onTakenOver).toHaveBeenCalled();+ });++ it('FE-JRN-DAYIMPORT-DIALOG-004: a day report gathers every chosen stay under one title', async () => {+ const user = userEvent.setup();+ renderDialog();+ await screen.findByRole('checkbox', { name: 'Take over Parcheggio' });++ await user.click(screen.getByRole('button', { name: 'Day report' }));++ expect(screen.getByRole('textbox', { name: 'Title of the entry' })).toHaveValue('Day of May 14');+ expect(screen.queryByRole('button', { name: 'Keep apart' })).not.toBeInTheDocument();+ await user.click(screen.getByRole('button', { name: 'Take over 1 draft' }));+ await waitFor(() => expect(repo.takeOverDay).toHaveBeenCalled());+ expect(repo.takeOverDay.mock.calls[0]?.[2]).toMatchObject({+ groups: [{ kind: 'report', title: 'Day of May 14', anchorSuggestionId: 12 }],+ });+ });++ it('FE-JRN-DAYIMPORT-DIALOG-005: a stay the journal holds is shown with its entry and cannot be chosen again', async () => {+ repo.reviewDay.mockResolvedValue(+ buildDayStays({+ stays: [buildDayStay({ suggestionId: 11, status: 'here', entry: { id: 4, title: 'Morning in San Marco' } })],+ })+ );+ renderDialog();++ const box = await screen.findByRole('checkbox', { name: 'Take over Piazza San Marco' });+ expect(box).toBeDisabled();+ expect(box).not.toBeChecked();+ expect(screen.getByText('In Morning in San Marco')).toBeInTheDocument();+ expect(screen.getByRole('button', { name: 'Take over 0 drafts' })).toBeDisabled();+ });++ it('FE-JRN-DAYIMPORT-DIALOG-006: when Dawarich does not answer, the stays of the last sync are shown with the reason', async () => {+ repo.reviewDay.mockResolvedValue(+ buildDayStays({ fresh: false, error: 'unreachable', syncedAt: '2026-05-14T20:00:00Z', truncated: true })+ );+ renderDialog();++ expect(await screen.findByText(/Dawarich did not answer/)).toBeInTheDocument();+ expect(screen.getByText(/Some stays may be missing/)).toBeInTheDocument();+ expect(screen.getByRole('checkbox', { name: 'Take over Rialto' })).toBeChecked();+ });+});diff --git a/client/src/components/Journey/JourneyDayImportDialog.tsx b/client/src/components/Journey/JourneyDayImportDialog.tsxnew file mode 100644index 000000000..0591a9015--- /dev/null+++ b/client/src/components/Journey/JourneyDayImportDialog.tsx@@ -0,0 +1,32 @@+import { useTranslation } from '../../i18n';+import DawarichDayDialog from './DawarichDayDialog';+import { JourneyDayImportActions, JourneyDayImportReview } from './JourneyDayImportReview';+import { useJourneyDayImport, type JourneyDayImportViewProps } from './useJourneyDayImport';++/**+ * Taking a recorded day with its stays into the journal (JRN-02), on the+ * desktop: the route, the stays and the day's entries in the body, the drafts+ * written only on the button that says how many.+ */+export default function JourneyDayImportDialog({+ journeyTitle,+ date,+ dayColor,+ onClose,+ ...rest+}: JourneyDayImportViewProps) {+ const { t } = useTranslation();+ const state = useJourneyDayImport({ date, dayColor, onClose, ...rest });++ return (+ <DawarichDayDialog+ journeyTitle={state.review?.journey.title ?? journeyTitle}+ date={date}+ sub={t('journey.dayImport.sub')}+ onClose={onClose}+ footer={<JourneyDayImportActions state={state} onCancel={onClose} />}+ >+ <JourneyDayImportReview state={state} dayColor={dayColor} />+ </DawarichDayDialog>+ );+}diff --git a/client/src/components/Journey/JourneyDayImportReview.tsx b/client/src/components/Journey/JourneyDayImportReview.tsxnew file mode 100644index 000000000..a6bd25913--- /dev/null+++ b/client/src/components/Journey/JourneyDayImportReview.tsx@@ -0,0 +1,268 @@+import { Clock, FilePen, Loader2, RefreshCw, Route, Users } from 'lucide-react';+import { useTranslation } from '../../i18n';+import { useSettingsStore } from '../../store/settingsStore';+import { formatClockTime } from '../../utils/formatters';+import { formatDistance } from '../../utils/units';+import { SoftPill } from '../Planner/planParts';+import ToggleSwitch from '../Settings/ToggleSwitch';+import { Segmented } from '../shared/dialogParts';+import { DialogButton, DialogSection, FooterSpacer, fs } from '../shared/DialogShell';+import { Tooltip } from '../shared/Tooltip';+import { JourneyDayImportStays } from './JourneyDayImportStays';+import JourneyMap from './JourneyMapAuto';+import { reasonText } from './journeyRecordingModel';+import { Notice } from './JourneyRecordingReview';+import { stayMarkerId, type JourneyDayImportState } from './useJourneyDayImport';++type Props = { state: JourneyDayImportState; dayColor: string };++/** Why the list may not be the whole day, and what went wrong on the way. */+function DayNotices({ state }: { state: JourneyDayImportState }) {+ const { t, locale } = useTranslation();+ const { review, outcome } = state;+ const reason = review ? reasonText(review.error, t) : '';+ return (+ <>+ {outcome?.kind === 'failed' && (+ <Notice tone="danger">{t('journey.dayImport.failed', { reason: outcome.reason })}</Notice>+ )}+ {outcome?.kind === 'route' && (+ <Notice tone="warning">{t('journey.dayImport.routeFailed', { reason: outcome.reason })}</Notice>+ )}+ {review && !review.fresh && (+ <Notice tone="warning">+ {review.syncedAt+ ? t('journey.dayImport.stale', {+ reason,+ date: new Date(review.syncedAt).toLocaleString(locale, { dateStyle: 'medium', timeStyle: 'short' }),+ })+ : t('journey.dayImport.staleNever', { reason })}+ </Notice>+ )}+ {review?.truncated && <Notice tone="warning">{t('journey.dayImport.truncated')}</Notice>}+ </>+ );+}++/** The day's route under the pins: kept already, to keep along, kept in another version, or none recorded. */+function RouteLine({ state }: { state: JourneyDayImportState }) {+ const { t } = useTranslation();+ const unit = useSettingsStore((s) => s.settings.distance_unit) ?? 'metric';+ const { route } = state;+ const distance = route.distanceMeters === null ? null : formatDistance(route.distanceMeters / 1000, unit);+ if (route.offer === 'loading') {+ return (+ <p className="m-0 flex items-center gap-1.5 text-content-faint" style={fs(11.5)}>+ <Loader2 size={12} className="animate-spin" aria-hidden="true" />+ {t('journey.recording.loading')}+ </p>+ );+ }+ if (route.offer === 'keep') {+ return (+ <div className="flex items-center justify-between gap-3">+ <span className="min-w-0">+ <span className="block text-content" style={fs(12.5, 'body')}>+ {t('journey.dayImport.keepRoute')}+ </span>+ <span className="block text-content-faint" style={fs(11.5)}>+ {t('journey.dayImport.keepRouteHint', { distance: distance ?? '' })}+ </span>+ </span>+ <ToggleSwitch on={route.keep} onToggle={route.toggle} label={t('journey.dayImport.keepRoute')} />+ </div>+ );+ }+ if (route.offer === 'none') {+ return (+ <p className="m-0 text-content-faint" style={fs(11.5)}>+ {t('journey.dayImport.routeNone')}+ </p>+ );+ }+ return (+ <div className="flex flex-wrap items-center gap-1.5">+ {distance && <SoftPill icon={<Route size={11} aria-hidden="true" />}>{distance}</SoftPill>}+ <SoftPill tone="success">{t('journey.dayImport.routeKept')}</SoftPill>+ {route.offer === 'differs' && (+ <span className="text-content-faint" style={fs(11.5)}>+ {t('journey.dayImport.routeDiffers')}+ </span>+ )}+ </div>+ );+}++/** What the journal has on the day already, so nothing is taken over twice by hand. */+function DayEntries({ state }: { state: JourneyDayImportState }) {+ const { t } = useTranslation();+ const is12h = useSettingsStore((s) => s.settings.time_format) === '12h';+ const entries = state.review?.entries ?? [];+ if (entries.length === 0) return null;+ return (+ <DialogSection label={t('journey.dayImport.existing')}>+ <ul className="m-0 flex list-none flex-col gap-1 p-0">+ {entries.map((entry) => (+ <li+ key={entry.id}+ className="flex min-w-0 items-center gap-1.5 text-content-secondary"+ style={fs(12.5, 'body')}+ >+ <span className="truncate">{entry.title || entry.locationName || t('journey.dayImport.untitled')}</span>+ {entry.entryTime && (+ <SoftPill icon={<Clock size={11} aria-hidden="true" />}>+ {formatClockTime(entry.entryTime, is12h)}+ </SoftPill>+ )}+ {entry.isDraft && (+ <SoftPill icon={<FilePen size={11} aria-hidden="true" />}>{t('journey.dayImport.draft')}</SoftPill>+ )}+ </li>+ ))}+ </ul>+ </DialogSection>+ );+}++function scrollToStay(id: string): void {+ document+ .querySelector(`[data-stay-id="${id.replace('stay-', '')}"]`)+ ?.scrollIntoView({ block: 'nearest', behavior: 'smooth' });+}++/**+ * Reviewing a recorded day with its stays (JRN-02): the route and the stays on+ * one map, the stays as a list to choose, rename and join, what the journal+ * holds on the day already, and who will see the drafts. The body of the+ * desktop dialog and of the phone sheet alike.+ */+export function JourneyDayImportReview({ state, dayColor }: Props) {+ const { t } = useTranslation();+ const { review, choice } = state;+ if (!review) {+ if (state.error) {+ return (+ <div className="flex flex-col gap-2">+ <Notice tone="danger">{state.error}</Notice>+ <span>+ <DialogButton onClick={state.retry} icon={<RefreshCw size={14} aria-hidden="true" />}>+ {t('journey.recording.retry')}+ </DialogButton>+ </span>+ </div>+ );+ }+ return (+ <p className="m-0 flex items-center gap-2 py-6 text-content-muted" role="status" style={fs(12.5, 'body')}>+ <Loader2 size={15} className="animate-spin" aria-hidden="true" />+ {t('journey.dayImport.loading')}+ </p>+ );+ }+ return (+ <>+ <DayNotices state={state} />+ <DialogSection label={t('journey.dayImport.map')}>+ <div className="flex flex-col gap-2.5">+ <div className="overflow-hidden rounded-[12px] border border-edge-faint">+ <JourneyMap+ checkins={[]}+ entries={state.mapEntries}+ tracks={state.mapTracks}+ height={200}+ activeMarkerId={state.activeStay === null ? null : stayMarkerId(state.activeStay)}+ onMarkerClick={scrollToStay}+ />+ </div>+ <RouteLine state={state} />+ </div>+ </DialogSection>+ <DialogSection+ label={t('journey.dayImport.stays')}+ action={+ choice && review.stays.length > 1 ? (+ <Segmented+ label={t('journey.dayImport.stays')}+ value={choice.mode}+ onChange={state.setMode}+ options={[+ { value: 'entries', label: t('journey.dayImport.modeEntries') },+ { value: 'report', label: t('journey.dayImport.modeReport') },+ ]}+ />+ ) : undefined+ }+ >+ {review.stays.length === 0 ? (+ <Notice tone="info">{t('journey.dayImport.empty')}</Notice>+ ) : (+ <JourneyDayImportStays state={state} dayColor={dayColor} />+ )}+ </DialogSection>+ <DayEntries state={state} />+ <p className="m-0 flex items-start gap-2 text-content-muted" style={fs(12, 'body')}>+ <Users size={14} className="mt-px flex-none" aria-hidden="true" />+ {review.audience > 0+ ? t('journey.dayImport.audience', { count: review.audience })+ : t('journey.dayImport.draftsNote')}+ </p>+ </>+ );+}++/**+ * The buttons under the review: how many stays are left out, close, and the+ * one that takes the chosen stays over as drafts, saying why when it cannot+ * yet. After a route that was not kept, it offers the route alone again.+ */+export function JourneyDayImportActions({ state, onCancel }: { state: JourneyDayImportState; onCancel: () => void }) {+ const { t } = useTranslation();+ const { problem, busy } = state;+ const working = busy !== null;+ if (state.outcome?.kind === 'route') {+ return (+ <>+ <FooterSpacer />+ <DialogButton onClick={onCancel}>{t('common.close')}</DialogButton>+ <DialogButton+ variant="primary"+ onClick={state.retryRoute}+ disabled={working}+ icon={busy === 'route' ? <Loader2 size={14} className="animate-spin" aria-hidden="true" /> : undefined}+ >+ {t('journey.dayImport.routeRetry')}+ </DialogButton>+ </>+ );+ }+ const submit = (+ <DialogButton+ variant="primary"+ onClick={state.submit}+ disabled={problem !== null || working || state.loading}+ icon={busy === 'submit' ? <Loader2 size={14} className="animate-spin" aria-hidden="true" /> : undefined}+ >+ {t('journey.dayImport.submit', { count: state.groups.length })}+ </DialogButton>+ );+ return (+ <>+ {state.skipCount > 0 && (+ <Tooltip label={t('journey.dayImport.skipHint')} placement="top">+ <span tabIndex={0} className="inline-flex">+ <SoftPill>{t('journey.dayImport.skipped', { count: state.skipCount })}</SoftPill>+ </span>+ </Tooltip>+ )}+ <FooterSpacer />+ <DialogButton onClick={onCancel}>{t('common.cancel')}</DialogButton>+ {problem !== null && state.review && state.review.stays.length > 0 ? (+ <Tooltip label={t(`journey.dayImport.problem.${problem}`)} placement="top">+ <span className="inline-flex">{submit}</span>+ </Tooltip>+ ) : (+ submit+ )}+ </>+ );+}diff --git a/client/src/components/Journey/JourneyDayImportStays.tsx b/client/src/components/Journey/JourneyDayImportStays.tsxnew file mode 100644index 000000000..6b0fb6de1--- /dev/null+++ b/client/src/components/Journey/JourneyDayImportStays.tsx@@ -0,0 +1,270 @@+import type { JourneyDayStay } from '@trek/shared';+import { Check, Clock, Gauge, HelpCircle, Hourglass, Link2, MapPinOff, Unlink2 } from 'lucide-react';+import type { ReactNode } from 'react';+import { useTranslation } from '../../i18n';+import { useSettingsStore } from '../../store/settingsStore';+import { formatDuration, timeRange } from '../Dawarich/dawarichSuggestionModel';+import { SoftPill } from '../Planner/planParts';+import { INPUT, PANEL, PillSelect } from '../shared/dialogParts';+import { fs } from '../shared/DialogShell';+import { Tooltip } from '../shared/Tooltip';+import { canJoin, isTakeable, nameOf, REPORT_KEY, type DayImportGroup } from './journeyDayImportModel';+import type { JourneyDayImportState } from './useJourneyDayImport';++type Props = { state: JourneyDayImportState; dayColor: string };++/** A fact about a stay with what it means on hover. */+function Hinted({ label, children }: { label: string; children: ReactNode }) {+ return (+ <Tooltip label={label} placement="top">+ <span tabIndex={0} className="inline-flex">+ {children}+ </span>+ </Tooltip>+ );+}++/** Where a stay stands, when it is not simply open: in this journal already, taken elsewhere, or left out before. */+function StatusPill({ stay }: { stay: JourneyDayStay }) {+ const { t } = useTranslation();+ if (stay.status === 'here') {+ return (+ <SoftPill tone="success" icon={<Check size={11} aria-hidden="true" />}>+ {stay.entry?.title+ ? t('journey.dayImport.statusHere', { title: stay.entry.title })+ : t('journey.dayImport.statusHereUntitled')}+ </SoftPill>+ );+ }+ if (stay.status === 'elsewhere') {+ return (+ <Hinted label={t('journey.dayImport.statusElsewhereHint')}>+ <SoftPill icon={<Check size={11} aria-hidden="true" />}>{t('journey.dayImport.statusElsewhere')}</SoftPill>+ </Hinted>+ );+ }+ if (stay.status === 'skipped') return <SoftPill>{t('journey.dayImport.statusSkipped')}</SoftPill>;+ return null;+}++/** When, how long, how sure Dawarich is and whether it has a place: every fact the recording gives, no more. */+function StayFacts({ stay }: { stay: JourneyDayStay }) {+ const { t } = useTranslation();+ const is12h = useSettingsStore((s) => s.settings.time_format) === '12h';+ return (+ <div className="mt-1.5 flex flex-wrap items-center gap-1">+ <SoftPill icon={<Clock size={11} aria-hidden="true" />}>+ {timeRange(stay.startedAt, stay.endedAt, is12h)}+ </SoftPill>+ <SoftPill icon={<Hourglass size={11} aria-hidden="true" />}>{formatDuration(stay.durationMinutes, t)}</SoftPill>+ {stay.sourceStatus === 'suggested' && (+ <Hinted label={t('dawarich.sourceStatus.suggested')}>+ <SoftPill tone="warning" icon={<HelpCircle size={11} aria-hidden="true" />}>+ {t('journey.dayImport.unconfirmed')}+ </SoftPill>+ </Hinted>+ )}+ {stay.confidenceBand === 'low' && (+ <Hinted label={t('dawarich.confidence.low')}>+ <SoftPill tone="warning" icon={<Gauge size={11} aria-hidden="true" />}>+ {t('dawarich.badge.lowConfidence')}+ </SoftPill>+ </Hinted>+ )}+ {stay.lat === null && (+ <Hinted label={t('journey.dayImport.noPlaceHint')}>+ <SoftPill icon={<MapPinOff size={11} aria-hidden="true" />}>{t('journey.dayImport.noPlace')}</SoftPill>+ </Hinted>+ )}+ <StatusPill stay={stay} />+ </div>+ );+}++/** One stay: chosen or not, its number on the map, its name to correct, and its facts. */+function StayRow({ state, dayColor, stay, index }: Props & { stay: JourneyDayStay; index: number }) {+ const { t } = useTranslation();+ const { choice } = state;+ const takeable = isTakeable(stay);+ const chosen = takeable && !!choice?.selected.has(stay.suggestionId);+ const name = choice ? nameOf(choice, stay) : stay.name;+ const active = state.activeStay === stay.suggestionId;+ return (+ <div+ data-stay-id={stay.suggestionId}+ onMouseEnter={() => state.setActiveStay(stay.suggestionId)}+ onMouseLeave={() => state.setActiveStay(null)}+ className={`flex items-start gap-2.5 rounded-[12px] border px-2.5 py-2 transition-opacity ${+ active ? 'border-edge' : 'border-edge-faint'+ } ${chosen ? 'bg-surface-card' : 'bg-surface-secondary opacity-60'}`}+ >+ <button+ type="button"+ role="checkbox"+ aria-checked={chosen}+ aria-label={t('journey.dayImport.choose', { name })}+ disabled={!takeable || state.busy !== null}+ onClick={() => state.toggle(stay.suggestionId)}+ className={`mt-1.5 grid h-[18px] w-[18px] flex-none place-items-center rounded-[5px] border ${+ chosen ? 'border-transparent bg-accent text-accent-text' : 'border-edge bg-surface-card'+ } disabled:cursor-default`}+ >+ {chosen && <Check size={12} strokeWidth={3} aria-hidden="true" />}+ </button>+ <span+ aria-hidden="true"+ className={`mt-1 grid h-[22px] min-w-[22px] flex-none place-items-center rounded-full border-2 bg-surface-card px-1 font-bold tabular-nums ${+ chosen ? 'text-content' : 'border-edge text-content-faint'+ }`}+ style={{ ...fs(10.5), ...(chosen ? { borderColor: dayColor } : {}) }}+ >+ {index + 1}+ </span>+ <div className="min-w-0 flex-1">+ <input+ value={name}+ onChange={(e) => state.rename(stay, e.target.value)}+ disabled={!chosen || state.busy !== null}+ aria-label={t('journey.dayImport.name', { name: stay.name })}+ placeholder={stay.name}+ className={INPUT}+ />+ <StayFacts stay={stay} />+ </div>+ </div>+ );+}++/** Between two chosen stays: join them into one entry, or separate them again. */+function JoinToggle({ state, stay }: { state: JourneyDayImportState; stay: JourneyDayStay }) {+ const { t } = useTranslation();+ const joined = !!state.choice?.joined.has(stay.suggestionId);+ const label = joined ? t('journey.dayImport.split') : t('journey.dayImport.join');+ return (+ <div className="flex justify-center">+ <button+ type="button"+ onClick={() => state.join(stay.suggestionId)}+ disabled={state.busy !== null}+ aria-pressed={joined}+ className="inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 font-medium text-content-muted transition-colors hover:bg-surface-hover hover:text-content"+ style={fs(11)}+ >+ {joined ? <Unlink2 size={12} aria-hidden="true" /> : <Link2 size={12} aria-hidden="true" />}+ {label}+ </button>+ </div>+ );+}++/** The title and the map position of an entry made of several stays: both chosen on purpose, both shown. */+function GroupHead({ state, group }: { state: JourneyDayImportState; group: DayImportGroup }) {+ const { t } = useTranslation();+ const isReport = group.key === REPORT_KEY;+ const typed = state.choice?.titles[group.key];+ const anchor = state.anchorOf(group.key);+ const options = [+ ...group.stays+ .filter((stay) => stay.lat !== null)+ .map((stay) => ({+ value: String(stay.suggestionId),+ label: state.choice ? nameOf(state.choice, stay) : stay.name,+ })),+ ...(isReport ? [{ value: 'none', label: t('journey.dayImport.noPin') }] : []),+ ];+ return (+ <div className="flex flex-wrap items-center gap-2">+ <input+ value={typed ?? (isReport ? state.reportDefault : nameOfAnchor(state, group, anchor))}+ onChange={(e) => state.setTitle(group.key, e.target.value)}+ aria-label={t('journey.dayImport.groupTitle')}+ disabled={state.busy !== null}+ className={`${INPUT} min-w-[160px] flex-1`}+ />+ {options.length > 0 && (+ <PillSelect+ quiet+ label={t('journey.dayImport.groupPin')}+ value={anchor === null ? 'none' : String(anchor)}+ options={options}+ onChange={(value) => state.setAnchor(group.key, value === 'none' ? null : Number(value))}+ />+ )}+ </div>+ );+}++function nameOfAnchor(state: JourneyDayImportState, group: DayImportGroup, anchor: number | null): string {+ const stay = group.stays.find((s) => s.suggestionId === anchor) ?? group.stays[0];+ return stay && state.choice ? nameOf(state.choice, stay) : '';+}++/** The day report: one entry for all chosen stays, its title and its one map position. */+function ReportBox({ state }: { state: JourneyDayImportState }) {+ const { t } = useTranslation();+ const report = state.groups.find((group) => group.kind === 'report');+ return (+ <div className={PANEL}>+ {report ? (+ <GroupHead state={state} group={report} />+ ) : (+ <p className="m-0 text-content-muted" style={fs(12, 'body')}>+ {t('journey.dayImport.reportNeedsTwo')}+ </p>+ )}+ <p className="m-0 text-content-faint" style={fs(11.5)}>+ {t('journey.dayImport.reportHint')}+ </p>+ </div>+ );+}++/**+ * The stays of the day in the order they were lived, numbered like their pins:+ * chosen ones in front, the rest dimmed, joined ones framed under the title and+ * position of the entry they become. In report mode all chosen stays become+ * one report, so there is nothing to join.+ */+export function JourneyDayImportStays({ state, dayColor }: Props) {+ const { stays, choice } = state;+ if (!choice) return null;+ const merged = new Map(+ state.groups.filter((group) => group.kind === 'merged').map((group) => [group.key, group] as const)+ );+ const inGroup = new Set([...merged.values()].flatMap((group) => group.stays.slice(1).map((s) => s.suggestionId)));+ return (+ <div className="flex flex-col gap-1.5">+ {choice.mode === 'report' && <ReportBox state={state} />}+ {stays.map((stay, index) => {+ if (inGroup.has(stay.suggestionId)) return null;+ const group = merged.get(stay.suggestionId);+ const toggle = canJoin(choice, stays, index) ? <JoinToggle state={state} stay={stay} /> : null;+ if (!group) {+ return (+ <div key={stay.suggestionId} className="flex flex-col gap-1.5">+ {toggle}+ <StayRow state={state} dayColor={dayColor} stay={stay} index={index} />+ </div>+ );+ }+ return (+ <div key={stay.suggestionId} className="flex flex-col gap-1.5">+ {toggle}+ <div className={PANEL}>+ <GroupHead state={state} group={group} />+ {group.stays.map((member, offset) => {+ const at = index + offset;+ return (+ <div key={member.suggestionId} className="flex flex-col gap-1.5">+ {offset > 0 && <JoinToggle state={state} stay={member} />}+ <StayRow state={state} dayColor={dayColor} stay={member} index={at} />+ </div>+ );+ })}+ </div>+ </div>+ );+ })}+ </div>+ );+}diff --git a/client/src/components/Journey/JourneyRecordingDialog.tsx b/client/src/components/Journey/JourneyRecordingDialog.tsxindex fea31f6be..3bf4ed577 100644--- a/client/src/components/Journey/JourneyRecordingDialog.tsx+++ b/client/src/components/Journey/JourneyRecordingDialog.tsx@@ -1,7 +1,5 @@-import { useId } from 'react';import { useTranslation } from '../../i18n';-import DawarichIcon from '../shared/DawarichIcon';-import { DialogFooter, DialogHeader, DialogShell, DialogTile, NEUTRAL_TINT } from '../shared/DialogShell';+import DawarichDayDialog from './DawarichDayDialog';import { JourneyRecordingActions, JourneyRecordingReview } from './JourneyRecordingReview';import { useJourneyRecordingDay, type JourneyRecordingViewProps } from './useJourneyRecordingDay';@@ -17,45 +15,18 @@ export default function JourneyRecordingDialog({onClose,...rest}: JourneyRecordingViewProps) {- const { t, locale } = useTranslation();- const labelId = useId();+ const { t } = useTranslation();const day = useJourneyRecordingDay({ date, onClose, ...rest });- const title = new Date(`${date}T00:00:00`).toLocaleDateString(locale, {- weekday: 'long',- day: 'numeric',- month: 'long',- year: 'numeric',- });return (- <DialogShell+ <DawarichDayDialog+ journeyTitle={day.preview?.journey.title ?? journeyTitle}+ date={date}+ sub={t('journey.recording.sub')}onClose={onClose}- labelledBy={labelId}- width="detail"- align="top"- header={- <DialogHeader- tile={- <DialogTile>- <DawarichIcon size={26} />- </DialogTile>- }- tint={NEUTRAL_TINT}- labelId={labelId}- onClose={onClose}- eyebrow={day.preview?.journey.title ?? journeyTitle}- title={title}- sub={t('journey.recording.sub')}- subWraps- />- }- footer={- <DialogFooter>- <JourneyRecordingActions day={day} stored={stored} onCancel={onClose} />- </DialogFooter>- }+ footer={<JourneyRecordingActions day={day} stored={stored} onCancel={onClose} />}><JourneyRecordingReview day={day} stored={stored} />- </DialogShell>+ </DawarichDayDialog>);}diff --git a/client/src/components/Journey/JourneyRecordingReview.tsx b/client/src/components/Journey/JourneyRecordingReview.tsxindex 63edd7cae..c32ee9984 100644--- a/client/src/components/Journey/JourneyRecordingReview.tsx+++ b/client/src/components/Journey/JourneyRecordingReview.tsx@@ -19,7 +19,7 @@ const SKETCH_W = 320;const SKETCH_H = 150;/** A sentence about the recording, its icon saying how much it matters. */-function Notice({ tone, children }: { tone: 'info' | 'warning' | 'danger'; children: ReactNode }) {+export function Notice({ tone, children }: { tone: 'info' | 'warning' | 'danger'; children: ReactNode }) {const look = {info: 'bg-surface-secondary text-content-secondary',warning: 'bg-warning-soft text-warning',diff --git a/client/src/components/Journey/journeyDayImportModel.test.ts b/client/src/components/Journey/journeyDayImportModel.test.tsnew file mode 100644index 000000000..35c071da7--- /dev/null+++ b/client/src/components/Journey/journeyDayImportModel.test.ts@@ -0,0 +1,113 @@+// FE-JRN-DAYIMPORT-MODEL-001 to FE-JRN-DAYIMPORT-MODEL-008+//+// JRN-02: what the traveller decided in the day take-over, before anything is+// written. Two stays at San Marco, a parking stop and Rialto, as the review+// lists them.+import type { JourneyDayStay } from '@trek/shared';+import { describe, expect, it } from 'vitest';+import { buildDayStay, buildDayStays } from '../../../tests/helpers/journeyRecording';+import {+ canJoin,+ defaultAnchor,+ groupsOf,+ initialChoice,+ problemOf,+ rename,+ REPORT_KEY,+ requestOf,+ titleOf,+ toggleJoin,+ toggleStay,+ type DayImportChoice,+} from './journeyDayImportModel';++const STAYS = buildDayStays().stays;+const [PARKING, MARKUS, , RIALTO] = STAYS as [JourneyDayStay, JourneyDayStay, JourneyDayStay, JourneyDayStay];+const REPORT = 'Day of 14 May';++describe('journeyDayImportModel', () => {+ it('FE-JRN-DAYIMPORT-MODEL-001: every open stay starts chosen, and the same place twice in a row starts joined', () => {+ const choice = initialChoice(STAYS);+ expect([...choice.selected]).toEqual([10, 11, 12, 13]);+ expect([...choice.joined]).toEqual([12]);+ expect(groupsOf(choice, STAYS).map((g) => [g.kind, g.stays.map((s) => s.suggestionId)])).toEqual([+ ['single', [10]],+ ['merged', [11, 12]],+ ['single', [13]],+ ]);+ });++ it('FE-JRN-DAYIMPORT-MODEL-002: stays the journal holds or that went elsewhere are never chosen; one left out before starts unchosen', () => {+ const stays = [+ buildDayStay({ suggestionId: 1, status: 'here', entry: { id: 4, title: 'Morning' } }),+ buildDayStay({ suggestionId: 2, status: 'elsewhere', name: 'Rialto' }),+ buildDayStay({ suggestionId: 3, status: 'skipped', name: 'Lido' }),+ ];+ const choice = initialChoice(stays);+ expect(choice.selected.size).toBe(0);+ expect(problemOf(choice, stays, REPORT)).toBe('nothing');+ const picked = toggleStay(choice, 3);+ expect(groupsOf(picked, stays).map((g) => g.key)).toEqual([3]);+ expect(requestOf(picked, stays, REPORT)).toEqual({ groups: [{ kind: 'single', stays: [{ suggestionId: 3 }] }] });+ });++ it('FE-JRN-DAYIMPORT-MODEL-003: an open stay left unchosen is sent as left out, and a renamed one under its new name', () => {+ let choice = toggleStay(initialChoice(STAYS), 10);+ choice = rename(choice, RIALTO, ' Ponte di Rialto ');+ expect(requestOf(choice, STAYS, REPORT)).toEqual({+ groups: [+ {+ kind: 'merged',+ stays: [{ suggestionId: 11 }, { suggestionId: 12 }],+ title: 'Piazza San Marco',+ anchorSuggestionId: 12,+ },+ { kind: 'single', stays: [{ suggestionId: 13, name: 'Ponte di Rialto' }] },+ ],+ skipSuggestionIds: [10],+ });+ });++ it('FE-JRN-DAYIMPORT-MODEL-004: joining needs both neighbours chosen; unchoosing a stay separates it', () => {+ const choice = toggleStay(initialChoice(STAYS), 11);+ expect(canJoin(choice, STAYS, 2)).toBe(false);+ expect(groupsOf(choice, STAYS).map((g) => g.kind)).toEqual(['single', 'single', 'single']);+ const back = toggleStay(choice, 11);+ expect(back.joined.has(12)).toBe(true);+ expect(canJoin(back, STAYS, 1)).toBe(true);+ const joined = toggleJoin(back, 11);+ expect(groupsOf(joined, STAYS).map((g) => g.stays.length)).toEqual([3, 1]);+ });++ it('FE-JRN-DAYIMPORT-MODEL-005: a day report takes every chosen stay, titled by default, at the longest stay or off the map', () => {+ const choice = { ...initialChoice(STAYS), mode: 'report' as const };+ const [report] = groupsOf(choice, STAYS);+ if (!report) throw new Error('no report');+ expect(report).toMatchObject({ key: REPORT_KEY, kind: 'report' });+ expect(report.stays).toHaveLength(4);+ expect(titleOf(choice, report, REPORT)).toBe(REPORT);+ expect(requestOf(choice, STAYS, REPORT).groups[0]).toMatchObject({ title: REPORT, anchorSuggestionId: 12 });+ const offMap = { ...choice, anchors: { [REPORT_KEY]: null } };+ expect(requestOf(offMap, STAYS, REPORT).groups[0]).toMatchObject({ anchorSuggestionId: null });+ });++ it('FE-JRN-DAYIMPORT-MODEL-006: a report of one chosen stay is that stay on its own', () => {+ let choice: DayImportChoice = { ...initialChoice(STAYS), mode: 'report' };+ for (const id of [10, 11, 12]) choice = toggleStay(choice, id);+ expect(groupsOf(choice, STAYS)).toEqual([{ key: 13, kind: 'single', stays: [RIALTO] }]);+ });++ it('FE-JRN-DAYIMPORT-MODEL-007: a blank name or a blank title holds the take-over back, so no card is empty', () => {+ const choice = initialChoice(STAYS);+ expect(problemOf(choice, STAYS, REPORT)).toBeNull();+ expect(problemOf(rename(choice, PARKING, ' '), STAYS, REPORT)).toBe('name');+ expect(problemOf({ ...choice, titles: { 11: ' ' } }, STAYS, REPORT)).toBe('title');+ expect(problemOf({ ...choice, mode: 'report', titles: { [REPORT_KEY]: '' } }, STAYS, REPORT)).toBe('title');+ });++ it('FE-JRN-DAYIMPORT-MODEL-008: the default position is the longest stay that has a place', () => {+ expect(defaultAnchor(STAYS)).toBe(12);+ expect(defaultAnchor([buildDayStay({ suggestionId: 5, lat: null, lng: null })])).toBeNull();+ expect(rename(rename(initialChoice(STAYS), MARKUS, 'X'), MARKUS, MARKUS.name).names).toEqual({});+ });+});diff --git a/client/src/components/Journey/journeyDayImportModel.ts b/client/src/components/Journey/journeyDayImportModel.tsnew file mode 100644index 000000000..cfd17ebc3--- /dev/null+++ b/client/src/components/Journey/journeyDayImportModel.ts@@ -0,0 +1,186 @@+import type { JourneyDayImportRequest, JourneyDayStay } from '@trek/shared';++/**+ * What the traveller decided in the day take-over (JRN-02), before anything is+ * written: which stays, under which names, which of them belong together, and+ * whether the day becomes one report. Pure, so the dialog and the phone sheet+ * share it and the tests need no rendering.+ */+export interface DayImportChoice {+ selected: ReadonlySet<number>;+ /** Names as corrected, by suggestion id; a stay not in here keeps its recorded name. */+ names: Readonly<Record<number, string>>;+ /** Stays joined to the stay listed right before them. */+ joined: ReadonlySet<number>;+ mode: 'entries' | 'report';+ /** Titles as typed, by the key of the group they head. */+ titles: Readonly<Record<number, string>>;+ /** The stay a group is pinned to, by group key; null keeps a report off the map. */+ anchors: Readonly<Record<number, number | null>>;+}++export interface DayImportGroup {+ /** The first stay's id, or REPORT_KEY for the day report. */+ key: number;+ kind: 'single' | 'merged' | 'report';+ stays: JourneyDayStay[];+}++export const REPORT_KEY = 0;++/** Two stays this close under the same name are one place visited twice. */+const SAME_PLACE_METERS = 200;++export function isTakeable(stay: JourneyDayStay): boolean {+ return stay.status === 'open' || stay.status === 'skipped';+}++/**+ * Every open stay chosen, and the same place twice in a row already joined:+ * the square somebody left for a coffee and came back to is one memory.+ */+export function initialChoice(stays: JourneyDayStay[]): DayImportChoice {+ const selected = new Set(stays.filter((stay) => stay.status === 'open').map((stay) => stay.suggestionId));+ const joined = new Set<number>();+ stays.forEach((stay, index) => {+ const before = stays[index - 1];+ if (before && selected.has(stay.suggestionId) && selected.has(before.suggestionId) && samePlace(before, stay)) {+ joined.add(stay.suggestionId);+ }+ });+ return { selected, names: {}, joined, mode: 'entries', titles: {}, anchors: {} };+}++function samePlace(a: JourneyDayStay, b: JourneyDayStay): boolean {+ if (a.name.trim().toLowerCase() !== b.name.trim().toLowerCase()) return false;+ if (a.lat === null || a.lng === null || b.lat === null || b.lng === null) return true;+ const dLat = ((b.lat - a.lat) * Math.PI) / 180;+ const dLng = ((b.lng - a.lng) * Math.PI) / 180;+ const h =+ Math.sin(dLat / 2) ** 2 ++ Math.cos((a.lat * Math.PI) / 180) * Math.cos((b.lat * Math.PI) / 180) * Math.sin(dLng / 2) ** 2;+ return 2 * 6_371_000 * Math.asin(Math.sqrt(h)) <= SAME_PLACE_METERS;+}++export function nameOf(choice: DayImportChoice, stay: JourneyDayStay): string {+ return choice.names[stay.suggestionId] ?? stay.name;+}++/** Whether a stay can be joined to the one listed before it: both chosen and both free to take. */+export function canJoin(choice: DayImportChoice, stays: JourneyDayStay[], index: number): boolean {+ const stay = stays[index];+ const before = stays[index - 1];+ return (+ choice.mode === 'entries' &&+ !!stay &&+ !!before &&+ choice.selected.has(stay.suggestionId) &&+ choice.selected.has(before.suggestionId)+ );+}++/** The entries the choice writes, in the order the day was lived. */+export function groupsOf(choice: DayImportChoice, stays: JourneyDayStay[]): DayImportGroup[] {+ const chosen = stays.filter((stay) => isTakeable(stay) && choice.selected.has(stay.suggestionId));+ if (choice.mode === 'report' && chosen.length > 1) return [{ key: REPORT_KEY, kind: 'report', stays: chosen }];+ const groups: DayImportGroup[] = [];+ stays.forEach((stay, index) => {+ if (!chosen.includes(stay)) return;+ const last = groups[groups.length - 1];+ if (last && choice.joined.has(stay.suggestionId) && canJoin(choice, stays, index)) {+ last.stays.push(stay);+ last.kind = 'merged';+ } else {+ groups.push({ key: stay.suggestionId, kind: 'single', stays: [stay] });+ }+ });+ return groups;+}++/** The longest stay that has a place: where a group sits on the map unless somebody picks another. */+export function defaultAnchor(stays: JourneyDayStay[]): number | null {+ let best: JourneyDayStay | null = null;+ for (const stay of stays) {+ if (stay.lat === null || stay.lng === null) continue;+ if (!best || stay.durationMinutes > best.durationMinutes) best = stay;+ }+ return best?.suggestionId ?? null;+}++export function anchorOf(choice: DayImportChoice, group: DayImportGroup): number | null {+ const picked = choice.anchors[group.key];+ return picked === undefined ? defaultAnchor(group.stays) : picked;+}++/** A group's title as typed, else what it starts with: the place for a merged entry, the given default for a report. */+export function titleOf(choice: DayImportChoice, group: DayImportGroup, reportDefault: string): string {+ const typed = choice.titles[group.key];+ if (typed !== undefined) return typed;+ if (group.kind === 'report') return reportDefault;+ const anchor = group.stays.find((stay) => stay.suggestionId === anchorOf(choice, group)) ?? group.stays[0];+ return anchor ? nameOf(choice, anchor) : '';+}++/** Why the choice cannot be taken over yet, or null. A blank name or title would write an empty card. */+export function problemOf(+ choice: DayImportChoice,+ stays: JourneyDayStay[],+ reportDefault: string+): 'nothing' | 'name' | 'title' | null {+ const groups = groupsOf(choice, stays);+ if (groups.length === 0) return 'nothing';+ if (groups.some((group) => group.stays.some((stay) => !nameOf(choice, stay).trim()))) return 'name';+ if (groups.some((group) => group.kind !== 'single' && !titleOf(choice, group, reportDefault).trim())) return 'title';+ return null;+}++/** The take-over as the server reads it; open stays left unchosen are sent as left out. */+export function requestOf(+ choice: DayImportChoice,+ stays: JourneyDayStay[],+ reportDefault: string+): JourneyDayImportRequest {+ const groups = groupsOf(choice, stays).map((group) => {+ const named = group.stays.map((stay) => {+ const name = nameOf(choice, stay).trim();+ return name === stay.name ? { suggestionId: stay.suggestionId } : { suggestionId: stay.suggestionId, name };+ });+ if (group.kind === 'single') return { kind: group.kind, stays: named };+ return {+ kind: group.kind,+ stays: named,+ title: titleOf(choice, group, reportDefault).trim(),+ anchorSuggestionId: anchorOf(choice, group),+ };+ });+ const skipSuggestionIds = stays+ .filter((stay) => stay.status === 'open' && !choice.selected.has(stay.suggestionId))+ .map((stay) => stay.suggestionId);+ return skipSuggestionIds.length > 0 ? { groups, skipSuggestionIds } : { groups };+}++export function toggleStay(choice: DayImportChoice, id: number): DayImportChoice {+ const selected = new Set(choice.selected);+ const joined = new Set(choice.joined);+ if (selected.has(id)) {+ selected.delete(id);+ joined.delete(id);+ } else {+ selected.add(id);+ }+ return { ...choice, selected, joined };+}++export function toggleJoin(choice: DayImportChoice, id: number): DayImportChoice {+ const joined = new Set(choice.joined);+ if (joined.has(id)) joined.delete(id);+ else joined.add(id);+ return { ...choice, joined };+}++export function rename(choice: DayImportChoice, stay: JourneyDayStay, name: string): DayImportChoice {+ const names = { ...choice.names };+ if (name === stay.name) delete names[stay.suggestionId];+ else names[stay.suggestionId] = name;+ return { ...choice, names };+}diff --git a/client/src/components/Journey/journeyRecordingModel.ts b/client/src/components/Journey/journeyRecordingModel.tsindex f32c2adf2..10949790e 100644--- a/client/src/components/Journey/journeyRecordingModel.ts+++ b/client/src/components/Journey/journeyRecordingModel.ts@@ -95,6 +95,11 @@ export function recordingErrorText(err: unknown, t: Translate): string {if (code === 'recording_exists' || code === 'recording_changed' || code === 'recording_empty') {return t(`journey.recording.error.${code}`);}+ return reasonText(code, t);+}++/** A reason Dawarich gave as a code, in the reader's language; one TREK has no words for reads as unknown. */+export function reasonText(code: string | null, t: Translate): string {if (code) {const key = `dawarich.error.${code}`;const text = t(key);diff --git a/client/src/components/Journey/useJourneyDayImport.test.ts b/client/src/components/Journey/useJourneyDayImport.test.tsnew file mode 100644index 000000000..1dbd6b5a4--- /dev/null+++ b/client/src/components/Journey/useJourneyDayImport.test.ts@@ -0,0 +1,172 @@+// FE-JRN-DAYIMPORT-001 to FE-JRN-DAYIMPORT-007+//+// JRN-02: taking a recorded day with its stays into the journal, for the+// desktop dialog and the phone sheet alike. Nothing is written before the+// button; a failed take-over reads the day again and keeps what was chosen;+// the route goes along only when asked, and a route that fails after the+// drafts keeps the dialog open to try the route alone.+import { beforeEach, describe, expect, it, vi } from 'vitest';+import { buildDayStays, buildRecordedDay, buildRecordingPreview } from '../../../tests/helpers/journeyRecording';+import { act, renderHook, waitFor } from '../../../tests/helpers/render';+import { TranslationProvider } from '../../i18n/TranslationContext';+import { useJourneyDayImport } from './useJourneyDayImport';++const repo = vi.hoisted(() => ({+ reviewDay: vi.fn(),+ takeOverDay: vi.fn(),+ preview: vi.fn(),+ save: vi.fn(),+ remove: vi.fn(),+}));+vi.mock('../../repo/journeyRecordingsRepo', () => ({ journeyRecordingsRepo: repo }));++const toast = { success: vi.fn(), error: vi.fn(), warning: vi.fn(), info: vi.fn() };+vi.mock('../shared/Toast', () => ({ useToast: () => toast }));++const HASH = 'a'.repeat(64);+const httpError = (code: string) => Object.assign(new Error(code), { response: { data: { error: code, code } } });++function setup(over: { storedRoute?: ReturnType<typeof buildRecordedDay> } = {}) {+ const onTakenOver = vi.fn();+ const onKept = vi.fn();+ const onClose = vi.fn();+ const view = renderHook(+ () =>+ useJourneyDayImport({+ journeyId: 7,+ date: '2026-05-14',+ dayColor: '#ff0055',+ storedRoute: over.storedRoute,+ onTakenOver,+ onKept,+ onClose,+ }),+ { wrapper: TranslationProvider }+ );+ return { ...view, onTakenOver, onKept, onClose };+}++beforeEach(() => {+ for (const fn of [...Object.values(repo), ...Object.values(toast)]) fn.mockReset();+ repo.reviewDay.mockResolvedValue(buildDayStays());+ repo.preview.mockResolvedValue(buildRecordingPreview());+ repo.takeOverDay.mockResolvedValue({+ entries: [{ id: 5, title: 'Piazza San Marco', stayCount: 2 }],+ alreadyTaken: [],+ skipped: [],+ });+});++describe('useJourneyDayImport', () => {+ it('FE-JRN-DAYIMPORT-001: reads the day, chooses its open stays, joins the same place twice and pins them in the day colour', async () => {+ const { result } = setup();+ await waitFor(() => expect(result.current.loading).toBe(false));++ expect(repo.reviewDay).toHaveBeenCalledWith(7, '2026-05-14', expect.any(AbortSignal));+ expect(result.current.groups.map((g) => g.kind)).toEqual(['single', 'merged', 'single']);+ expect(result.current.problem).toBeNull();+ expect(result.current.mapEntries).toHaveLength(4);+ expect(result.current.mapEntries[0]).toMatchObject({ id: 'stay-10', dayColor: '#ff0055', dayLabel: 1 });+ expect(repo.takeOverDay).not.toHaveBeenCalled();+ });++ it('FE-JRN-DAYIMPORT-002: takes the chosen stays over, leaving the unchosen open one out, then reloads the journey and closes', async () => {+ const { result, onTakenOver, onClose } = setup();+ await waitFor(() => expect(result.current.choice).not.toBeNull());++ act(() => result.current.toggle(10));+ await act(async () => result.current.submit());++ expect(repo.takeOverDay).toHaveBeenCalledWith(7, '2026-05-14', {+ groups: [+ {+ kind: 'merged',+ stays: [{ suggestionId: 11 }, { suggestionId: 12 }],+ title: 'Piazza San Marco',+ anchorSuggestionId: 12,+ },+ { kind: 'single', stays: [{ suggestionId: 13 }] },+ ],+ skipSuggestionIds: [10],+ });+ expect(toast.success).toHaveBeenCalledWith('1 draft taken over');+ expect(onTakenOver).toHaveBeenCalledTimes(1);+ expect(onClose).toHaveBeenCalledTimes(1);+ expect(repo.save).not.toHaveBeenCalled();+ });++ it('FE-JRN-DAYIMPORT-003: a failed take-over says nothing was taken over, reads the day again and keeps the names given', async () => {+ const { result, onTakenOver, onClose } = setup();+ await waitFor(() => expect(result.current.choice).not.toBeNull());+ repo.takeOverDay.mockRejectedValue(httpError('stay_not_on_day'));+ const stays = buildDayStays().stays;++ act(() => result.current.rename(stays[3] as (typeof stays)[number], 'Ponte di Rialto'));+ await act(async () => result.current.submit());++ await waitFor(() => expect(repo.reviewDay).toHaveBeenCalledTimes(2));+ expect(result.current.outcome?.kind).toBe('failed');+ expect(result.current.choice?.names).toEqual({ 13: 'Ponte di Rialto' });+ expect(onTakenOver).not.toHaveBeenCalled();+ expect(onClose).not.toHaveBeenCalled();+ });++ it('FE-JRN-DAYIMPORT-004: the route goes along only when switched on, kept as previewed', async () => {+ const { result, onKept, onClose } = setup();+ await waitFor(() => expect(result.current.route.offer).toBe('keep'));+ repo.save.mockResolvedValue({ day: buildRecordedDay(), outcome: 'created' });++ act(() => result.current.route.toggle());+ await act(async () => result.current.submit());++ expect(repo.save).toHaveBeenCalledWith(7, '2026-05-14', { utcOffsetMinutes: 120, expectedHash: HASH });+ expect(onKept).toHaveBeenCalledTimes(1);+ expect(onClose).toHaveBeenCalledTimes(1);+ });++ it('FE-JRN-DAYIMPORT-005: a route that fails after the drafts keeps the dialog open to keep the route alone', async () => {+ const { result, onTakenOver, onClose } = setup();+ await waitFor(() => expect(result.current.route.offer).toBe('keep'));+ repo.save.mockRejectedValueOnce(httpError('recording_changed'));++ act(() => result.current.route.toggle());+ await act(async () => result.current.submit());++ expect(onTakenOver).toHaveBeenCalledTimes(1);+ expect(result.current.outcome?.kind).toBe('route');+ expect(onClose).not.toHaveBeenCalled();++ repo.save.mockResolvedValue({ day: buildRecordedDay(), outcome: 'created' });+ await act(async () => result.current.retryRoute());+ await waitFor(() => expect(onClose).toHaveBeenCalledTimes(1));+ expect(repo.takeOverDay).toHaveBeenCalledTimes(1);+ });++ it('FE-JRN-DAYIMPORT-006: a day whose route is kept offers no second copy, and stays held already are announced', async () => {+ repo.takeOverDay.mockResolvedValue({ entries: [], alreadyTaken: [11, 12], skipped: [] });+ const { result } = setup({ storedRoute: buildRecordedDay() });+ await waitFor(() => expect(result.current.loading).toBe(false));+ await waitFor(() => expect(result.current.route.offer).toBe('kept'));++ await act(async () => result.current.submit());++ expect(toast.success).not.toHaveBeenCalled();+ expect(toast.info).toHaveBeenCalledWith('2 stays were in the journal already. Nothing was written twice.');+ expect(repo.save).not.toHaveBeenCalled();+ });++ it('FE-JRN-DAYIMPORT-007: nothing chosen holds the take-over back, and a review that fails says why', async () => {+ const { result } = setup();+ await waitFor(() => expect(result.current.choice).not.toBeNull());+ act(() => {+ for (const id of [10, 11, 12, 13]) result.current.toggle(id);+ });+ expect(result.current.problem).toBe('nothing');+ await act(async () => result.current.submit());+ expect(repo.takeOverDay).not.toHaveBeenCalled();++ repo.reviewDay.mockRejectedValue(httpError('unreachable'));+ act(() => result.current.retry());+ await waitFor(() => expect(result.current.error).not.toBeNull());+ });+});diff --git a/client/src/components/Journey/useJourneyDayImport.ts b/client/src/components/Journey/useJourneyDayImport.tsnew file mode 100644index 000000000..609dd92d8--- /dev/null+++ b/client/src/components/Journey/useJourneyDayImport.ts@@ -0,0 +1,337 @@+import type {+ JourneyDayImportResult,+ JourneyDayStay,+ JourneyDayStays,+ JourneyRecordedDay,+ JourneyRecordingPreview,+ JourneyTrack,+} from '@trek/shared';+import { useCallback, useEffect, useMemo, useState } from 'react';+import { useTranslation } from '../../i18n';+import { journeyRecordingsRepo } from '../../repo/journeyRecordingsRepo';+import { useToast } from '../shared/Toast';+import {+ anchorOf,+ groupsOf,+ initialChoice,+ isTakeable,+ nameOf,+ problemOf,+ rename,+ requestOf,+ toggleJoin,+ toggleStay,+ type DayImportChoice,+} from './journeyDayImportModel';+import { recordingErrorText } from './journeyRecordingModel';+import { useJourneyRecordingDay } from './useJourneyRecordingDay';++/** What the desktop dialog and the phone sheet are opened with. */+export interface JourneyDayImportViewProps {+ journeyId: number;+ journeyTitle: string;+ date: string;+ /** The colour of the day's pins on the journey map, so its stays read as that day. */+ dayColor: string;+ /** The route the journey keeps for the day, if any. */+ storedRoute: JourneyRecordedDay | undefined;+ /** Drafts were written: the journey and the stay list are read again. */+ onTakenOver: () => void;+ onKept: (day: JourneyRecordedDay) => void;+ onClose: () => void;+}++/**+ * Something went wrong on the way. `failed`: nothing was taken over, the list+ * shows what the journal holds now and sending again writes nothing twice.+ * `route`: the drafts are in, only the route was not kept.+ */+type Outcome = { kind: 'failed' | 'route'; reason: string };++type RouteOffer = 'loading' | 'kept' | 'keep' | 'differs' | 'none';++const noop = () => {};++/** The map marker id of a stay, so a pin and its row find each other. */+export function stayMarkerId(suggestionId: number): string {+ return `stay-${suggestionId}`;+}++/**+ * The day's stays from the traveller's own Dawarich and what they chose of+ * them. A reload of the same day keeps the choice, so names and joins survive+ * a failed attempt; the last answer stays shown while the next one is read.+ */+function useDayReview(journeyId: number, date: string) {+ const [reloadToken, setReloadToken] = useState(0);+ const forDay = `${journeyId}|${date}`;+ const requestKey = `${forDay}|${reloadToken}`;+ const [answer, setAnswer] = useState<{ key: string; review: JourneyDayStays | null; failure: unknown }>(NO_ANSWER);+ const [chosen, setChosen] = useState<{ forDay: string; choice: DayImportChoice } | null>(null);++ useEffect(() => {+ const controller = new AbortController();+ let cancelled = false;+ journeyRecordingsRepo+ .reviewDay(journeyId, date, controller.signal)+ .then((review) => {+ if (cancelled) return;+ setAnswer({ key: requestKey, review, failure: null });+ setChosen((prev) => (prev?.forDay === forDay ? prev : { forDay, choice: initialChoice(review.stays) }));+ })+ .catch((failure: unknown) => {+ if (!cancelled) setAnswer({ key: requestKey, review: null, failure });+ });+ return () => {+ cancelled = true;+ controller.abort();+ };+ }, [journeyId, date, forDay, requestKey]);++ const update = useCallback(+ (change: (choice: DayImportChoice) => DayImportChoice) =>+ setChosen((prev) => (prev ? { ...prev, choice: change(prev.choice) } : prev)),+ []+ );++ return {+ review: answer.review,+ loading: answer.key !== requestKey,+ failure: answer.key === requestKey ? answer.failure : null,+ choice: chosen?.forDay === forDay ? chosen.choice : null,+ update,+ reload: useCallback(() => setReloadToken((n) => n + 1), []),+ };+}++/** What the dialog offers for the day's route: kept already, kept in another version, to keep, or nothing recorded. */+function routeOfferOf(+ stored: JourneyRecordedDay | undefined,+ route: ReturnType<typeof useJourneyRecordingDay>+): RouteOffer {+ if (stored) return route.action === 'replace' ? 'differs' : 'kept';+ if (route.loading) return 'loading';+ return route.action === 'keep' ? 'keep' : 'none';+}++/** The stays as numbered pins in the day's colour, unchosen ones in the map's neutral pin, and the route under them. */+function useDayMap(+ stays: JourneyDayStay[],+ choice: DayImportChoice | null,+ date: string,+ dayColor: string,+ route: JourneyRecordedDay | JourneyRecordingPreview | null+) {+ const { t } = useTranslation();+ const entries = useMemo(+ () =>+ stays.flatMap((stay, index) =>+ stay.lat === null || stay.lng === null+ ? []+ : [+ {+ id: stayMarkerId(stay.suggestionId),+ lat: stay.lat,+ lng: stay.lng,+ title: choice ? nameOf(choice, stay) : stay.name,+ entry_date: date,+ dayColor: choice?.selected.has(stay.suggestionId) && isTakeable(stay) ? dayColor : undefined,+ dayLabel: index + 1,+ },+ ]+ ),+ [stays, choice, date, dayColor]+ );+ const tracks = useMemo<JourneyTrack[]>(+ () =>+ (route?.segments ?? []).map((segment, index) => ({+ place_id: -(index + 1),+ trip_id: 0,+ name: t('journey.recording.scope'),+ color: dayColor,+ points: segment.points,+ kind: 'day_recording',+ })),+ [route, dayColor, t]+ );+ return { entries, tracks };+}++/**+ * The take-over and, when asked, the route after it. A take-over that fails+ * leaves nothing written and reads the day again; a route that fails after+ * the drafts are in keeps the dialog open to try the route alone.+ */+function useDayTakeOver({+ journeyId,+ date,+ preview,+ onTakenOver,+ onKept,+ onClose,+ reload,+}: {+ journeyId: number;+ date: string;+ preview: JourneyRecordingPreview | null;+ onTakenOver: () => void;+ onKept: (day: JourneyRecordedDay) => void;+ onClose: () => void;+ reload: () => void;+}) {+ const { t } = useTranslation();+ const toast = useToast();+ const [busy, setBusy] = useState<'submit' | 'route' | null>(null);+ const [outcome, setOutcome] = useState<Outcome | null>(null);++ const saveRoute = useCallback(async (): Promise<boolean> => {+ if (!preview?.contentHash) return true;+ try {+ const saved = await journeyRecordingsRepo.save(journeyId, date, {+ utcOffsetMinutes: preview.utcOffsetMinutes,+ expectedHash: preview.contentHash,+ });+ onKept(saved.day);+ return true;+ } catch (err) {+ setOutcome({ kind: 'route', reason: recordingErrorText(err, t) });+ return false;+ }+ }, [preview, journeyId, date, onKept, t]);++ const announce = useCallback(+ (result: JourneyDayImportResult) => {+ if (result.entries.length > 0) toast.success(t('journey.dayImport.done', { count: result.entries.length }));+ if (result.alreadyTaken.length > 0) {+ toast.info(t('journey.dayImport.alreadyTaken', { count: result.alreadyTaken.length }));+ }+ },+ [toast, t]+ );++ const submit = useCallback(+ async (request: Parameters<typeof journeyRecordingsRepo.takeOverDay>[2], withRoute: boolean) => {+ setBusy('submit');+ setOutcome(null);+ try {+ announce(await journeyRecordingsRepo.takeOverDay(journeyId, date, request));+ onTakenOver();+ if (!withRoute || (await saveRoute())) onClose();+ else reload();+ } catch (err) {+ setOutcome({ kind: 'failed', reason: recordingErrorText(err, t) });+ // The answer may be lost after the write: read again, so the list says what the journal holds.+ reload();+ } finally {+ setBusy(null);+ }+ },+ [journeyId, date, announce, onTakenOver, saveRoute, onClose, reload, t]+ );++ const retryRoute = useCallback(async () => {+ setBusy('route');+ setOutcome(null);+ const kept = await saveRoute();+ setBusy(null);+ if (!kept) return;+ toast.success(t('journey.recording.keptToast'));+ onClose();+ }, [saveRoute, toast, t, onClose]);++ return { busy, outcome, submit, retryRoute };+}++/**+ * Taking a recorded day into the journal with its stays (JRN-02), for the+ * desktop dialog and the phone sheet alike: the day's stays read from the+ * traveller's own Dawarich, the choice of which become drafts under which+ * names and in which groups, the day's route on the same map, and the+ * take-over itself. Nothing is written before the button; cancelling leaves+ * everything as it was.+ */+export function useJourneyDayImport({+ journeyId,+ date,+ dayColor,+ storedRoute,+ onTakenOver,+ onKept,+ onClose,+}: Omit<JourneyDayImportViewProps, 'journeyTitle'>) {+ const { t, locale } = useTranslation();+ const day = useDayReview(journeyId, date);+ const route = useJourneyRecordingDay({ journeyId, date, onKept, onRemoved: noop, onClose: noop });+ const [keepRoute, setKeepRoute] = useState(false);+ const [activeStay, setActiveStay] = useState<number | null>(null);+ const { choice, update } = day;+ const stays = useMemo(() => day.review?.stays ?? [], [day.review]);+ const reportDefault = t('journey.dayImport.reportDefault', {+ date: new Date(`${date}T00:00:00`).toLocaleDateString(locale, { day: 'numeric', month: 'long' }),+ });+ const routeOffer = routeOfferOf(storedRoute, route);+ const map = useDayMap(+ stays,+ choice,+ date,+ dayColor,+ storedRoute ?? (route.preview?.contentHash ? route.preview : null)+ );+ const takeOver = useDayTakeOver({+ journeyId,+ date,+ preview: route.preview,+ onTakenOver,+ onKept,+ onClose,+ reload: day.reload,+ });+ const groups = useMemo(() => (choice ? groupsOf(choice, stays) : []), [choice, stays]);+ const problem = choice ? problemOf(choice, stays, reportDefault) : 'nothing';++ return {+ review: day.review,+ loading: day.loading,+ /** Translated; null while nothing failed. */+ error: day.failure === null ? null : recordingErrorText(day.failure, t),+ retry: day.reload,+ choice,+ stays,+ groups,+ problem,+ reportDefault,+ skipCount: stays.filter((stay) => stay.status === 'open' && !choice?.selected.has(stay.suggestionId)).length,+ activeStay,+ setActiveStay,+ mapEntries: map.entries,+ mapTracks: map.tracks,+ route: {+ offer: routeOffer,+ distanceMeters: (storedRoute ?? route.preview)?.stats.distanceMeters ?? null,+ keep: keepRoute,+ toggle: () => setKeepRoute((on) => !on),+ },+ busy: takeOver.busy,+ outcome: takeOver.outcome,+ submit: () => {+ if (choice && !problem) {+ void takeOver.submit(requestOf(choice, stays, reportDefault), keepRoute && routeOffer === 'keep');+ }+ },+ retryRoute: () => void takeOver.retryRoute(),+ toggle: (id: number) => update((c) => toggleStay(c, id)),+ join: (id: number) => update((c) => toggleJoin(c, id)),+ rename: (stay: JourneyDayStay, name: string) => update((c) => rename(c, stay, name)),+ setMode: (mode: DayImportChoice['mode']) => update((c) => ({ ...c, mode })),+ setTitle: (key: number, title: string) => update((c) => ({ ...c, titles: { ...c.titles, [key]: title } })),+ setAnchor: (key: number, id: number | null) => update((c) => ({ ...c, anchors: { ...c.anchors, [key]: id } })),+ anchorOf: (key: number) => {+ const group = groups.find((g) => g.key === key);+ return group && choice ? anchorOf(choice, group) : null;+ },+ };+}++export type JourneyDayImportState = ReturnType<typeof useJourneyDayImport>;++const NO_ANSWER = { key: '', review: null, failure: null };diff --git a/client/src/mobile/screens/journey/MDawarichDaySheet.tsx b/client/src/mobile/screens/journey/MDawarichDaySheet.tsxnew file mode 100644index 000000000..51a32ed84--- /dev/null+++ b/client/src/mobile/screens/journey/MDawarichDaySheet.tsx@@ -0,0 +1,60 @@+import type { ReactNode } from 'react';+import DawarichIcon from '../../../components/shared/DawarichIcon';+import { useTranslation } from '../../../i18n';+import MSheet from '../../components/MSheet';+import { FormSheetHeader } from '../trip/sheets/PlSheetChrome';++/**+ * The phone frame of a journey day read from Dawarich (JRN-01, JRN-02): a+ * bottom sheet with the Dawarich mark, the day and the journey on top, what+ * it does, the body to scroll and the buttons under it.+ */+export default function MDawarichDaySheet({+ journeyTitle,+ date,+ sub,+ ariaLabel,+ onClose,+ footer,+ children,+}: {+ journeyTitle: string;+ date: string;+ sub: string;+ ariaLabel: string;+ onClose: () => void;+ footer: ReactNode;+ children: ReactNode;+}) {+ const { t, locale } = useTranslation();+ const title = new Date(`${date}T00:00:00`).toLocaleDateString(locale, {+ weekday: 'long',+ day: 'numeric',+ month: 'long',+ });++ return (+ <MSheet open onClose={onClose} variant="bottom" material="glass" ariaLabel={ariaLabel}>+ <div className="flex max-h-[90dvh] min-h-0 flex-col">+ <FormSheetHeader+ leading={+ <span className="flex h-10 w-10 flex-none overflow-hidden rounded-[13px]">+ <DawarichIcon size={40} />+ </span>+ }+ title={title}+ subtitle={journeyTitle}+ onClose={onClose}+ closeLabel={t('common.close')}+ />+ <div className="flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto px-[18px] pb-4 pt-2">+ <p className="m-0 font-geist text-caption text-m-muted">{sub}</p>+ {children}+ </div>+ <div className="flex flex-none flex-wrap items-center gap-2 border-t border-edge-faint px-[18px] py-3">+ {footer}+ </div>+ </div>+ </MSheet>+ );+}diff --git a/client/src/mobile/screens/journey/MJourneyDayImportSheet.tsx b/client/src/mobile/screens/journey/MJourneyDayImportSheet.tsxnew file mode 100644index 000000000..01d19f7ad--- /dev/null+++ b/client/src/mobile/screens/journey/MJourneyDayImportSheet.tsx@@ -0,0 +1,33 @@+import { JourneyDayImportActions, JourneyDayImportReview } from '../../../components/Journey/JourneyDayImportReview';+import { useJourneyDayImport, type JourneyDayImportViewProps } from '../../../components/Journey/useJourneyDayImport';+import { useTranslation } from '../../../i18n';+import MDawarichDaySheet from './MDawarichDaySheet';++/**+ * Taking a recorded day with its stays into the journal (JRN-02), on the+ * phone: the same review and the same buttons as the desktop dialog, in a+ * bottom sheet, for the day of the card the journey is showing.+ */+export default function MJourneyDayImportSheet({+ journeyTitle,+ date,+ dayColor,+ onClose,+ ...rest+}: JourneyDayImportViewProps) {+ const { t } = useTranslation();+ const state = useJourneyDayImport({ date, dayColor, onClose, ...rest });++ return (+ <MDawarichDaySheet+ journeyTitle={state.review?.journey.title ?? journeyTitle}+ date={date}+ sub={t('journey.dayImport.sub')}+ ariaLabel={t('journey.dayImport.open')}+ onClose={onClose}+ footer={<JourneyDayImportActions state={state} onCancel={onClose} />}+ >+ <JourneyDayImportReview state={state} dayColor={dayColor} />+ </MDawarichDaySheet>+ );+}diff --git a/client/src/mobile/screens/journey/MJourneyDetail.tsx b/client/src/mobile/screens/journey/MJourneyDetail.tsxindex 2f0849518..a09e637ef 100644--- a/client/src/mobile/screens/journey/MJourneyDetail.tsx+++ b/client/src/mobile/screens/journey/MJourneyDetail.tsx@@ -1,6 +1,6 @@import { useCallback, useEffect, useMemo, useRef, useState } from 'react'import { useSearchParams } from 'react-router'-import { ChevronLeft, MapPin, Grid3x3, MoreHorizontal, Play, Image, Camera, EyeOff, Settings2, X, Route } from 'lucide-react'+import { ChevronLeft, MapPin, Grid3x3, MoreHorizontal, Play, Image, Camera, EyeOff, Settings2, X, Route, ListChecks } from 'lucide-react'import JourneyMap from '../../../components/Journey/JourneyMapAuto'import PhotoLightbox from '../../../components/Journey/PhotoLightbox'import ContributorInviteDialog from '../../../components/Journey/ContributorInviteDialog'@@ -27,6 +27,7 @@ import { useJourneyCarouselSync } from '../../../components/Journey/useJourneyCaimport { useGalleryUpload } from '../../../components/Journey/useGalleryUpload'import MJourneyEntrySheet from './MJourneyEntrySheet'import MJourneySettingsSheet from './MJourneySettingsSheet'+import MJourneyDayImportSheet from './MJourneyDayImportSheet'import MJourneyRecordingSheet from './MJourneyRecordingSheet'/**@@ -49,7 +50,7 @@ export default function MJourneyDetail({ journeyId, embedded = false }: JourneyDshowInvite, setShowInvite,showSettings, setShowSettings,hideSkeletons, setHideSkeletons,- sidebarMapItems, tracks, recordings, canTakeOverRecording,+ sidebarMapItems, tracks, recordings, canTakeOverRecording, dayImport, dawarichByDate,dismissSuggestion, restoreSuggestions, openAtEntryId,loadJourney, updateEntry, deleteEntry, reorderEntries, uploadPhotos,addPickedProviderPhotos, addEntryProviderPhotos,@@ -520,6 +521,21 @@ export default function MJourneyDetail({ journeyId, embedded = false }: JourneyDonClick={() => { setShowActionMenu(false); recordings.open(entries[activeIndex].entry_date) }}/>)}+ {/* The same day with its stays (JRN-02), counting the ones still waiting. */}+ {canEditEntries && canTakeOverRecording && view === 'timeline' && entries[activeIndex] && (+ <MListRow+ icon={ListChecks}+ label={t('journey.dayImport.openOn', {+ date: new Date(entries[activeIndex].entry_date + 'T00:00:00').toLocaleDateString(locale, { day: 'numeric', month: 'long' }),+ })}+ trailing={dawarichByDate.get(entries[activeIndex].entry_date)?.length ? (+ <span className="rounded-full bg-m-ic px-2 py-0.5 font-geist text-caption font-bold tabular-nums text-m-muted">+ {dawarichByDate.get(entries[activeIndex].entry_date)?.length}+ </span>+ ) : undefined}+ onClick={() => { setShowActionMenu(false); dayImport.open(entries[activeIndex].entry_date) }}+ />+ )}{canEditJourney && (<MListRowicon={Settings2}@@ -584,6 +600,7 @@ export default function MJourneyDetail({ journeyId, embedded = false }: JourneyD)}{recordings.dialog && <MJourneyRecordingSheet {...recordings.dialog} />}+ {dayImport.dialog && <MJourneyDayImportSheet {...dayImport.dialog} />}{/* Journey settings */}{showSettings && (diff --git a/client/src/mobile/screens/journey/MJourneyRecordingSheet.tsx b/client/src/mobile/screens/journey/MJourneyRecordingSheet.tsxindex 938dab439..e48d347f8 100644--- a/client/src/mobile/screens/journey/MJourneyRecordingSheet.tsx+++ b/client/src/mobile/screens/journey/MJourneyRecordingSheet.tsx@@ -3,10 +3,8 @@ import {useJourneyRecordingDay,type JourneyRecordingViewProps,} from '../../../components/Journey/useJourneyRecordingDay';-import DawarichIcon from '../../../components/shared/DawarichIcon';import { useTranslation } from '../../../i18n';-import MSheet from '../../components/MSheet';-import { FormSheetHeader } from '../trip/sheets/PlSheetChrome';+import MDawarichDaySheet from './MDawarichDaySheet';/*** Taking one day's recorded route from Dawarich into the journey (JRN-01), on@@ -20,36 +18,19 @@ export default function MJourneyRecordingSheet({onClose,...rest}: JourneyRecordingViewProps) {- const { t, locale } = useTranslation();+ const { t } = useTranslation();const day = useJourneyRecordingDay({ date, onClose, ...rest });- const title = new Date(`${date}T00:00:00`).toLocaleDateString(locale, {- weekday: 'long',- day: 'numeric',- month: 'long',- });return (- <MSheet open onClose={onClose} variant="bottom" material="glass" ariaLabel={t('journey.recording.takeOver')}>- <div className="flex max-h-[86dvh] min-h-0 flex-col">- <FormSheetHeader- leading={- <span className="flex h-10 w-10 flex-none overflow-hidden rounded-[13px]">- <DawarichIcon size={40} />- </span>- }- title={title}- subtitle={day.preview?.journey.title ?? journeyTitle}- onClose={onClose}- closeLabel={t('common.close')}- />- <div className="flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto px-[18px] pb-4 pt-2">- <p className="m-0 font-geist text-caption text-m-muted">{t('journey.recording.sub')}</p>- <JourneyRecordingReview day={day} stored={stored} />- </div>- <div className="flex flex-none items-center gap-2 border-t border-edge-faint px-[18px] py-3">- <JourneyRecordingActions day={day} stored={stored} onCancel={onClose} />- </div>- </div>- </MSheet>+ <MDawarichDaySheet+ journeyTitle={day.preview?.journey.title ?? journeyTitle}+ date={date}+ sub={t('journey.recording.sub')}+ ariaLabel={t('journey.recording.takeOver')}+ onClose={onClose}+ footer={<JourneyRecordingActions day={day} stored={stored} onCancel={onClose} />}+ >+ <JourneyRecordingReview day={day} stored={stored} />+ </MDawarichDaySheet>);}diff --git a/client/src/pages/JourneyDetailPage.tsx b/client/src/pages/JourneyDetailPage.tsxindex 78bb838a9..69ca4c040 100644--- a/client/src/pages/JourneyDetailPage.tsx+++ b/client/src/pages/JourneyDetailPage.tsx@@ -15,6 +15,8 @@ import {} from 'lucide-react'import MobileMapTimeline from '../components/Journey/MobileMapTimeline'import JourneyDayDawarich from '../components/Journey/JourneyDayDawarich'+import JourneyDayImportButton from '../components/Journey/JourneyDayImportButton'+import JourneyDayImportDialog from '../components/Journey/JourneyDayImportDialog'import JourneyDayRecordingButton from '../components/Journey/JourneyDayRecordingButton'import JourneyRecordingDialog from '../components/Journey/JourneyRecordingDialog'import MobileEntryView from '../components/Journey/MobileEntryView'@@ -66,7 +68,7 @@ export function JourneyDetailPageDesktop({ journeyId, embedded = false }: JournegalleryUploadProgress, setGalleryUploadProgress,activeLocationId, handleMarkerClick, handleLocationClick,mapEntries, sidebarMapItems, tripDates, isMobile, tracks, mapPhotos, openMapPhotos,- recordings, canTakeOverRecording, recordingNeedsConnection,+ recordings, canTakeOverRecording, recordingNeedsConnection, dayImport,feedEdge, scrollFeedTo,loadJourney, updateEntry, deleteEntry, reorderEntries, uploadPhotos, deletePhoto,addPickedProviderPhotos, addEntryProviderPhotos,@@ -509,6 +511,12 @@ export function JourneyDetailPageDesktop({ journeyId, embedded = false }: JourneneedsConnection={recordingNeedsConnection}onOpen={() => recordings.open(date)}/>+ <JourneyDayImportButton+ pending={stays.length}+ canTakeOver={canTakeOverRecording}+ needsConnection={recordingNeedsConnection}+ onOpen={() => dayImport.open(date)}+ />{/* The only Add button used to be at the very top and alwaysstarted on today, so putting something into an earlier daymeant correcting the date by hand (discussion #2299). */}@@ -619,6 +627,7 @@ export function JourneyDetailPageDesktop({ journeyId, embedded = false }: JournebusyId={dawarichBusyId}onAccept={acceptDawarich}onDismiss={dismissDawarich}+ onTakeOverDay={canTakeOverRecording ? () => dayImport.open(date) : undefined}/></div>)@@ -779,6 +788,7 @@ export function JourneyDetailPageDesktop({ journeyId, embedded = false }: Journe)}{recordings.dialog && <JourneyRecordingDialog {...recordings.dialog} />}+ {dayImport.dialog && <JourneyDayImportDialog {...dayImport.dialog} />}{/* Add Trip Dialog */}{showAddTrip && current && (diff --git a/client/src/pages/JourneyDetailPage.wiring.test.tsx b/client/src/pages/JourneyDetailPage.wiring.test.tsxindex 3c5f435eb..e0fca1a00 100644--- a/client/src/pages/JourneyDetailPage.wiring.test.tsx+++ b/client/src/pages/JourneyDetailPage.wiring.test.tsx@@ -1,4 +1,4 @@-// FE-JRN-DETWIRE-001 to FE-JRN-DETWIRE-043+// FE-JRN-DETWIRE-001 to FE-JRN-DETWIRE-044import { describe, it, expect, beforeEach, vi } from 'vitest';import { render, screen, fireEvent, waitFor, within } from '../../tests/helpers/render';import { journeyApi } from '../api/client';@@ -49,6 +49,7 @@ vi.mock('../components/Journey/JourneyDetailPageGalleryView', () => ({ GalleryVivi.mock('../components/Journey/JourneyDetailPageEntryEditor', () => ({ EntryEditor: capture('editor', 'entry-editor') }));vi.mock('../components/Journey/JourneyDetailPageAddTripDialog', () => ({ AddTripDialog: capture('addTrip', 'add-trip-dialog') }));vi.mock('../components/Journey/JourneyDetailPageSettingsDialog', () => ({ JourneySettingsDialog: capture('settings', 'settings-dialog') }));+vi.mock('../components/Journey/JourneyDayImportDialog', () => ({ default: capture('dayImport', 'day-import-dialog') }));vi.mock('../components/Journey/JourneyDetailPageEntryCard', () => ({EntryCard: capture('entryCard', 'entry-card'),SkeletonCard: capture('skeletonCard', 'skeleton-card'),@@ -104,6 +105,11 @@ function buildHook(over: Record<string, unknown> = {}): Record<string, unknown>// carries has its own suite (FE-JRN-DAYDAW), and what this file pins is the wiring.dawarichByDate: new Map(), dawarichBusyId: null,acceptDawarich: vi.fn(async () => {}), dismissDawarich: vi.fn(),+ // The recorded days a journey keeps (JRN-01) and the day take-over (JRN-02): none here,+ // their dialogs have suites of their own.+ recordings: { byDate: new Map(), dialog: null, open: vi.fn() },+ canTakeOverRecording: false, recordingNeedsConnection: false,+ dayImport: { open: vi.fn(), dialog: null },mapRef: { current: null }, fullMapRef: { current: null }, galleryUploadRef: { current: null },galleryProviders: [], setGalleryProviders: vi.fn(), galleryBrowseRef: { current: null },galleryUploadProgress: null, setGalleryUploadProgress: vi.fn(),@@ -610,4 +616,19 @@ describe('JourneyDetailPage wiring', () => {expect(button).toBeDisabled();expect(screen.queryByText('common.upload')).not.toBeInTheDocument();});++ it('FE-JRN-DETWIRE-044: a day takes over with its stays from its header, and the open day shows its dialog (JRN-02)', () => {+ const open = vi.fn();+ setup({ canTakeOverRecording: true, dayImport: { open, dialog: null } });++ const [firstDay] = screen.getAllByTestId('journey-day-import');+ fireEvent.click(firstDay as HTMLElement);+ expect(open).toHaveBeenCalledWith('2026-05-01');+ expect(screen.queryByTestId('day-import-dialog')).not.toBeInTheDocument();++ const dialog = { journeyId: 7, date: '2026-05-01', dayColor: '#123456' };+ setup({ canTakeOverRecording: true, dayImport: { open, dialog } });+ expect(screen.getByTestId('day-import-dialog')).toBeInTheDocument();+ expect(mocks.captured.dayImport).toMatchObject(dialog);+ });});diff --git a/client/src/pages/journeyDetail/useJourneyDetail.ts b/client/src/pages/journeyDetail/useJourneyDetail.tsindex 428844fba..e92c8a6e3 100644--- a/client/src/pages/journeyDetail/useJourneyDetail.ts+++ b/client/src/pages/journeyDetail/useJourneyDetail.ts@@ -17,6 +17,7 @@ import { openStaysByDate } from '../../components/Dawarich/dawarichSuggestionModimport type { DawarichSuggestion, DawarichSuggestionTarget } from '@trek/shared'import { useDawarichJournalTrail } from '../../hooks/useDawarichJournalTrail'+import { useJourneyDetailDayImport } from './useJourneyDetailDayImport'import { useJourneyDetailRecordings } from './useJourneyDetailRecordings'import { useProviderPhotoAdds } from './useProviderPhotoAdds'@@ -532,7 +533,7 @@ export function useJourneyDetail({ journeyId, embedded = false }: JourneyDetailO// asked for should not reach across the network for it.const dawarichTrail = useDawarichJournalTrail(tripDates, showTripTracks)- const { recordings, canTakeOverRecording, recordingNeedsConnection, mapTracks } = useJourneyDetailRecordings({+ const { recordings, colorOfDay, canTakeOverRecording, recordingNeedsConnection, mapTracks } = useJourneyDetailRecordings({loaded: journeyLoaded,journey: current,canEdit: canEditEntries,@@ -542,6 +543,21 @@ export function useJourneyDetail({ journeyId, embedded = false }: JourneyDetailOliveTracks: dawarichTrail.tracks,})+ // The drafts a day's take-over wrote reach the timeline, and its stays leave the pending list.+ const afterDayTakeOver = useCallback(() => {+ if (current) void loadJourney(current.id)+ dawarich.reload()+ }, [current, loadJourney, dawarich])+ const recordedDayOf = useCallback((date: string) => recordings.byDate.get(date), [recordings.byDate])+ const dayImport = useJourneyDetailDayImport({+ loaded: journeyLoaded,+ journey: current,+ colorOfDay,+ recordedDayOf,+ onKept: recordings.kept,+ onTakenOver: afterDayTakeOver,+ })+/** Studio's margin to the window on all four sides — see `.st-root` in studio.css. */const STUDIO_INSET = 16@@ -588,7 +604,7 @@ export function useJourneyDetail({ journeyId, embedded = false }: JourneyDetailOgalleryUploadProgress, setGalleryUploadProgress,activeLocationId, handleMarkerClick, handleLocationClick,mapEntries, sidebarMapItems, tripDates, isMobile, tracks: mapTracks, dawarichTrail,- recordings, canTakeOverRecording, recordingNeedsConnection,+ recordings, canTakeOverRecording, recordingNeedsConnection, dayImport,mapPhotos, openMapPhotos,feedEdge, scrollFeedTo,loadJourney, updateEntry, deleteEntry, reorderEntries, uploadPhotos, deletePhoto,diff --git a/client/src/pages/journeyDetail/useJourneyDetailDayImport.test.ts b/client/src/pages/journeyDetail/useJourneyDetailDayImport.test.tsnew file mode 100644index 000000000..793ba3096--- /dev/null+++ b/client/src/pages/journeyDetail/useJourneyDetailDayImport.test.ts@@ -0,0 +1,65 @@+// FE-JRN-DETAIL-DAYIMPORT-001 to FE-JRN-DETAIL-DAYIMPORT-002+//+// JRN-02: which day of the journey is taken over with its stays, as the journey+// page and the phone screen wire it.+import { describe, expect, it, vi } from 'vitest';+import { buildRecordedDay } from '../../../tests/helpers/journeyRecording';+import { act, renderHook } from '../../../tests/helpers/render';+import { DAWARICH_TRAIL_COLOR } from '../../components/Map/dawarichTrail';+import { useJourneyDetailDayImport } from './useJourneyDetailDayImport';++function setup(journey: { id: number; title: string } | null = { id: 7, title: 'Venice' }) {+ const kept = buildRecordedDay();+ const args = {+ colorOf: (date: string) => (date === '2026-05-14' ? '#ff0055' : null),+ recordedDayOf: (date: string) => (date === '2026-05-14' ? kept : undefined),+ onKept: vi.fn(),+ onTakenOver: vi.fn(),+ };+ const view = renderHook(+ ({ j }) =>+ useJourneyDetailDayImport({+ loaded: true,+ journey: j,+ colorOfDay: args.colorOf,+ recordedDayOf: args.recordedDayOf,+ onKept: args.onKept,+ onTakenOver: args.onTakenOver,+ }),+ { initialProps: { j: journey } }+ );+ return { ...view, kept, args };+}++describe('useJourneyDetailDayImport', () => {+ it('FE-JRN-DETAIL-DAYIMPORT-001: opens a day in the colour of its pins with the route it keeps, and closes again', () => {+ const { result, kept, args } = setup();+ expect(result.current.dialog).toBeNull();++ act(() => result.current.open('2026-05-14'));+ expect(result.current.dialog).toMatchObject({+ journeyId: 7,+ journeyTitle: 'Venice',+ date: '2026-05-14',+ dayColor: '#ff0055',+ storedRoute: kept,+ onTakenOver: args.onTakenOver,+ onKept: args.onKept,+ });++ act(() => result.current.open('2026-05-15'));+ expect(result.current.dialog).toMatchObject({ dayColor: DAWARICH_TRAIL_COLOR, storedRoute: undefined });++ act(() => result.current.dialog?.onClose());+ expect(result.current.openDate).toBeNull();+ });++ it('FE-JRN-DETAIL-DAYIMPORT-002: a day opened on one journey does not open on the next', () => {+ const { result, rerender } = setup();+ act(() => result.current.open('2026-05-14'));+ rerender({ j: { id: 8, title: 'Lisbon' } });+ expect(result.current.dialog).toBeNull();+ rerender({ j: null });+ expect(result.current.dialog).toBeNull();+ });+});diff --git a/client/src/pages/journeyDetail/useJourneyDetailDayImport.ts b/client/src/pages/journeyDetail/useJourneyDetailDayImport.tsnew file mode 100644index 000000000..a22939701--- /dev/null+++ b/client/src/pages/journeyDetail/useJourneyDetailDayImport.ts@@ -0,0 +1,56 @@+import type { JourneyRecordedDay } from '@trek/shared';+import { useCallback, useMemo, useState } from 'react';+import type { JourneyDayImportViewProps } from '../../components/Journey/useJourneyDayImport';+import { DAWARICH_TRAIL_COLOR } from '../../components/Map/dawarichTrail';++/**+ * Which day of the journey is being taken over with its stays (JRN-02), as+ * the journey page and the phone screen wire it: the day opens the dialog in+ * the colour of its pins, with the route the journey keeps for it, and a+ * take-over reads the journey and the stay list again.+ */+export function useJourneyDetailDayImport({+ loaded,+ journey,+ colorOfDay,+ recordedDayOf,+ onKept,+ onTakenOver,+}: {+ /** Whether `journey` is the one the route names yet: the store keeps the last one while the next loads. */+ loaded: boolean;+ journey: { id: number; title: string } | null | undefined;+ colorOfDay: (date: string) => string | null;+ recordedDayOf: (date: string) => JourneyRecordedDay | undefined;+ onKept: (day: JourneyRecordedDay) => void;+ onTakenOver: () => void;+}) {+ const journeyId = loaded && journey ? journey.id : null;+ const journeyTitle = journey?.title ?? '';+ const [opened, setOpened] = useState<{ journeyId: number | null; date: string | null }>(NOTHING_OPEN);+ const openDate = opened.journeyId === journeyId ? opened.date : null;++ const open = useCallback((date: string) => setOpened({ journeyId, date }), [journeyId]);+ const close = useCallback(() => setOpened(NOTHING_OPEN), []);++ const dialog = useMemo<JourneyDayImportViewProps | null>(+ () =>+ journeyId !== null && openDate+ ? {+ journeyId,+ journeyTitle,+ date: openDate,+ dayColor: colorOfDay(openDate) ?? DAWARICH_TRAIL_COLOR,+ storedRoute: recordedDayOf(openDate),+ onTakenOver,+ onKept,+ onClose: close,+ }+ : null,+ [journeyId, journeyTitle, openDate, colorOfDay, recordedDayOf, onTakenOver, onKept, close]+ );++ return { openDate, open, close, dialog };+}++const NOTHING_OPEN = { journeyId: null, date: null };diff --git a/client/src/pages/journeyDetail/useJourneyDetailRecordings.ts b/client/src/pages/journeyDetail/useJourneyDetailRecordings.tsindex 78b54f66f..c2b19afda 100644--- a/client/src/pages/journeyDetail/useJourneyDetailRecordings.ts+++ b/client/src/pages/journeyDetail/useJourneyDetailRecordings.ts@@ -48,6 +48,7 @@ export function useJourneyDetailRecordings({return {recordings,+ colorOfDay,canTakeOverRecording: canEdit && dawarichStatus === 'ready',recordingNeedsConnection: canEdit && dawarichStatus === 'offline',mapTracks,diff --git a/client/src/repo/journeyRecordingsRepo.test.ts b/client/src/repo/journeyRecordingsRepo.test.tsindex edfad5c7e..a21f96271 100644--- a/client/src/repo/journeyRecordingsRepo.test.ts+++ b/client/src/repo/journeyRecordingsRepo.test.ts@@ -1,10 +1,10 @@import { beforeEach, describe, expect, it, vi } from 'vitest';-import { buildRecordedDay, buildRecordingPreview } from '../../tests/helpers/journeyRecording';+import { buildDayStays, buildRecordedDay, buildRecordingPreview } from '../../tests/helpers/journeyRecording';import { journeyRecordingsApi } from '../api/journeyRecordings';import { journeyRecordingsRepo } from './journeyRecordingsRepo';import { OnlineOnlyError } from './onlineOnly';-// FE-REPO-JOURNEY-RECORDINGS-001 to FE-REPO-JOURNEY-RECORDINGS-003+// FE-REPO-JOURNEY-RECORDINGS-001 to FE-REPO-JOURNEY-RECORDINGS-004const network = vi.hoisted(() => ({ offline: false }));vi.mock('../sync/networkMode', () => ({ isEffectivelyOffline: () => network.offline }));@@ -54,4 +54,21 @@ describe('journeyRecordingsRepo', () => {vi.spyOn(journeyRecordingsApi, 'list').mockResolvedValue({ days: [{ date: '2026-05-14' }] } as never);await expect(journeyRecordingsRepo.list(7)).rejects.toThrow();});++ it('FE-REPO-JOURNEY-RECORDINGS-004: reviews and takes over a day online only, parsing both answers (JRN-02)', async () => {+ const review = buildDayStays();+ vi.spyOn(journeyRecordingsApi, 'reviewDay').mockResolvedValue(review);+ const takeOver = vi+ .spyOn(journeyRecordingsApi, 'takeOverDay')+ .mockResolvedValue({ entries: [{ id: 5, title: 'San Marco', stayCount: 2 }], alreadyTaken: [], skipped: [10] });+ const body = { groups: [{ kind: 'single' as const, stays: [{ suggestionId: 13 }] }] };++ expect(await journeyRecordingsRepo.reviewDay(7, '2026-05-14')).toEqual(review);+ expect((await journeyRecordingsRepo.takeOverDay(7, '2026-05-14', body)).entries).toHaveLength(1);+ expect(takeOver).toHaveBeenCalledWith(7, '2026-05-14', body);++ network.offline = true;+ await expect(journeyRecordingsRepo.reviewDay(7, '2026-05-14')).rejects.toBeInstanceOf(OnlineOnlyError);+ await expect(journeyRecordingsRepo.takeOverDay(7, '2026-05-14', body)).rejects.toBeInstanceOf(OnlineOnlyError);+ });});diff --git a/client/src/repo/journeyRecordingsRepo.ts b/client/src/repo/journeyRecordingsRepo.tsindex dea455035..0e37a600b 100644--- a/client/src/repo/journeyRecordingsRepo.ts+++ b/client/src/repo/journeyRecordingsRepo.ts@@ -1,7 +1,12 @@import {+ journeyDayImportResultSchema,+ journeyDayStaysSchema,journeyRecordedDaysResponseSchema,journeyRecordingPreviewSchema,journeyRecordingSaveResultSchema,+ type JourneyDayImportRequest,+ type JourneyDayImportResult,+ type JourneyDayStays,type JourneyRecordedDay,type JourneyRecordingPreview,type JourneyRecordingPreviewRequest,@@ -41,4 +46,15 @@ export const journeyRecordingsRepo = {requireOnline();await journeyRecordingsApi.remove(journeyId, date);},++ /** JRN-02: the caller's stays of a day as the journey would take them over, read from Dawarich first. */+ async reviewDay(journeyId: number, date: string, signal?: AbortSignal): Promise<JourneyDayStays> {+ requireOnline();+ return journeyDayStaysSchema.parse(await journeyRecordingsApi.reviewDay(journeyId, date, signal));+ },++ async takeOverDay(journeyId: number, date: string, body: JourneyDayImportRequest): Promise<JourneyDayImportResult> {+ requireOnline();+ return journeyDayImportResultSchema.parse(await journeyRecordingsApi.takeOverDay(journeyId, date, body));+ },};diff --git a/client/tests/helpers/journeyRecording.ts b/client/tests/helpers/journeyRecording.tsindex 655ce9cfb..6163ee1c1 100644--- a/client/tests/helpers/journeyRecording.ts+++ b/client/tests/helpers/journeyRecording.ts@@ -1,4 +1,4 @@-import type { JourneyRecordedDay, JourneyRecordingPreview } from '@trek/shared';+import type { JourneyDayStay, JourneyDayStays, JourneyRecordedDay, JourneyRecordingPreview } from '@trek/shared';/** A walk across Venice on the 14th, the way the server answers it. */export const WALK_SEGMENT = {@@ -62,3 +62,65 @@ export function buildRecordingPreview(over: Partial<JourneyRecordingPreview> = {...over,};}++/** A stay of the 14th as the day review lists it, open unless a case says otherwise. */+export function buildDayStay(over: Partial<JourneyDayStay> = {}): JourneyDayStay {+ return {+ suggestionId: 11,+ name: 'Piazza San Marco',+ lat: 45.434,+ lng: 12.3388,+ startedAt: '2026-05-14T09:10:00+02:00',+ endedAt: '2026-05-14T10:05:00+02:00',+ durationMinutes: 55,+ sourceStatus: 'confirmed',+ confidenceBand: 'high',+ status: 'open',+ entry: null,+ ...over,+ };+}++/** The review of the 14th: two stays at San Marco, a parking stop and Rialto. */+export function buildDayStays(over: Partial<JourneyDayStays> = {}): JourneyDayStays {+ return {+ journey: { id: 7, title: 'Venice' },+ date: '2026-05-14',+ stays: [+ buildDayStay({+ suggestionId: 10,+ name: 'Parcheggio',+ startedAt: '2026-05-14T08:30:00+02:00',+ endedAt: '2026-05-14T08:40:00+02:00',+ durationMinutes: 10,+ sourceStatus: 'suggested',+ confidenceBand: 'low',+ }),+ buildDayStay(),+ buildDayStay({+ suggestionId: 12,+ startedAt: '2026-05-14T10:20:00+02:00',+ endedAt: '2026-05-14T11:40:00+02:00',+ durationMinutes: 80,+ lat: 45.4341,+ lng: 12.3391,+ }),+ buildDayStay({+ suggestionId: 13,+ name: 'Rialto',+ startedAt: '2026-05-14T13:00:00+02:00',+ endedAt: '2026-05-14T13:30:00+02:00',+ durationMinutes: 30,+ lat: 45.438,+ lng: 12.3359,+ }),+ ],+ entries: [],+ fresh: true,+ error: null,+ syncedAt: null,+ truncated: false,+ audience: 0,+ ...over,+ };+}diff --git a/client/tests/unit/mobile/journey/MJourneyDayImportSheet.test.tsx b/client/tests/unit/mobile/journey/MJourneyDayImportSheet.test.tsxnew file mode 100644index 000000000..f60afd349--- /dev/null+++ b/client/tests/unit/mobile/journey/MJourneyDayImportSheet.test.tsx@@ -0,0 +1,85 @@+// FE-MJRN-DAYIMPORT-001 to FE-MJRN-DAYIMPORT-002+//+// JRN-02 on the phone: the same review and buttons as the desktop dialog, in a+// bottom sheet for the day of the card the journey shows. The frame is the one+// the route sheet (JRN-01) uses too.+import userEvent from '@testing-library/user-event';+import { beforeEach, describe, expect, it, vi } from 'vitest';+import MJourneyDayImportSheet from '../../../../src/mobile/screens/journey/MJourneyDayImportSheet';+import MJourneyRecordingSheet from '../../../../src/mobile/screens/journey/MJourneyRecordingSheet';+import { buildDayStays, buildRecordingPreview } from '../../../helpers/journeyRecording';+import { render, screen, waitFor } from '../../../helpers/render';++const repo = vi.hoisted(() => ({+ reviewDay: vi.fn(),+ takeOverDay: vi.fn(),+ preview: vi.fn(),+ save: vi.fn(),+ remove: vi.fn(),+}));+vi.mock('../../../../src/repo/journeyRecordingsRepo', () => ({ journeyRecordingsRepo: repo }));++const toast = { success: vi.fn(), error: vi.fn(), warning: vi.fn(), info: vi.fn() };+vi.mock('../../../../src/components/shared/Toast', () => ({ useToast: () => toast }));++vi.mock('../../../../src/components/Journey/JourneyMapAuto', () => ({+ default: () => <div data-testid="day-map" />,+}));++beforeEach(() => {+ for (const fn of Object.values(repo)) fn.mockReset();+ repo.reviewDay.mockResolvedValue(buildDayStays());+ repo.preview.mockResolvedValue(buildRecordingPreview());+ repo.takeOverDay.mockResolvedValue({+ entries: [{ id: 5, title: 'Rialto', stayCount: 1 }],+ alreadyTaken: [],+ skipped: [],+ });+});++describe('MJourneyDayImportSheet', () => {+ it('FE-MJRN-DAYIMPORT-001: names the day and the journey, lists the stays and takes them over on its button', async () => {+ const user = userEvent.setup();+ const onClose = vi.fn();+ const onTakenOver = vi.fn();+ render(+ <MJourneyDayImportSheet+ journeyId={7}+ journeyTitle="Venice"+ date="2026-05-14"+ dayColor="#ff0055"+ storedRoute={undefined}+ onTakenOver={onTakenOver}+ onKept={vi.fn()}+ onClose={onClose}+ />+ );++ expect(await screen.findByRole('checkbox', { name: 'Take over Rialto' })).toBeChecked();+ expect(screen.getByText('Venice')).toBeInTheDocument();+ expect(screen.getByText(/Thursday, May 14/)).toBeInTheDocument();+ await user.click(screen.getByRole('button', { name: 'Take over 3 drafts' }));++ await waitFor(() => expect(onClose).toHaveBeenCalled());+ expect(onTakenOver).toHaveBeenCalled();+ });++ it('FE-MJRN-DAYIMPORT-002: the route sheet keeps its own words in the same frame', async () => {+ render(+ <MJourneyRecordingSheet+ journeyId={7}+ journeyTitle="Venice"+ date="2026-05-14"+ stored={undefined}+ onKept={vi.fn()}+ onRemoved={vi.fn()}+ onClose={vi.fn()}+ />+ );++ expect(await screen.findByRole('button', { name: 'Keep route' })).toBeInTheDocument();+ expect(+ screen.getByText('Only this day, from your Dawarich. Nothing is kept until you confirm.')+ ).toBeInTheDocument();+ });+});diff --git a/client/tests/unit/mobile/journey/MJourneyDetail.test.tsx b/client/tests/unit/mobile/journey/MJourneyDetail.test.tsxindex f708f9e45..88fcefec2 100644--- a/client/tests/unit/mobile/journey/MJourneyDetail.test.tsx+++ b/client/tests/unit/mobile/journey/MJourneyDetail.test.tsx@@ -172,6 +172,11 @@ function buildHook(over: Record<string, unknown> = {}): Record<string, unknown>hideSkeletons: false,setHideSkeletons: vi.fn(),sidebarMapItems: (current?.entries ?? []).map(e => ({ id: String(e.id), lat: 1, lng: 2, title: e.title ?? '' })),+ // The recorded days (JRN-01) and the day take-over (JRN-02): closed, their sheets have suites of their own.+ recordings: { byDate: new Map(), dialog: null, open: vi.fn() },+ canTakeOverRecording: false,+ dayImport: { open: vi.fn(), dialog: null },+ dawarichByDate: new Map(),loadJourney: vi.fn(),updateEntry: vi.fn(async () => {}),deleteEntry: vi.fn(async () => {}),diff --git a/server/scripts/repository-owners.json b/server/scripts/repository-owners.jsonindex 0546dd35d..8b7fe3c11 100644--- a/server/scripts/repository-owners.json+++ b/server/scripts/repository-owners.json@@ -44,6 +44,7 @@"JourneyContributors": "journey","JourneyEntries": "journey","JourneyEntryPhotos": "journey",+ "JourneyEntryStays": "journey","JourneyPhotos": "journey","JourneyRecordedDays": "journey","JourneyShareTokens": "journey",diff --git a/server/scripts/tx-writes-baseline.json b/server/scripts/tx-writes-baseline.jsonindex f29104732..21cffd0da 100644--- a/server/scripts/tx-writes-baseline.json+++ b/server/scripts/tx-writes-baseline.json@@ -30,7 +30,7 @@"src/nest/integrations/airtrail-sync.service.ts#AirtrailSyncService.syncOwner": 8,"src/nest/integrations/airtrail.service.ts#AirtrailService.saveSettings": 2,"src/nest/integrations/dawarich-sync.service.ts#DawarichSyncService.runSync": 2,- "src/nest/integrations/dawarich-sync.service.ts#DawarichSyncService.syncTripWindow": 11,+ "src/nest/integrations/dawarich-sync.service.ts#DawarichSyncService.syncTripWindow": 3,"src/nest/integrations/dawarich-sync.service.ts#DawarichSyncService.syncUserOnce": 4,"src/nest/journey/journey.controller.ts#JourneyController.galleryProviderPhotos": 2,"src/nest/journey/journey.controller.ts#JourneyController.providerPhotos": 2,diff --git a/server/src/db/entities/JourneyEntries.entity.ts b/server/src/db/entities/JourneyEntries.entity.tsindex 0240f66df..5f5eca55f 100644--- a/server/src/db/entities/JourneyEntries.entity.ts+++ b/server/src/db/entities/JourneyEntries.entity.ts@@ -1,6 +1,7 @@import { Collection, EntityRepositoryType, type Opt, type Ref, defineEntity, p } from '@mikro-orm/core';import { JourneyEntriesRepository } from '../repositories/JourneyEntries.repository';import { JourneyEntryPhotos } from './JourneyEntryPhotos.entity';+import { JourneyEntryStays } from './JourneyEntryStays.entity';import { Journeys } from './Journeys.entity';import { Places } from './Places.entity';import { Trips } from './Trips.entity';@@ -39,6 +40,7 @@ export class JourneyEntries {source_assignment_id?: number | null;is_draft: number & Opt = 0;journey_entry_photos_collection = new Collection<JourneyEntryPhotos>(this);+ journey_entry_stays_collection = new Collection<JourneyEntryStays>(this);}export const JourneyEntriesSchema = defineEntity({@@ -90,5 +92,6 @@ export const JourneyEntriesSchema = defineEntity({source_assignment_id: p.integer().nullable(),is_draft: p.integer().default(0),journey_entry_photos_collection: () => p.oneToMany(JourneyEntryPhotos).mappedBy('entry').hidden(),+ journey_entry_stays_collection: () => p.oneToMany(JourneyEntryStays).mappedBy('entry').hidden(),},});diff --git a/server/src/db/entities/JourneyEntryStays.entity.ts b/server/src/db/entities/JourneyEntryStays.entity.tsnew file mode 100644index 000000000..41351251e--- /dev/null+++ b/server/src/db/entities/JourneyEntryStays.entity.ts@@ -0,0 +1,57 @@+import { EntityRepositoryType, type Opt, type Ref, defineEntity, p } from '@mikro-orm/core';+import { JourneyEntryStaysRepository } from '../repositories/JourneyEntryStays.repository';+import { DbTimestampType } from '../types';+import { JourneyEntries } from './JourneyEntries.entity';+import { Journeys } from './Journeys.entity';+import { Users } from './Users.entity';++export class JourneyEntryStays {+ [EntityRepositoryType]?: JourneyEntryStaysRepository;+ id!: number & Opt;+ journey!: Ref<Journeys>;+ journey_id!: number;+ entry!: Ref<JourneyEntries>;+ entry_id!: number;+ source: string & Opt = 'dawarich';+ source_visit_id!: string;+ name!: string;+ lat?: number | null;+ lng?: number | null;+ started_at!: string;+ ended_at!: string;+ duration_minutes: number & Opt = 0;+ sort_order: number & Opt = 0;+ user?: Ref<Users> | null;+ user_id?: number | null;+ created_at!: string & Opt;+}++export const JourneyEntryStaysSchema = defineEntity({+ class: JourneyEntryStays,+ repository: () => JourneyEntryStaysRepository,+ uniques: [+ {+ name: 'idx_journey_entry_stays_stay',+ properties: ['journey_id', 'source', 'user_id', 'source_visit_id'],+ },+ ],+ properties: {+ id: p.integer().primary(),+ journey: () => p.manyToOne(Journeys).ref().deleteRule('cascade').hidden(),+ journey_id: p.integer().persist(false),+ entry: () => p.manyToOne(JourneyEntries).ref().deleteRule('cascade').hidden().index('idx_journey_entry_stays_entry'),+ entry_id: p.integer().persist(false).index('idx_journey_entry_stays_entry'),+ source: p.text().default('dawarich'),+ source_visit_id: p.text(),+ name: p.text(),+ lat: p.double().nullable(),+ lng: p.double().nullable(),+ started_at: p.text(),+ ended_at: p.text(),+ duration_minutes: p.integer().default(0),+ sort_order: p.integer().default(0),+ user: () => p.manyToOne(Users).ref().nullable().hidden().index('idx_journey_entry_stays_user'),+ user_id: p.integer().nullable().persist(false).index('idx_journey_entry_stays_user'),+ created_at: p.type(DbTimestampType).defaultRaw(`CURRENT_TIMESTAMP`),+ },+});diff --git a/server/src/db/entities/Journeys.entity.ts b/server/src/db/entities/Journeys.entity.tsindex 536a29fc8..8b8d4722a 100644--- a/server/src/db/entities/Journeys.entity.ts+++ b/server/src/db/entities/Journeys.entity.ts@@ -3,6 +3,7 @@ import { JourneysRepository } from '../repositories/Journeys.repository';import { JourneyBooks } from './JourneyBooks.entity';import { JourneyContributors } from './JourneyContributors.entity';import { JourneyEntries } from './JourneyEntries.entity';+import { JourneyEntryStays } from './JourneyEntryStays.entity';import { JourneyPhotos } from './JourneyPhotos.entity';import { JourneyRecordedDays } from './JourneyRecordedDays.entity';import { JourneyShareTokens } from './JourneyShareTokens.entity';@@ -31,6 +32,7 @@ export class Journeys {journey_books_collection = new Collection<JourneyBooks>(this);journey_contributors_collection = new Collection<JourneyContributors>(this);journey_entries_collection = new Collection<JourneyEntries>(this);+ journey_entry_stays_collection = new Collection<JourneyEntryStays>(this);journey_photos_collection = new Collection<JourneyPhotos>(this);journey_recorded_days_collection = new Collection<JourneyRecordedDays>(this);journey_share_tokens: Ref<JourneyShareTokens> | null = null;@@ -61,6 +63,7 @@ export const JourneysSchema = defineEntity({journey_books_collection: () => p.oneToMany(JourneyBooks).mappedBy('journey').hidden(),journey_contributors_collection: () => p.oneToMany(JourneyContributors).mappedBy('journey').hidden(),journey_entries_collection: () => p.oneToMany(JourneyEntries).mappedBy('journey').hidden(),+ journey_entry_stays_collection: () => p.oneToMany(JourneyEntryStays).mappedBy('journey').hidden(),journey_photos_collection: () => p.oneToMany(JourneyPhotos).mappedBy('journey').hidden(),journey_recorded_days_collection: () => p.oneToMany(JourneyRecordedDays).mappedBy('journey').hidden(),journey_share_tokens: () => p.oneToOne(JourneyShareTokens).ref().mappedBy('journey').hidden(),diff --git a/server/src/db/entities/Users.entity.ts b/server/src/db/entities/Users.entity.tsindex 9f8708e53..b5c12a413 100644--- a/server/src/db/entities/Users.entity.ts+++ b/server/src/db/entities/Users.entity.ts@@ -30,6 +30,7 @@ import { InviteTokens } from './InviteTokens.entity';import { JourneyBooks } from './JourneyBooks.entity';import { JourneyContributors } from './JourneyContributors.entity';import { JourneyEntries } from './JourneyEntries.entity';+import { JourneyEntryStays } from './JourneyEntryStays.entity';import { JourneyRecordedDays } from './JourneyRecordedDays.entity';import { JourneyShareTokens } from './JourneyShareTokens.entity';import { Journeys } from './Journeys.entity';@@ -159,6 +160,7 @@ export class Users {journey_books_collection1 = new Collection<JourneyBooks>(this);journey_contributors_collection = new Collection<JourneyContributors>(this);journey_entries_collection = new Collection<JourneyEntries>(this);+ journey_entry_stays_collection = new Collection<JourneyEntryStays>(this);journey_recorded_days_collection = new Collection<JourneyRecordedDays>(this);journey_share_tokens_collection = new Collection<JourneyShareTokens>(this);journeys_collection = new Collection<Journeys>(this);@@ -310,6 +312,7 @@ export const UsersSchema = defineEntity({journey_books_collection1: () => p.oneToMany(JourneyBooks).mappedBy('createdByRef').hidden(),journey_contributors_collection: () => p.oneToMany(JourneyContributors).mappedBy('user').hidden(),journey_entries_collection: () => p.oneToMany(JourneyEntries).mappedBy('author').hidden(),+ journey_entry_stays_collection: () => p.oneToMany(JourneyEntryStays).mappedBy('user').hidden(),journey_recorded_days_collection: () => p.oneToMany(JourneyRecordedDays).mappedBy('importedByRef').hidden(),journey_share_tokens_collection: () => p.oneToMany(JourneyShareTokens).mappedBy('createdByRef').hidden(),journeys_collection: () => p.oneToMany(Journeys).mappedBy('user').hidden(),diff --git a/server/src/db/entities/index.ts b/server/src/db/entities/index.tsindex 618716d0b..0b376b155 100644--- a/server/src/db/entities/index.ts+++ b/server/src/db/entities/index.ts@@ -44,6 +44,7 @@ import { JourneyBooksSchema } from './JourneyBooks.entity';import { JourneyContributorsSchema } from './JourneyContributors.entity';import { JourneyEntriesSchema } from './JourneyEntries.entity';import { JourneyEntryPhotosSchema } from './JourneyEntryPhotos.entity';+import { JourneyEntryStaysSchema } from './JourneyEntryStays.entity';import { JourneyPhotosSchema } from './JourneyPhotos.entity';import { JourneyRecordedDaysSchema } from './JourneyRecordedDays.entity';import { JourneyShareTokensSchema } from './JourneyShareTokens.entity';@@ -196,6 +197,7 @@ export const ALL_ENTITIES: readonly EntitySchema[] = [JourneyContributorsSchema,JourneyEntriesSchema,JourneyEntryPhotosSchema,+ JourneyEntryStaysSchema,JourneyPhotosSchema,JourneyRecordedDaysSchema,JourneyShareTokensSchema,diff --git a/server/src/db/kysely/JourneyEntryStays.table.ts b/server/src/db/kysely/JourneyEntryStays.table.tsnew file mode 100644index 000000000..78568fefb--- /dev/null+++ b/server/src/db/kysely/JourneyEntryStays.table.ts@@ -0,0 +1,20 @@+// Generated by scripts/generate-db-types.ts from the migrated schema. Do not edit by hand:+// change the migration, then run `npm run gen:db-types`.+import type { InsertOptional } from './columns';++export interface JourneyEntryStaysTable {+ id: InsertOptional<number>;+ journey_id: number;+ entry_id: number;+ source: InsertOptional<string>;+ source_visit_id: string;+ name: string;+ lat: InsertOptional<number | null>;+ lng: InsertOptional<number | null>;+ started_at: string;+ ended_at: string;+ duration_minutes: InsertOptional<number>;+ sort_order: InsertOptional<number>;+ user_id: InsertOptional<number | null>;+ created_at: InsertOptional<string>;+}diff --git a/server/src/db/kysely/db.ts b/server/src/db/kysely/db.tsindex 31b6b29ac..a00f11722 100644--- a/server/src/db/kysely/db.ts+++ b/server/src/db/kysely/db.ts@@ -47,6 +47,7 @@ import type { JourneyBooksTable } from './JourneyBooks.table';import type { JourneyContributorsTable } from './JourneyContributors.table';import type { JourneyEntriesTable } from './JourneyEntries.table';import type { JourneyEntryPhotosTable } from './JourneyEntryPhotos.table';+import type { JourneyEntryStaysTable } from './JourneyEntryStays.table';import type { JourneyPhotosTable } from './JourneyPhotos.table';import type { JourneyRecordedDaysTable } from './JourneyRecordedDays.table';import type { JourneyShareTokensTable } from './JourneyShareTokens.table';@@ -205,6 +206,7 @@ export interface DB {journey_contributors: JourneyContributorsTable;journey_entries: JourneyEntriesTable;journey_entry_photos: JourneyEntryPhotosTable;+ journey_entry_stays: JourneyEntryStaysTable;journey_photos: JourneyPhotosTable;journey_recorded_days: JourneyRecordedDaysTable;journey_share_tokens: JourneyShareTokensTable;diff --git a/server/src/db/migrations/Migration20200101046170_a_journey_entry_remembers_the_stays_it_came_from.ts b/server/src/db/migrations/Migration20200101046170_a_journey_entry_remembers_the_stays_it_came_from.tsnew file mode 100644index 000000000..490254544--- /dev/null+++ b/server/src/db/migrations/Migration20200101046170_a_journey_entry_remembers_the_stays_it_came_from.ts@@ -0,0 +1,42 @@+import { Migration } from '@mikro-orm/migrations';++/**+ * JRN-02: an entry taken over from a recorded day remembers the stays it was+ * made of.+ *+ * One row per stay, with its own name, place and times as they were taken+ * over, so a day report keeps every place it covers although the entry has+ * one map position. The rows are also the ledger that taking a day over again+ * reads: `(journey_id, source, user_id, source_visit_id)` is unique, so+ * the same stay of the same person lands in a journey once. `user_id` is+ * whose recording it is; the stays go with their entry.+ */+export class Migration20200101046170_a_journey_entry_remembers_the_stays_it_came_from extends Migration {+ override name = 'Migration20200101046170_a_journey_entry_remembers_the_stays_it_came_from';++ override up(): void {+ this.addSql(`+ CREATE TABLE IF NOT EXISTS journey_entry_stays (+ id INTEGER PRIMARY KEY,+ journey_id INTEGER NOT NULL REFERENCES journeys(id) ON DELETE CASCADE,+ entry_id INTEGER NOT NULL REFERENCES journey_entries(id) ON DELETE CASCADE,+ source TEXT NOT NULL DEFAULT 'dawarich',+ source_visit_id TEXT NOT NULL,+ name TEXT NOT NULL,+ lat REAL,+ lng REAL,+ started_at TEXT NOT NULL,+ ended_at TEXT NOT NULL,+ duration_minutes INTEGER NOT NULL DEFAULT 0,+ sort_order INTEGER NOT NULL DEFAULT 0,+ user_id INTEGER REFERENCES users(id) ON DELETE SET NULL,+ created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP+ )+ `);+ this.addSql(+ 'CREATE UNIQUE INDEX IF NOT EXISTS idx_journey_entry_stays_stay ON journey_entry_stays(journey_id, source, user_id, source_visit_id)',+ );+ this.addSql('CREATE INDEX IF NOT EXISTS idx_journey_entry_stays_entry ON journey_entry_stays(entry_id)');+ this.addSql('CREATE INDEX IF NOT EXISTS idx_journey_entry_stays_user ON journey_entry_stays(user_id)');+ }+}diff --git a/server/src/db/repositories/DawarichVisitSuggestions.repository.ts b/server/src/db/repositories/DawarichVisitSuggestions.repository.tsindex 6acfb7443..0be469d0a 100644--- a/server/src/db/repositories/DawarichVisitSuggestions.repository.ts+++ b/server/src/db/repositories/DawarichVisitSuggestions.repository.ts@@ -157,6 +157,17 @@ export class DawarichVisitSuggestionsRepository extends TrekRepository<DawarichV}/** DWS3 — `getOne`: single-row variant of {@link list}'s join. */+ /** One person's stays of one local day, in the order they were lived (JRN-02's day review). */+ async listForDay(userId: number, localDate: string): Promise<SuggestionJoinRow[]> {+ const rows = await this.joinedQuery()+ .where('s.user_id', '=', userId)+ .where('s.local_date', '=', localDate)+ .orderBy('s.started_at', 'asc')+ .orderBy('s.id', 'asc')+ .execute();+ return rows as SuggestionJoinRow[];+ }+async getOne(userId: number, id: number): Promise<SuggestionJoinRow | null> {const row = await this.joinedQuery().where('s.id', '=', id).where('s.user_id', '=', userId).executeTakeFirst();return (row as SuggestionJoinRow) ?? null;diff --git a/server/src/db/repositories/JourneyEntryStays.repository.ts b/server/src/db/repositories/JourneyEntryStays.repository.tsnew file mode 100644index 000000000..f1d4a6c24--- /dev/null+++ b/server/src/db/repositories/JourneyEntryStays.repository.ts@@ -0,0 +1,63 @@+import type { JourneyEntryStays } from '../entities/JourneyEntryStays.entity';+import type { DB } from '../kysely/db';+import { TrekRepository } from './_shared/trek-repository';++type EntryStaysDB = Pick<DB, 'journey_entry_stays' | 'journey_entries'>;++/** A recorded stay as an entry takes it over. */+export interface JourneyEntryStayWrite {+ journey_id: number;+ entry_id: number;+ source: string;+ source_visit_id: string;+ name: string;+ lat: number | null;+ lng: number | null;+ started_at: string;+ ended_at: string;+ duration_minutes: number;+ sort_order: number;+ user_id: number;+}++/** A stay a journey holds, with the entry that holds it. */+interface JourneyEntryStayHeld {+ source_visit_id: string;+ entry_id: number;+ entry_title: string | null;+}++/**+ * `journey_entry_stays` (JRN-02): the recorded stays an entry was taken over+ * from, one row per stay, and the ledger that keeps the same stay of the same+ * person from landing in a journey twice. The rows go with their entry.+ */+export class JourneyEntryStaysRepository extends TrekRepository<JourneyEntryStays> {+ private db() {+ return this.kysely<EntryStaysDB>();+ }++ async insertStays(stays: JourneyEntryStayWrite[]): Promise<void> {+ if (stays.length === 0) return;+ await this.db().insertInto('journey_entry_stays').values(stays).execute();+ }++ /** Which of one person's stays of one source the journey holds, and in which entry. */+ async listHeld(+ journeyId: number,+ userId: number,+ source: string,+ sourceVisitIds: string[],+ ): Promise<JourneyEntryStayHeld[]> {+ if (sourceVisitIds.length === 0) return [];+ return await this.db()+ .selectFrom('journey_entry_stays as s')+ .innerJoin('journey_entries as e', 'e.id', 's.entry_id')+ .select(['s.source_visit_id', 's.entry_id', 'e.title as entry_title'])+ .where('s.journey_id', '=', journeyId)+ .where('s.user_id', '=', userId)+ .where('s.source', '=', source)+ .where('s.source_visit_id', 'in', sourceVisitIds)+ .execute();+ }+}diff --git a/server/src/nest/integrations/dawarich-day-stays.service.ts b/server/src/nest/integrations/dawarich-day-stays.service.tsnew file mode 100644index 000000000..af5ec21a0--- /dev/null+++ b/server/src/nest/integrations/dawarich-day-stays.service.ts@@ -0,0 +1,94 @@+import { DawarichVisitSuggestions } from '../../db/entities/DawarichVisitSuggestions.entity';+import type {+ DawarichVisitSuggestionsRepository,+ SuggestionJoinRow,+} from '../../db/repositories/DawarichVisitSuggestions.repository';+import { DomainError } from '../common/domain-error';+import { DawarichSyncService } from './dawarich-sync.service';+import { DawarichError } from './dawarich.client';+import { DawarichService } from './dawarich.service';+import { InjectRepository } from '@mikro-orm/nestjs';+import { Injectable } from '@nestjs/common';++/** The caller's stays of one day, and how current they are. */+interface DawarichDayStays {+ stays: SuggestionJoinRow[];+ /** Read from Dawarich just now; false when it did not answer and the last sync is what is shown. */+ fresh: boolean;+ /** Dawarich's reason while `fresh` is false. */+ error: string | null;+ syncedAt: string | null;+ truncated: boolean;+}++/**+ * The stays of one recorded day as a journey takes them over (JRN-02), always+ * the caller's own: read again from their Dawarich where it answers, and+ * marked taken over or left out once they decided. A stay is never written+ * anywhere else from here; the journey's part is `journey-recordings`'.+ */+@Injectable()+export class DawarichDayStaysService {+ constructor(+ @InjectRepository(DawarichVisitSuggestions) private readonly suggestions: DawarichVisitSuggestionsRepository,+ private readonly dawarich: DawarichService,+ private readonly sync: DawarichSyncService,+ ) {}++ /**+ * The stays of a local day, in the order they were lived. Dawarich is asked+ * first; when it does not answer, the stays the last sync brought in are+ * shown with the reason, so the review still works on what is known.+ * Refuses with 409 `not_connected` without a connection.+ *+ * @txIndependent the refresh after a network read and the reopening of+ * stays whose entry is gone each stand on their own.+ */+ async forDay(userId: number, date: string): Promise<DawarichDayStays> {+ const creds = await this.dawarich.getCredentials(userId);+ if (!creds) throw new DomainError(409, 'Dawarich is not connected', { details: { code: 'not_connected' } });++ let fresh = true;+ let error: string | null = null;+ let truncated = false;+ try {+ ({ truncated } = await this.sync.refreshDay(userId, creds, date));+ } catch (err) {+ if (!(err instanceof DawarichError)) throw err;+ fresh = false;+ error = err.code;+ }+ // An entry deleted since puts its stay back into review, as the stay list does.+ await this.suggestions.reopenOrphaned(userId);+ const connection = await this.dawarich.getConnection(userId);+ return {+ stays: await this.suggestions.listForDay(userId, date),+ fresh,+ error,+ syncedAt: fresh ? null : connection.lastSyncAt,+ truncated,+ };+ }++ /** The caller's stays of a day as they stand now, without asking Dawarich. */+ async storedForDay(userId: number, date: string): Promise<SuggestionJoinRow[]> {+ return await this.suggestions.listForDay(userId, date);+ }++ /**+ * Marks stays taken over into the journal entries that hold them, and the+ * ones left out as dismissed, so the day shows nothing pending afterwards.+ * Runs inside the caller's transaction with the entries it wrote.+ */+ async settle(taken: Array<{ suggestionId: number; entryId: number }>, skippedIds: number[]): Promise<void> {+ for (const { suggestionId, entryId } of taken) {+ await this.suggestions.markAccepted(suggestionId, {+ target: 'journal',+ placeId: null,+ journalEntryId: entryId,+ bucketItemId: null,+ });+ }+ for (const id of skippedIds) await this.suggestions.setState(id, 'dismissed');+ }+}diff --git a/server/src/nest/integrations/dawarich-suggestions.service.ts b/server/src/nest/integrations/dawarich-suggestions.service.tsindex 08f4c43fc..eab1cfe46 100644--- a/server/src/nest/integrations/dawarich-suggestions.service.ts+++ b/server/src/nest/integrations/dawarich-suggestions.service.ts@@ -17,6 +17,7 @@ import { NAME_TO_CODE } from '../atlas/atlas-geo';import { AtlasService } from '../atlas/atlas.service';import { UnitOfWork } from '../database/unit-of-work';import { JourneyDomainService } from '../journey/journey-domain.service';+import { JourneyEntryStaysService } from '../journey/journey-entry-stays.service';import { PermissionsService } from '../permissions/permissions.service';import { PlacesService } from '../places/places.service';import { DawarichClient, type DawarichCreds } from './dawarich.client';@@ -68,6 +69,7 @@ export class DawarichSuggestionsService {private readonly assignments: AssignmentsService,private readonly permissions: PermissionsService,private readonly journey: JourneyDomainService,+ private readonly journeyStays: JourneyEntryStaysService,@InjectRepository(Trips) private readonly trips: TripsRepository,@InjectRepository(Places) private readonly placesRepo: PlacesRepository,@InjectRepository(BucketList) private readonly bucketList: BucketListRepository,@@ -298,6 +300,19 @@ export class DawarichSuggestionsService {sid,);if (!created) throw new AcceptError('journal_forbidden', 'Journey not found', 404);+ // Recorded on the entry like a stay of a day taken over whole (JRN-02),+ // so that taking the day over later finds this one in the journal.+ await this.journeyStays.record(created.journey_id, created.id, userId, [+ {+ sourceVisitId: row.source_visit_id,+ name: body.name?.trim() || row.name,+ lat: row.lat,+ lng: row.lng,+ startedAt: row.started_at,+ endedAt: row.ended_at,+ durationMinutes: row.duration_minutes,+ },+ ]);await this.markAccepted(row.id, 'journal', { journalEntryId: created.id });return created;});diff --git a/server/src/nest/integrations/dawarich-sync.service.ts b/server/src/nest/integrations/dawarich-sync.service.tsindex 556e1bceb..6db4520a1 100644--- a/server/src/nest/integrations/dawarich-sync.service.ts+++ b/server/src/nest/integrations/dawarich-sync.service.ts@@ -11,7 +11,7 @@ import { AddonsService } from '../addons/addons.service';import { getCountryFromCoords } from '../atlas/atlas-geo';import { logError, logInfo } from '../audit/audit-log.logger';import { UnitOfWork } from '../database/unit-of-work';-import { DawarichClient, DawarichError, type DawarichCreds } from './dawarich.client';+import { DawarichClient, DawarichError, type DawarichCreds, type DawarichVisitRaw } from './dawarich.client';import { distanceMeters, localDateOf, normalizeVisit, syncWindow, visitHash } from './dawarich.helpers';import { DawarichService } from './dawarich.service';import { InjectRepository } from '@mikro-orm/nestjs';@@ -24,6 +24,8 @@ import {type DawarichSyncState,} from '@trek/shared';+const DAY_MS = 24 * 60 * 60 * 1000;+/** What one user's sync produced — plus whether it ran at all. */export interface DawarichSyncOutcome {state: DawarichSyncState;@@ -249,90 +251,131 @@ export class DawarichSyncService {const seenIds = new Set<string>();let created = 0;let updated = 0;-for (const raw of visits) {- const visit = normalizeVisit(raw);- if (!visit) continue;- seenIds.add(visit.sourceVisitId);-- const hash = visitHash(raw);- const existing = await this.suggestions.findByUserAndVisit(userId, visit.sourceVisitId);-- // Dawarich has no country code on a visit's place, so it is resolved here- // from the coordinates against the same borders the Atlas draws. A code- // the source does start sending one day wins, because it is the source's- // own answer.- const countryCode =- visit.countryCodeFromSource ??- (visit.lat !== null && visit.lng !== null ? getCountryFromCoords(visit.lat, visit.lng) : null);-- const ownerTripId = tripForVisit(visit.localDate, tripId, existing?.trip_id ?? null, trips);-- if (!existing) {- await this.suggestions.insertVisit({- user_id: userId,- source_visit_id: visit.sourceVisitId,- trip_id: ownerTripId,- name: visit.name,- lat: visit.lat,- lng: visit.lng,- started_at: visit.startedAt,- ended_at: visit.endedAt,- duration_minutes: visit.durationMinutes,- local_date: visit.localDate,- source_status: visit.status,- confidence: visit.confidence,- confidence_band: visit.confidenceBand,- country_code: countryCode,- source_hash: hash,- first_seen_at: new Date().toISOString(),- last_seen_at: new Date().toISOString(),- });- created++;- await this.matchBucketList(userId, visit.sourceVisitId, visit.lat, visit.lng, visit.durationMinutes);- continue;- }-- const changed = existing.source_hash !== hash;-- if (existing.state === 'new') {- // Nobody has acted on it yet, so the newest version of the source is- // simply the better suggestion. Overwriting here loses nothing, and- // that includes the trip: a stay parked on a neighbour by an earlier- // run moves to the trip whose dates hold it.- await this.suggestions.updateNewVisit(existing.id, {- name: visit.name,- lat: visit.lat,- lng: visit.lng,- started_at: visit.startedAt,- ended_at: visit.endedAt,- duration_minutes: visit.durationMinutes,- local_date: visit.localDate,- source_status: visit.status,- confidence: visit.confidence,- confidence_band: visit.confidenceBand,- country_code: countryCode,- source_hash: hash,- trip_id: ownerTripId,- last_seen_at: new Date().toISOString(),- });- if (changed) updated++;- await this.matchBucketList(userId, visit.sourceVisitId, visit.lat, visit.lng, visit.durationMinutes);- continue;- }-- // Accepted or dismissed: the hash is refreshed so the flag is raised once- // rather than on every tick, but nothing the user can see is rewritten.- // `accepted_hash` is what they said yes to; the difference between that- // and the current hash is what the UI reports.- await this.suggestions.refreshHash(existing.id, hash, new Date().toISOString());- if (changed) updated++;+ const outcome = await this.upsertVisit(userId, tripId, raw, trips);+ if (!outcome) continue;+ seenIds.add(outcome.sourceVisitId);+ if (outcome.change === 'created') created++;+ else if (outcome.change === 'updated') updated++;}const missing = await this.flagMissing(userId, tripId, from, to, seenIds);return { created, updated, missing };}+ /**+ * One visit into the user's suggestions: inserted when new, overwritten while+ * nobody acted on it, only its hash refreshed once accepted or dismissed.+ * Null for a visit too broken to read.+ *+ * @txIndependent the stay is whole once written; the wish match after it is+ * a derived hint the next sync works out again.+ */+ private async upsertVisit(+ userId: number,+ tripId: number | null,+ raw: DawarichVisitRaw,+ trips: TripRow[],+ ): Promise<{ sourceVisitId: string; change: 'created' | 'updated' | 'unchanged' } | null> {+ const visit = normalizeVisit(raw);+ if (!visit) return null;++ const hash = visitHash(raw);+ const existing = await this.suggestions.findByUserAndVisit(userId, visit.sourceVisitId);++ // Dawarich has no country code on a visit's place, so it is resolved here+ // from the coordinates against the same borders the Atlas draws. A code+ // the source does start sending one day wins, because it is the source's+ // own answer.+ const countryCode =+ visit.countryCodeFromSource ??+ (visit.lat !== null && visit.lng !== null ? getCountryFromCoords(visit.lat, visit.lng) : null);++ const ownerTripId = tripForVisit(visit.localDate, tripId, existing?.trip_id ?? null, trips);++ if (!existing) {+ await this.suggestions.insertVisit({+ user_id: userId,+ source_visit_id: visit.sourceVisitId,+ trip_id: ownerTripId,+ name: visit.name,+ lat: visit.lat,+ lng: visit.lng,+ started_at: visit.startedAt,+ ended_at: visit.endedAt,+ duration_minutes: visit.durationMinutes,+ local_date: visit.localDate,+ source_status: visit.status,+ confidence: visit.confidence,+ confidence_band: visit.confidenceBand,+ country_code: countryCode,+ source_hash: hash,+ first_seen_at: new Date().toISOString(),+ last_seen_at: new Date().toISOString(),+ });+ await this.matchBucketList(userId, visit.sourceVisitId, visit.lat, visit.lng, visit.durationMinutes);+ return { sourceVisitId: visit.sourceVisitId, change: 'created' };+ }++ const changed = existing.source_hash !== hash;++ if (existing.state === 'new') {+ // Nobody has acted on it yet, so the newest version of the source is+ // simply the better suggestion. Overwriting here loses nothing, and+ // that includes the trip: a stay parked on a neighbour by an earlier+ // run moves to the trip whose dates hold it.+ await this.suggestions.updateNewVisit(existing.id, {+ name: visit.name,+ lat: visit.lat,+ lng: visit.lng,+ started_at: visit.startedAt,+ ended_at: visit.endedAt,+ duration_minutes: visit.durationMinutes,+ local_date: visit.localDate,+ source_status: visit.status,+ confidence: visit.confidence,+ confidence_band: visit.confidenceBand,+ country_code: countryCode,+ source_hash: hash,+ trip_id: ownerTripId,+ last_seen_at: new Date().toISOString(),+ });+ await this.matchBucketList(userId, visit.sourceVisitId, visit.lat, visit.lng, visit.durationMinutes);+ return { sourceVisitId: visit.sourceVisitId, change: changed ? 'updated' : 'unchanged' };+ }++ // Accepted or dismissed: the hash is refreshed so the flag is raised once+ // rather than on every tick, but nothing the user can see is rewritten.+ // `accepted_hash` is what they said yes to; the difference between that+ // and the current hash is what the UI reports.+ await this.suggestions.refreshHash(existing.id, hash, new Date().toISOString());+ return { sourceVisitId: visit.sourceVisitId, change: changed ? 'updated' : 'unchanged' };+ }++ /**+ * The stays of one local day read again from Dawarich (JRN-02), so the day+ * review shows what the recording holds now and not only what the last sync+ * of a trip window brought in. The window reaches a day past both sides,+ * because a stay's day is in its own zone and Dawarich filters on the start.+ *+ * Upserts only: nothing is flagged missing or deleted, since a window this+ * narrow is no full re-read of anything a trip's sync holds.+ *+ * @txIndependent one stay at a time after the network read, as the trip+ * sync writes them.+ */+ async refreshDay(userId: number, creds: DawarichCreds, date: string): Promise<{ truncated: boolean }> {+ const day = Date.parse(`${date}T00:00:00Z`);+ const { visits, truncated } = await this.client.listVisits(+ creds,+ new Date(day - DAY_MS),+ new Date(day + 2 * DAY_MS),+ );+ const trips = await this.listTripsToSync(userId);+ for (const raw of visits) await this.upsertVisit(userId, null, raw, trips);+ return { truncated };+ }+/*** Mark everything TREK holds for this window that the source no longer lists.*@@ -495,10 +538,10 @@ function tripCovers(trip: TripRow, localDate: string): boolean {*/function tripForVisit(localDate: string,- currentTripId: number,+ currentTripId: number | null,existingTripId: number | null,trips: TripRow[],-): number {+): number | null {const existing = existingTripId === null ? undefined : trips.find((t) => t.id === existingTripId);if (existing && tripCovers(existing, localDate)) return existing.id;const current = trips.find((t) => t.id === currentTripId);diff --git a/server/src/nest/integrations/dawarich.module.ts b/server/src/nest/integrations/dawarich.module.tsindex 554a031cf..ed94eeb3d 100644--- a/server/src/nest/integrations/dawarich.module.ts+++ b/server/src/nest/integrations/dawarich.module.ts@@ -14,6 +14,7 @@ import { McpSharedModule } from '../mcp-shared/mcp-shared.module';import { PermissionsModule } from '../permissions/permissions.module';import { PlacesModule } from '../places/places.module';import { SchedulingModule } from '../scheduling/scheduling.module';+import { DawarichDayStaysService } from './dawarich-day-stays.service';import { DawarichSuggestionsService } from './dawarich-suggestions.service';import { DawarichSyncJob } from './dawarich-sync.job';import { DawarichSyncService } from './dawarich-sync.service';@@ -86,9 +87,10 @@ import { Module } from '@nestjs/common';DawarichSyncService,DawarichSuggestionsService,DawarichTracksService,+ DawarichDayStaysService,DawarichSyncJob,DawarichMcp,],- exports: [DawarichService, DawarichSuggestionsService, DawarichTracksService],+ exports: [DawarichService, DawarichSuggestionsService, DawarichTracksService, DawarichDayStaysService],})export class DawarichModule {}diff --git a/server/src/nest/journey-recordings/journey-day-import.controller.ts b/server/src/nest/journey-recordings/journey-day-import.controller.tsnew file mode 100644index 000000000..82919406c--- /dev/null+++ b/server/src/nest/journey-recordings/journey-day-import.controller.ts@@ -0,0 +1,46 @@+import { ADDON_IDS } from '../../addons';+import type { User } from '../../types';+import { AddonGuard } from '../addons/addon.guard';+import { RequireAddon } from '../addons/require-addon.decorator';+import { CurrentUser } from '../auth-core/current-user.decorator';+import { JwtAuthGuard } from '../auth-core/jwt-auth.guard';+import { ResponseContract } from '../common/response-contract';+import { JourneyDayImportService } from './journey-day-import.service';+import { dateParam } from './journey-recordings.controller';+import { JourneyDayImportDto } from './journey-recordings.dto';+import { Body, Controller, Headers, HttpCode, Param, Post, UseGuards } from '@nestjs/common';+import { journeyDayImportResultSchema, journeyDayStaysSchema } from '@trek/shared';++/**+ * A recorded day taken into a journey with its stays (JRN-02), at+ * `/api/journeys/:id/recordings/:date/stays`. Both need the right to edit the+ * journey and the Dawarich addon, and read the caller's own connection. The+ * review is a POST because it reads Dawarich again and refreshes the stays it+ * shows.+ */+@Controller('api/journeys/:id/recordings')+@UseGuards(AddonGuard, JwtAuthGuard)+@RequireAddon(ADDON_IDS.JOURNEY, 'Journey')+export class JourneyDayImportController {+ constructor(private readonly dayImport: JourneyDayImportService) {}++ @Post(':date/stays/review')+ @HttpCode(200)+ @ResponseContract(journeyDayStaysSchema)+ async review(@CurrentUser() user: User, @Param('id') id: string, @Param('date') date: string) {+ return await this.dayImport.review(user.id, Number(id), dateParam(date));+ }++ @Post(':date/stays/import')+ @HttpCode(200)+ @ResponseContract(journeyDayImportResultSchema)+ async takeOver(+ @CurrentUser() user: User,+ @Param('id') id: string,+ @Param('date') date: string,+ @Body() body: JourneyDayImportDto,+ @Headers('x-socket-id') socketId?: string,+ ) {+ return await this.dayImport.takeOver(user.id, Number(id), dateParam(date), body, socketId);+ }+}diff --git a/server/src/nest/journey-recordings/journey-day-import.mcp.ts b/server/src/nest/journey-recordings/journey-day-import.mcp.tsnew file mode 100644index 000000000..3b945dbd3--- /dev/null+++ b/server/src/nest/journey-recordings/journey-day-import.mcp.ts@@ -0,0 +1,67 @@+import { ADDON_IDS } from '../../addons';+import {+ McpController,+ TOOL_ANNOTATIONS_READONLY,+ TOOL_ANNOTATIONS_WRITE,+ Tool,+ ok,+ type McpContext,+} from '../../nest-mcp';+import { addonGate, type HasAddons } from '../addons/addon-gate';+import { AddonsService } from '../addons/addons.service';+import { JourneyDayImportService } from './journey-day-import.service';+import {+ idSchema,+ journeyDayImportRequestSchema,+ journeyRecordingDateSchema,+ type JourneyDayImportRequest,+} from '@trek/shared';++const journeyAddonOn = addonGate(ADDON_IDS.JOURNEY);+const dawarichAddonOn = addonGate(ADDON_IDS.DAWARICH);++const bothAddonsOn = async (ctx: McpContext, self: HasAddons): Promise<boolean> =>+ (await journeyAddonOn(ctx, self)) && (await dawarichAddonOn(ctx, self));++/**+ * A recorded day taken into a journey with its stays (JRN-02) over MCP: the+ * same service, refusals and journey access as+ * `/api/journeys/:id/recordings/:date/stays`.+ */+@McpController()+export class JourneyDayImportMcp {+ constructor(+ private readonly dayImport: JourneyDayImportService,+ readonly addons: AddonsService,+ ) {}++ @Tool({+ name: 'review_journey_day_stays',+ description:+ "The stays Dawarich found on one local day, from the caller's own connection, as a journey would take them over: each with its suggestionId, name, place, arrival and departure, whether Dawarich only guessed it, and its status for this journey (open, skipped before, here with the entry holding it, or taken over elsewhere), plus the entries the journey has on the day. When Dawarich does not answer, the stays of the last sync are shown with fresh: false and the reason. Needs edit access to the journey.",+ inputSchema: { journeyId: idSchema, date: journeyRecordingDateSchema },+ // Reaches the caller's own Dawarich instance and refreshes their stays of the day.+ annotations: { ...TOOL_ANNOTATIONS_READONLY, openWorldHint: true },+ when: bothAddonsOn,+ access: { group: 'journey', mode: 'read' },+ })+ async reviewDayStays({ journeyId, date }: { journeyId: number; date: string }, ctx: McpContext) {+ return ok(await this.dayImport.review(ctx.userId, journeyId, date));+ }++ @Tool({+ name: 'take_over_journey_day_stays',+ description:+ 'Take stays of one local day into a journey as draft entries, after the traveller chose them in review_journey_day_stays. Each group becomes one draft: kind single (one stay), merged (stays of one place, pinned at anchorSuggestionId or the longest stay) or report (a day report listing its stays with their times, at anchorSuggestionId or, with null, without a map position). merged and report need a title; a stay may carry a corrected name. skipSuggestionIds are open stays left out on purpose; they are dismissed and can be restored. Every stay keeps its own place and times on the entry. Stays the journey holds already are reported in alreadyTaken and never written twice. Drafts never appear on shared pages, and nothing written before is changed.',+ inputSchema: { journeyId: idSchema, date: journeyRecordingDateSchema, ...journeyDayImportRequestSchema.shape },+ annotations: TOOL_ANNOTATIONS_WRITE,+ when: bothAddonsOn,+ access: { group: 'journey', mode: 'write' },+ })+ async takeOverDayStays(+ { journeyId, date, ...request }: { journeyId: number; date: string } & JourneyDayImportRequest,+ ctx: McpContext,+ ) {+ return ok(await this.dayImport.takeOver(ctx.userId, journeyId, date, request));+ }+}diff --git a/server/src/nest/journey-recordings/journey-day-import.service.ts b/server/src/nest/journey-recordings/journey-day-import.service.tsnew file mode 100644index 000000000..541d138a1--- /dev/null+++ b/server/src/nest/journey-recordings/journey-day-import.service.ts@@ -0,0 +1,230 @@+import type { SuggestionJoinRow } from '../../db/repositories/DawarichVisitSuggestions.repository';+import { badRequest, forbidden, notFound } from '../common/domain-error';+import { UnitOfWork } from '../database/unit-of-work';+import { DawarichDayStaysService } from '../integrations/dawarich-day-stays.service';+import { JourneyDomainService } from '../journey/journey-domain.service';+import { JourneyEntryStaysService, type StayTakenOver } from '../journey/journey-entry-stays.service';+import { JourneyRecordedDaysService } from '../journey/journey-recorded-days.service';+import { JourneyRecordingsService } from './journey-recordings.service';+import { Injectable } from '@nestjs/common';+import {+ journeyDayImportProblem,+ type JourneyDayEntry,+ type JourneyDayImportGroup,+ type JourneyDayImportRequest,+ type JourneyDayImportResult,+ type JourneyDayStay,+ type JourneyDayStays,+} from '@trek/shared';++type CreatedEntry = NonNullable<Awaited<ReturnType<JourneyDomainService['createEntry']>>>;++/** A stay of the group with the name it goes into the journal under. */+interface NamedStay {+ row: SuggestionJoinRow;+ name: string;+}++/**+ * Taking a recorded day into a journey with its stays (JRN-02): the review of+ * the day from the caller's own Dawarich, then, on their word, drafts.+ *+ * Every stay is the caller's and of the chosen day, checked again when the+ * drafts are written. The drafts, the stays they hold, and the stays marked+ * taken over or left out are one transaction: a failure leaves nothing+ * behind, and a stay the journey holds already is reported instead of+ * written twice, so sending the same take-over again is harmless. The new+ * entries are announced after the commit. Nothing that was in the journal is+ * changed, and nothing is published: the entries are drafts.+ */+@Injectable()+export class JourneyDayImportService {+ constructor(+ private readonly recordings: JourneyRecordingsService,+ private readonly journeys: JourneyDomainService,+ private readonly entryStays: JourneyEntryStaysService,+ private readonly recordedDays: JourneyRecordedDaysService,+ private readonly dayStays: DawarichDayStaysService,+ private readonly uow: UnitOfWork,+ ) {}++ async review(userId: number, journeyId: number, date: string): Promise<JourneyDayStays> {+ const journey = await this.recordings.requireEditable(journeyId, userId);+ await this.recordings.requireDawarich();+ const day = await this.dayStays.forDay(userId, date);+ const entries = await this.entryStays.entriesOn(journeyId, date);+ const held = await this.entryStays.held(+ journeyId,+ userId,+ day.stays.map((row) => row.source_visit_id),+ );+ return {+ journey: { id: journey.id, title: journey.title },+ date,+ stays: day.stays.map((row) => toStay(row, held.get(row.source_visit_id) ?? null, entries)),+ entries,+ fresh: day.fresh,+ error: day.error,+ syncedAt: day.syncedAt,+ truncated: day.truncated,+ audience: await this.recordedDays.audience(journeyId, userId),+ };+ }++ async takeOver(+ userId: number,+ journeyId: number,+ date: string,+ request: JourneyDayImportRequest,+ socketId?: string,+ ): Promise<JourneyDayImportResult> {+ const problem = journeyDayImportProblem(request);+ if (problem) throw badRequest('This take-over cannot be written', { code: problem });+ await this.recordings.requireEditable(journeyId, userId);+ await this.recordings.requireDawarich();++ // Read inside the transaction, so a second take-over of the same day sent+ // at once finds what the first one wrote and reports it as taken.+ const done = await this.uow.transactional(async () => {+ const rows = new Map((await this.dayStays.storedForDay(userId, date)).map((row) => [row.id, row]));+ const rowOf = (id: number): SuggestionJoinRow => {+ const row = rows.get(id);+ if (!row) throw notFound('A stay is not one of yours on that day', { code: 'stay_not_on_day' });+ return row;+ };+ const groups = request.groups.map((group) => ({+ group,+ stays: group.stays.map((stay) => {+ const row = rowOf(stay.suggestionId);+ return { row, name: stay.name ?? row.name };+ }),+ }));+ const skipping = (request.skipSuggestionIds ?? []).map(rowOf);+ const held = await this.entryStays.held(+ journeyId,+ userId,+ [...rows.values()].map((row) => row.source_visit_id),+ );+ const isTaken = (row: SuggestionJoinRow) => held.has(row.source_visit_id) || row.state === 'accepted';++ const written: Array<{ entry: CreatedEntry; stays: NamedStay[] }> = [];+ for (const { group, stays: asked } of groups) {+ const [first, ...rest] = asked+ .filter((stay) => !isTaken(stay.row))+ .sort((a, b) => (a.row.started_at < b.row.started_at ? -1 : 1));+ if (!first) continue;+ const stays: [NamedStay, ...NamedStay[]] = [first, ...rest];+ // Announced below, once the whole take-over is committed.+ const entry = await this.journeys.createEntry(journeyId, userId, draftOf(group, stays, date), undefined, false);+ if (!entry) throw forbidden('Not allowed');+ await this.entryStays.record(journeyId, entry.id, userId, stays.map(takenOver));+ written.push({ entry, stays });+ }+ const skipped = skipping.filter((row) => row.state === 'new').map((row) => row.id);+ await this.dayStays.settle(+ written.flatMap(({ entry, stays }) => stays.map((stay) => ({ suggestionId: stay.row.id, entryId: entry.id }))),+ skipped,+ );+ const alreadyTaken = [...groups.flatMap(({ stays }) => stays.map((stay) => stay.row)), ...skipping]+ .filter(isTaken)+ .map((row) => row.id);+ return { written, skipped, alreadyTaken };+ });++ await Promise.all(+ done.written.map(({ entry }) =>+ this.journeys.broadcastJourneyEvent(journeyId, 'journey:entry:created', { entry }, socketId),+ ),+ );+ return {+ entries: done.written.map(({ entry, stays }) => ({+ id: entry.id,+ title: entry.title ?? null,+ stayCount: stays.length,+ })),+ alreadyTaken: done.alreadyTaken,+ skipped: done.skipped,+ };+ }+}++/** Where a stay of the day stands for this journey, as the review shows it. */+function toStay(+ row: SuggestionJoinRow,+ heldBy: { id: number; title: string | null } | null,+ entries: JourneyDayEntry[],+): JourneyDayStay {+ // A stay accepted one by one before the ledger existed is known by its entry id.+ const legacy = row.target === 'journal' ? entries.find((e) => e.id === row.accepted_journal_entry_id) : undefined;+ const entry = heldBy ?? (legacy ? { id: legacy.id, title: legacy.title } : null);+ return {+ suggestionId: row.id,+ name: row.name,+ lat: row.lat,+ lng: row.lng,+ startedAt: row.started_at,+ endedAt: row.ended_at,+ durationMinutes: row.duration_minutes,+ sourceStatus: row.source_status === 'confirmed' ? 'confirmed' : 'suggested',+ confidenceBand: row.confidence_band,+ status: entry ? 'here' : row.state === 'accepted' ? 'elsewhere' : row.state === 'dismissed' ? 'skipped' : 'open',+ entry,+ };+}++/**+ * The draft a group becomes. It is pinned to the chosen stay, else the longest+ * one with a place, and dated to the day at the first arrival. A report lists+ * its stays with their times, so it is never an empty card.+ */+function draftOf(group: JourneyDayImportGroup, stays: [NamedStay, ...NamedStay[]], date: string) {+ const anchor =+ group.anchorSuggestionId === null+ ? undefined+ : (stays.find((stay) => stay.row.id === group.anchorSuggestionId && stay.row.lat !== null) ?? longest(stays));+ const [first] = stays;+ return {+ type: 'entry',+ title: group.title ?? first.name,+ story: group.kind === 'report' ? stays.map(reportLine).join('\n') : undefined,+ entry_date: date,+ entry_time: timeOf(first.row.started_at) ?? undefined,+ location_name: anchor?.name ?? (group.kind === 'report' ? undefined : first.name),+ location_lat: anchor?.row.lat ?? undefined,+ location_lng: anchor?.row.lng ?? undefined,+ is_draft: true,+ };+}++function longest(stays: NamedStay[]): NamedStay | undefined {+ return stays+ .filter((stay) => stay.row.lat !== null && stay.row.lng !== null)+ .reduce<NamedStay | undefined>(+ (best, stay) => (!best || stay.row.duration_minutes > best.row.duration_minutes ? stay : best),+ undefined,+ );+}++function reportLine(stay: NamedStay): string {+ const from = timeOf(stay.row.started_at);+ const to = timeOf(stay.row.ended_at);+ const span = from && to ? `${from}-${to}` : (from ?? '');+ return `- ${span ? `${span} ` : ''}${stay.name}`;+}++function takenOver(stay: NamedStay): StayTakenOver {+ return {+ sourceVisitId: stay.row.source_visit_id,+ name: stay.name,+ lat: stay.row.lat,+ lng: stay.row.lng,+ startedAt: stay.row.started_at,+ endedAt: stay.row.ended_at,+ durationMinutes: stay.row.duration_minutes,+ };+}++/** `HH:MM` out of an ISO timestamp, on the clock of the offset it carries. */+function timeOf(iso: string): string | null {+ return /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(iso) ? iso.slice(11, 16) : null;+}diff --git a/server/src/nest/journey-recordings/journey-recordings.controller.ts b/server/src/nest/journey-recordings/journey-recordings.controller.tsindex bfc33faf5..1af420744 100644--- a/server/src/nest/journey-recordings/journey-recordings.controller.ts+++ b/server/src/nest/journey-recordings/journey-recordings.controller.ts@@ -79,7 +79,8 @@ export class JourneyRecordingsController {}}-function dateParam(raw: string): string {+/** A `:date` path segment as a calendar day, 400 otherwise. */+export function dateParam(raw: string): string {if (!journeyRecordingDateSchema.safeParse(raw).success) throw new HttpException({ error: 'Invalid date' }, 400);return raw;}diff --git a/server/src/nest/journey-recordings/journey-recordings.dto.ts b/server/src/nest/journey-recordings/journey-recordings.dto.tsindex aa012b20c..a6312581f 100644--- a/server/src/nest/journey-recordings/journey-recordings.dto.ts+++ b/server/src/nest/journey-recordings/journey-recordings.dto.ts@@ -1,6 +1,11 @@-import { journeyRecordingPreviewRequestSchema, journeyRecordingSaveRequestSchema } from '@trek/shared';+import {+ journeyDayImportRequestSchema,+ journeyRecordingPreviewRequestSchema,+ journeyRecordingSaveRequestSchema,+} from '@trek/shared';import { createZodDto } from 'nestjs-zod';export class JourneyRecordingPreviewDto extends createZodDto(journeyRecordingPreviewRequestSchema) {}export class JourneyRecordingSaveDto extends createZodDto(journeyRecordingSaveRequestSchema) {}+export class JourneyDayImportDto extends createZodDto(journeyDayImportRequestSchema) {}diff --git a/server/src/nest/journey-recordings/journey-recordings.module.ts b/server/src/nest/journey-recordings/journey-recordings.module.tsindex 222341338..96b500904 100644--- a/server/src/nest/journey-recordings/journey-recordings.module.ts+++ b/server/src/nest/journey-recordings/journey-recordings.module.ts@@ -1,6 +1,9 @@import { AddonsModule } from '../addons/addons.module';import { DawarichModule } from '../integrations/dawarich.module';import { JourneyDomainModule } from '../journey/journey-domain.module';+import { JourneyDayImportController } from './journey-day-import.controller';+import { JourneyDayImportMcp } from './journey-day-import.mcp';+import { JourneyDayImportService } from './journey-day-import.service';import { JourneyRecordingsController } from './journey-recordings.controller';import { JourneyRecordingsMcp } from './journey-recordings.mcp';import { JourneyRecordingsService } from './journey-recordings.service';@@ -10,11 +13,12 @@ import { Module } from '@nestjs/common';* A journey keeping the route recorded on its days (JRN-01): taking a day over* from the caller's Dawarich connection, its routes and its MCP tools. The* days themselves belong to the journey domain; this module only brings them- * in from Dawarich, so neither of the two has to import the other.+ * in from Dawarich, so neither of the two has to import the other. A day+ * taken over with its stays as drafts (JRN-02) lives here for the same reason.*/@Module({imports: [JourneyDomainModule, DawarichModule, AddonsModule],- controllers: [JourneyRecordingsController],- providers: [JourneyRecordingsService, JourneyRecordingsMcp],+ controllers: [JourneyRecordingsController, JourneyDayImportController],+ providers: [JourneyRecordingsService, JourneyRecordingsMcp, JourneyDayImportService, JourneyDayImportMcp],})export class JourneyRecordingsModule {}diff --git a/server/src/nest/journey-recordings/journey-recordings.service.ts b/server/src/nest/journey-recordings/journey-recordings.service.tsindex 2641f9815..942d48ef9 100644--- a/server/src/nest/journey-recordings/journey-recordings.service.ts+++ b/server/src/nest/journey-recordings/journey-recordings.service.ts@@ -49,7 +49,7 @@ export class JourneyRecordingsService {journeyId: number,request: JourneyRecordingPreviewRequest,): Promise<JourneyRecordingPreview> {- const journey = await this.editable(journeyId, userId);+ const journey = await this.requireEditable(journeyId, userId);await this.requireDawarich();const day = await this.tracks.fetchDay(userId, request.date, {offsetMinutes: request.utcOffsetMinutes,@@ -84,7 +84,7 @@ export class JourneyRecordingsService {request: JourneyRecordingSaveRequest,socketId?: string,): Promise<JourneyRecordingSaveResult> {- await this.editable(journeyId, userId);+ await this.requireEditable(journeyId, userId);await this.requireDawarich();const day = await this.tracks.fetchDay(userId, date, {offsetMinutes: request.utcOffsetMinutes,@@ -125,19 +125,20 @@ export class JourneyRecordingsService {/** Drops the day a journey keeps. Needs no Dawarich: a kept day stays removable once the connection is gone. */async remove(userId: number, journeyId: number, date: string, socketId?: string): Promise<void> {- await this.editable(journeyId, userId);+ await this.requireEditable(journeyId, userId);if (!(await this.recordedDays.remove(journeyId, date))) throw notFound('No recording kept for that day');await this.journeys.broadcastJourneyEvent(journeyId, 'journey:recording:updated', { date }, socketId);}- private async editable(journeyId: number, userId: number) {+ /** The journey, when the caller may edit it: 404 when they cannot open it, 403 when they only read it. */+ async requireEditable(journeyId: number, userId: number) {const journey = await this.journeys.canAccessJourney(journeyId, userId);if (!journey) throw notFound('Journey not found');if (!(await this.journeys.canEdit(journeyId, userId))) throw forbidden('Not allowed');return journey;}- private async requireDawarich(): Promise<void> {+ async requireDawarich(): Promise<void> {if (!(await this.addons.isAddonEnabled(ADDON_IDS.DAWARICH))) {throw notFound('Dawarich is not enabled', { code: 'addon_disabled' });}diff --git a/server/src/nest/journey/journey-domain.module.ts b/server/src/nest/journey/journey-domain.module.tsindex 7dc5cf392..f329fcefb 100644--- a/server/src/nest/journey/journey-domain.module.ts+++ b/server/src/nest/journey/journey-domain.module.ts@@ -1,6 +1,7 @@import { JourneyContributors } from '../../db/entities/JourneyContributors.entity';import { JourneyEntries } from '../../db/entities/JourneyEntries.entity';import { JourneyEntryPhotos } from '../../db/entities/JourneyEntryPhotos.entity';+import { JourneyEntryStays } from '../../db/entities/JourneyEntryStays.entity';import { JourneyPhotos } from '../../db/entities/JourneyPhotos.entity';import { JourneyRecordedDays } from '../../db/entities/JourneyRecordedDays.entity';import { JourneyShareTokens } from '../../db/entities/JourneyShareTokens.entity';@@ -13,6 +14,7 @@ import { TrekPhotosModule } from '../photos/trek-photos.module';import { RealtimeModule } from '../realtime/realtime.module';import { SettingsModule } from '../settings/settings.module';import { JourneyDomainService } from './journey-domain.service';+import { JourneyEntryStaysService } from './journey-entry-stays.service';import { JourneyRecordedDaysService } from './journey-recorded-days.service';import { JourneyShareService } from './journey-share.service';import { MikroOrmModule } from '@mikro-orm/nestjs';@@ -66,6 +68,8 @@ import { Module } from '@nestjs/common';* `JourneyRecordedDays` (JRN-01) is the days of recorded route a journey* keeps; `JourneyRecordedDaysService` reads and writes them here, so the map* needs nothing of the integration they were taken over from.+ * `JourneyEntryStays` (JRN-02) is the recorded stays an entry was taken over+ * from, held by `JourneyEntryStaysService` for the same reason.*/@Module({imports: [@@ -84,9 +88,10 @@ import { Module } from '@nestjs/common';Places,JourneyShareTokens,JourneyRecordedDays,+ JourneyEntryStays,]),],- providers: [JourneyDomainService, JourneyShareService, JourneyRecordedDaysService],- exports: [JourneyDomainService, JourneyShareService, JourneyRecordedDaysService],+ providers: [JourneyDomainService, JourneyShareService, JourneyRecordedDaysService, JourneyEntryStaysService],+ exports: [JourneyDomainService, JourneyShareService, JourneyRecordedDaysService, JourneyEntryStaysService],})export class JourneyDomainModule {}diff --git a/server/src/nest/journey/journey-domain.service.ts b/server/src/nest/journey/journey-domain.service.tsindex 752dbfe46..4454c8f23 100644--- a/server/src/nest/journey/journey-domain.service.ts+++ b/server/src/nest/journey/journey-domain.service.ts@@ -1200,9 +1200,9 @@ export class JourneyDomainService {is_draft?: boolean;},sid?: string,+ announce = true,): Promise<JourneyEntryWire | null> {if (!(await this.canEdit(journeyId, userId))) return null;-const now = this.ts();const prosConsJson =data.pros_cons && (data.pros_cons.pros.length || data.pros_cons.cons.length)@@ -1236,7 +1236,7 @@ export class JourneyDomainService {});const created = decodeEntryRow((await this.entriesRepo.findById(insertedId)) as JourneyEntry);- await this.broadcastJourneyEvent(journeyId, 'journey:entry:created', { entry: created }, sid);+ if (announce) await this.broadcastJourneyEvent(journeyId, 'journey:entry:created', { entry: created }, sid);return created;}diff --git a/server/src/nest/journey/journey-entry-stays.service.ts b/server/src/nest/journey/journey-entry-stays.service.tsnew file mode 100644index 000000000..611445325--- /dev/null+++ b/server/src/nest/journey/journey-entry-stays.service.ts@@ -0,0 +1,77 @@+import { JourneyEntries } from '../../db/entities/JourneyEntries.entity';+import { JourneyEntryStays } from '../../db/entities/JourneyEntryStays.entity';+import type { JourneyEntriesRepository } from '../../db/repositories/JourneyEntries.repository';+import type { JourneyEntryStaysRepository } from '../../db/repositories/JourneyEntryStays.repository';+import { InjectRepository } from '@mikro-orm/nestjs';+import { Injectable } from '@nestjs/common';+import type { JourneyDayEntry } from '@trek/shared';++/** A recorded stay as an entry takes it over. */+export interface StayTakenOver {+ sourceVisitId: string;+ name: string;+ lat: number | null;+ lng: number | null;+ startedAt: string;+ endedAt: string;+ durationMinutes: number;+}++const SOURCE = 'dawarich';++/**+ * The recorded stays a journey's entries were taken over from (JRN-02). The+ * journey owns them like its entries: a day report keeps the places it covers+ * here, and taking a day over again asks here what the journey holds already.+ * Reading the stays from Dawarich is `journey-recordings`' part.+ */+@Injectable()+export class JourneyEntryStaysService {+ constructor(+ @InjectRepository(JourneyEntryStays) private readonly stays: JourneyEntryStaysRepository,+ @InjectRepository(JourneyEntries) private readonly entries: JourneyEntriesRepository,+ ) {}++ /** Which of one person's stays the journey holds, by Dawarich visit id, with the entry holding each. */+ async held(+ journeyId: number,+ userId: number,+ sourceVisitIds: string[],+ ): Promise<Map<string, { id: number; title: string | null }>> {+ const rows = await this.stays.listHeld(journeyId, userId, SOURCE, sourceVisitIds);+ return new Map(rows.map((row) => [row.source_visit_id, { id: row.entry_id, title: row.entry_title }]));+ }++ /** The entries a journey has on a day, in the order the timeline shows them. */+ async entriesOn(journeyId: number, date: string): Promise<JourneyDayEntry[]> {+ return (await this.entries.listForJourney(journeyId))+ .filter((entry) => entry.entry_date === date)+ .map((entry) => ({+ id: entry.id,+ title: entry.title ?? null,+ locationName: entry.location_name ?? null,+ entryTime: entry.entry_time ?? null,+ isDraft: entry.is_draft === 1,+ }));+ }++ /** Records the stays an entry was taken over from, in the order they were lived. */+ async record(journeyId: number, entryId: number, userId: number, stays: StayTakenOver[]): Promise<void> {+ await this.stays.insertStays(+ stays.map((stay, index) => ({+ journey_id: journeyId,+ entry_id: entryId,+ source: SOURCE,+ source_visit_id: stay.sourceVisitId,+ name: stay.name,+ lat: stay.lat,+ lng: stay.lng,+ started_at: stay.startedAt,+ ended_at: stay.endedAt,+ duration_minutes: stay.durationMinutes,+ sort_order: index,+ user_id: userId,+ })),+ );+ }+}diff --git a/server/tests/e2e/journey-day-import.e2e.test.ts b/server/tests/e2e/journey-day-import.e2e.test.tsnew file mode 100644index 000000000..f18df6507--- /dev/null+++ b/server/tests/e2e/journey-day-import.e2e.test.ts@@ -0,0 +1,258 @@+/**+ * A recorded day taken into a journey with its stays (JRN-02), through the+ * real AddonGuard, JwtAuthGuard and Zod pipe against a migrated and seeded+ * temp SQLite db, every answer checked against its response contract. The+ * Dawarich client is the one thing replaced: a test never opens a socket to a+ * location archive. The broadcasts go to a FakeRealtimeService.+ *+ * Fixtures: user 1 owns journey 7 and has a Dawarich connection, user 2 is an+ * editor of it with a connection of their own, user 3 a viewer.+ *+ * The walk: review the day, take two stays over as one entry and leave the+ * parking out, send the same take-over again without a second copy, and be+ * refused for a stay that is not the caller's or a group the contract refuses.+ */+import { DawarichConnections } from '../../src/db/entities/DawarichConnections.entity';+import { DawarichVisitSuggestions } from '../../src/db/entities/DawarichVisitSuggestions.entity';+import { JourneyEntries } from '../../src/db/entities/JourneyEntries.entity';+import { JourneyEntryStays } from '../../src/db/entities/JourneyEntryStays.entity';+import { encrypt_api_key } from '../../src/nest/common/crypto/apiKeyCrypto';+import { TrekExceptionFilter } from '../../src/nest/common/trek-exception.filter';+import { ZodValidationPipe } from '../../src/nest/common/zod-validation.pipe';+import { DawarichClient } from '../../src/nest/integrations/dawarich.client';+import { JourneyRecordingsModule } from '../../src/nest/journey-recordings/journey-recordings.module';+import { RealtimeModule } from '../../src/nest/realtime/realtime.module';+import { RealtimeService } from '../../src/nest/realtime/realtime.service';+import { createSnapshotTestDb } from '../helpers/db-mock';+import { addJourneyContributor, makeJourney } from '../helpers/factories/journeys';+import { countRows, deleteRows, findRows, insertRow } from '../helpers/factories/rows';+import { setAddonEnabled } from '../helpers/factories/settings';+import { makeUser } from '../helpers/factories/users';+import { FakeRealtimeService } from '../helpers/fake-realtime';+import { createTestMikroOrmModule, createTestOrm, type TestOrm } from '../helpers/test-orm';+import { TestUnitOfWorkModule } from '../helpers/test-uow';+import { sessionCookie } from './harness';+import { Test } from '@nestjs/testing';++import cookieParser from 'cookie-parser';+import type { Server } from 'http';+import request from 'supertest';+import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';++vi.mock('../../src/nest/audit/audit-log.logger', () => ({+ LOG_LEVEL: 'error',+ logInfo: vi.fn(),+ logDebug: vi.fn(),+ logError: vi.fn(),+ logWarn: vi.fn(),+}));++const db = createSnapshotTestDb();+const realtime = new FakeRealtimeService();+const client = {+ probe: vi.fn(),+ listVisits: vi.fn(),+ listTracks: vi.fn(),+ listPoints: vi.fn(),+ listVisitedCities: vi.fn(),+ findVisitsNear: vi.fn(),+};++let orm: TestOrm;+let journeyId: number;++const OWNER = 1;+const EDITOR = 2;+const VIEWER = 3;+const DAY = '2026-05-14';++function visit(id: number, name: string, from: string, to: string) {+ return {+ id,+ area_id: null,+ started_at: `${DAY}T${from}:00+02:00`,+ ended_at: `${DAY}T${to}:00+02:00`,+ duration: null,+ name,+ status: 'suggested',+ confidence: 70,+ confidence_band: 'high',+ place: { latitude: 45.434, longitude: 12.3388, id: null },+ };+}++describe('Journey day take-over e2e (real guards + temp SQLite)', () => {+ let server: Server;+ let app: Awaited<ReturnType<typeof build>>;++ async function build() {+ const moduleRef = await Test.createTestingModule({+ imports: [+ await TestUnitOfWorkModule.forRoot(db),+ await createTestMikroOrmModule(db),+ RealtimeModule,+ JourneyRecordingsModule,+ ],+ })+ .overrideProvider(RealtimeService)+ .useValue(realtime)+ .overrideProvider(DawarichClient)+ .useValue(client)+ .compile();+ const nest = moduleRef.createNestApplication();+ nest.use(cookieParser());+ nest.useGlobalPipes(new ZodValidationPipe());+ nest.useGlobalFilters(new TrekExceptionFilter());+ await nest.init();+ return nest;+ }++ const as = (userId: number) => ({ Cookie: sessionCookie(userId) });+ const base = () => `/api/journeys/${journeyId}/recordings/${DAY}/stays`;+ const review = (userId = OWNER) => request(server).post(`${base()}/review`).set(as(userId)).send({});+ const takeOver = (body: object, userId = OWNER) =>+ request(server).post(`${base()}/import`).set(as(userId)).set('X-Socket-Id', '11').send(body);++ async function connect(userId: number) {+ await insertRow(orm, DawarichConnections, {+ user: userId,+ url: 'https://dawarich.example',+ api_key: encrypt_api_key('secret-key'),+ });+ }++ /** The suggestion ids of the caller's stays, in the order the review lists them. */+ async function reviewedIds(userId = OWNER): Promise<number[]> {+ const res = await review(userId);+ expect(res.status).toBe(200);+ return (res.body.stays as Array<{ suggestionId: number }>).map((stay) => stay.suggestionId);+ }++ beforeAll(async () => {+ orm = await createTestOrm(db);+ const user = (id: number, username: string) =>+ makeUser(orm, { id, username, email: `${username}@example.test`, role: 'user', password_version: 0 });+ await user(OWNER, 'marta');+ await user(EDITOR, 'jonas');+ await user(VIEWER, 'viewer');+ const journey = await makeJourney(orm, OWNER, { title: 'Venice' });+ journeyId = journey.id;+ await addJourneyContributor(orm, journeyId, EDITOR, 'editor');+ await addJourneyContributor(orm, journeyId, VIEWER, 'viewer');+ app = await build();+ server = app.getHttpServer();+ });++ beforeEach(async () => {+ await setAddonEnabled(orm, 'journey', true);+ await setAddonEnabled(orm, 'dawarich', true);+ await deleteRows(orm, JourneyEntries);+ await deleteRows(orm, DawarichVisitSuggestions);+ await deleteRows(orm, DawarichConnections);+ await connect(OWNER);+ await connect(EDITOR);+ for (const fn of Object.values(client)) fn.mockReset();+ client.listVisits.mockResolvedValue({+ visits: [+ visit(101, 'Parcheggio', '08:30', '08:40'),+ visit(102, 'Piazza San Marco', '09:10', '10:05'),+ visit(103, 'Piazza San Marco', '10:20', '11:40'),+ ],+ truncated: false,+ version: null,+ });+ realtime.broadcastToUserMock.mockClear();+ });++ afterAll(async () => {+ await app.close();+ await orm.close();+ });++ it('answers 404 with the Journey addon off before asking who the caller is, and 401 without a session', async () => {+ await setAddonEnabled(orm, 'journey', false);+ expect((await request(server).post(`${base()}/review`)).status).toBe(404);+ await setAddonEnabled(orm, 'journey', true);+ expect((await request(server).post(`${base()}/review`)).status).toBe(401);+ });++ it('reviews the day, then takes the square over as one draft and leaves the parking out, announced to the journey', async () => {+ const [parking, first, second] = await reviewedIds();+ const shown = await review();+ expect(shown.body).toMatchObject({+ journey: { id: journeyId, title: 'Venice' },+ date: DAY,+ fresh: true,+ audience: 2,+ });++ const res = await takeOver({+ groups: [+ {+ kind: 'merged',+ stays: [{ suggestionId: first }, { suggestionId: second }],+ title: 'Morning on San Marco',+ anchorSuggestionId: second,+ },+ ],+ skipSuggestionIds: [parking],+ });++ expect(res.status).toBe(200);+ expect(res.body).toEqual({+ entries: [{ id: expect.any(Number), title: 'Morning on San Marco', stayCount: 2 }],+ alreadyTaken: [],+ skipped: [parking],+ });+ expect(await findRows(orm, JourneyEntries, { journey: journeyId })).toEqual([+ expect.objectContaining({ title: 'Morning on San Marco', is_draft: 1, entry_time: '09:10' }),+ ]);+ expect(await countRows(orm, JourneyEntryStays)).toBe(2);+ expect(realtime.broadcastToUserMock).toHaveBeenCalledWith(+ VIEWER,+ expect.objectContaining({ type: 'journey:entry:created', journeyId }),+ '11',+ );++ const after = await review();+ expect((after.body.stays as Array<{ status: string }>).map((stay) => stay.status)).toEqual([+ 'skipped',+ 'here',+ 'here',+ ]);+ });++ it('sending the same take-over again writes nothing twice', async () => {+ const [, first] = await reviewedIds();+ const body = { groups: [{ kind: 'single', stays: [{ suggestionId: first }] }] };+ expect((await takeOver(body)).status).toBe(200);++ const again = await takeOver(body);++ expect(again.status).toBe(200);+ expect(again.body).toEqual({ entries: [], alreadyTaken: [first], skipped: [] });+ expect(await countRows(orm, JourneyEntries, { journey: journeyId })).toBe(1);+ });++ it("refuses a viewer, a stay that is not the caller's and a group the contract refuses, writing nothing", async () => {+ const [, first] = await reviewedIds();+ const [, theirs] = await reviewedIds(EDITOR);++ expect((await review(VIEWER)).status).toBe(403);+ const foreign = await takeOver({ groups: [{ kind: 'single', stays: [{ suggestionId: theirs }] }] });+ expect(foreign.status).toBe(404);+ expect(foreign.body).toEqual({ error: 'A stay is not one of yours on that day', code: 'stay_not_on_day' });+ const twice = await takeOver({+ groups: [+ { kind: 'single', stays: [{ suggestionId: first }] },+ { kind: 'single', stays: [{ suggestionId: first }] },+ ],+ });+ expect(twice.status).toBe(400);+ expect(+ (await request(server).post(`/api/journeys/${journeyId}/recordings/2026-02-30/stays/review`).set(as(OWNER)))+ .status,+ ).toBe(400);+ expect(await countRows(orm, JourneyEntries)).toBe(0);+ });+});diff --git a/server/tests/unit/db/entities-index.test.ts b/server/tests/unit/db/entities-index.test.tsindex 59717ede3..8b1064d94 100644--- a/server/tests/unit/db/entities-index.test.ts+++ b/server/tests/unit/db/entities-index.test.ts@@ -47,14 +47,15 @@ describe('ALL_ENTITIES', () => {* + collection_tours, the whole tours a collection keeps* + tour_packing_links, the packing list or category a tour points at* + tour_source_hints, what the wanderer watch found about a snapshot's source- * + journey_recorded_days, the recorded route a journey keeps per day)+ * + journey_recorded_days, the recorded route a journey keeps per day+ * + journey_entry_stays, the recorded stays a journey entry was taken over from)* is registered, and no two share a class name (a silent duplicate would* shadow one of them in `orm.getMetadata()`, exactly the kind of drift* `entity-schema-parity.test.ts` can't see — it iterates the metadata map,* which de-duplicates by class name).*/- it('ENT-003: exactly 150 entities, every class name unique', () => {- expect(ALL_ENTITIES.length).toBe(150);+ it('ENT-003: exactly 151 entities, every class name unique', () => {+ expect(ALL_ENTITIES.length).toBe(151);const names = ALL_ENTITIES.map((s) => s.meta.className);expect(new Set(names).size).toBe(names.length);});diff --git a/server/tests/unit/db/entity-class-fields.test.ts b/server/tests/unit/db/entity-class-fields.test.tsindex 07abe663a..556957b01 100644--- a/server/tests/unit/db/entity-class-fields.test.ts+++ b/server/tests/unit/db/entity-class-fields.test.ts@@ -45,7 +45,9 @@ import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest';// + tour_source_hints: user_id (a hint is only ever written for the user whose snapshot it is about).// + journey_recorded_days: id, journey_id, local_date, source_kind, utc_offset_minutes, window_from,// window_to, segments, point_count, content_hash, fetched_at (a kept day is only ever written whole).-const KNOWN_UNINITIALISED_NOT_NULL_SCALARS = 530;+// + journey_entry_stays: id, journey_id, entry_id, source_visit_id, name, started_at, ended_at (a stay is+// only ever written whole, by the take-over of its day).+const KNOWN_UNINITIALISED_NOT_NULL_SCALARS = 537;describe('entity class fields never carry a NaN initialiser (task-4-review-shape.md, Important 1)', () => {it('CLASSFIELD-001: new X() has no own property whose value is NaN, across all 133 entities', () => {diff --git a/server/tests/unit/db/legacy-baseline.test.ts b/server/tests/unit/db/legacy-baseline.test.tsindex b2c20da83..955d19d05 100644--- a/server/tests/unit/db/legacy-baseline.test.ts+++ b/server/tests/unit/db/legacy-baseline.test.ts@@ -83,6 +83,7 @@ const UNNUMBERED = ['Migration20200101046140_tours_are_on_for_every_install','Migration20200101046150_a_ski_tour_keeps_its_piste_router_options','Migration20200101046160_a_journey_keeps_its_recorded_days',+ 'Migration20200101046170_a_journey_entry_remembers_the_stays_it_came_from',];// The last step the positional runner ever had; planLegacyBaseline refuses a// schema_version past it.diff --git a/server/tests/unit/db/repositories/DawarichVisitSuggestions.repository.test.ts b/server/tests/unit/db/repositories/DawarichVisitSuggestions.repository.test.tsindex 23fb6c920..4e310e2e7 100644--- a/server/tests/unit/db/repositories/DawarichVisitSuggestions.repository.test.ts+++ b/server/tests/unit/db/repositories/DawarichVisitSuggestions.repository.test.ts@@ -152,6 +152,20 @@ describe('DawarichVisitSuggestionsRepository', () => {expect(rows[0].matched_bucket_name).toBe('Wish');});+ it('DVSREPO-080: one day of one person, in the order the stays were lived (JRN-02)', async () => {+ const { user } = createUser(testDb);+ const { user: stranger } = createUser(testDb);+ const later = await seed(user.id, { local_date: '2026-09-01', started_at: '2026-09-01T15:00:00+02:00' });+ const earlier = await seed(user.id, { local_date: '2026-09-01', started_at: '2026-09-01T09:00:00+02:00' });+ await seed(user.id, { local_date: '2026-09-02' });+ await seed(stranger.id, { local_date: '2026-09-01' });++ const rows = await suggestions.listForDay(user.id, '2026-09-01');+ expect(rows.map((row) => row.id)).toEqual([earlier, later]);+ expect(rows[0]).toMatchObject({ trip_title: null, matched_bucket_name: null });+ expect(await suggestions.listForDay(user.id, '2026-09-03')).toEqual([]);+ });+it("DVSREPO-002: scoped by user_id — a stranger's row never appears", async () => {const { user } = createUser(testDb);const { user: stranger } = createUser(testDb);diff --git a/server/tests/unit/db/repositories/JourneyEntryStays.repository.test.ts b/server/tests/unit/db/repositories/JourneyEntryStays.repository.test.tsnew file mode 100644index 000000000..4a7c26258--- /dev/null+++ b/server/tests/unit/db/repositories/JourneyEntryStays.repository.test.ts@@ -0,0 +1,140 @@+/**+ * `JourneyEntryStaysRepository` (JRN-02): the stays an entry was taken over+ * from, written together, read back as the ledger of one person's stays in+ * one journey with the entry holding each, unique per journey, source, person+ * and visit, gone with their entry and kept past the account they came from.+ */+import { JourneyEntries } from '../../../../src/db/entities/JourneyEntries.entity';+import { JourneyEntryStays } from '../../../../src/db/entities/JourneyEntryStays.entity';+import { Users } from '../../../../src/db/entities/Users.entity';+import type {+ JourneyEntryStaysRepository,+ JourneyEntryStayWrite,+} from '../../../../src/db/repositories/JourneyEntryStays.repository';+import { createSnapshotTestDb } from '../../../helpers/db-mock';+import { makeJourney } from '../../../helpers/factories/journeys';+import { countRows, deleteRows, findRows, insertRow } from '../../../helpers/factories/rows';+import { makeUser } from '../../../helpers/factories/users';+import { resetTestDb } from '../../../helpers/test-db';+import { createTestOrm, type TestOrm } from '../../../helpers/test-orm';++import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest';++const testDb = createSnapshotTestDb();+let t: TestOrm;+let stays: JourneyEntryStaysRepository;++beforeAll(async () => {+ t = await createTestOrm(testDb);+ stays = t.repo(JourneyEntryStays);+});+beforeEach(() => {+ resetTestDb(testDb);+ t.clear();+});+afterAll(async () => {+ await t.close();+ testDb.close();+});++async function journeyWithEntry(title = 'Venice') {+ const { user } = await makeUser(t, { username: 'marta' });+ const journey = await makeJourney(t, user.id);+ const entryId = await entry(journey.id, user.id, title);+ return { user, journey, entryId };+}++function entry(journeyId: number, authorId: number, title: string) {+ return insertRow(t, JourneyEntries, {+ journey: journeyId,+ author: authorId,+ type: 'entry',+ title,+ entry_date: '2026-05-14',+ created_at: 0,+ updated_at: 0,+ });+}++function stay(+ journeyId: number,+ entryId: number,+ userId: number,+ overrides: Partial<JourneyEntryStayWrite> = {},+): JourneyEntryStayWrite {+ return {+ journey_id: journeyId,+ entry_id: entryId,+ source: 'dawarich',+ source_visit_id: '101',+ name: 'Piazza San Marco',+ lat: 45.434,+ lng: 12.3388,+ started_at: '2026-05-14T09:10:00+02:00',+ ended_at: '2026-05-14T10:05:00+02:00',+ duration_minutes: 55,+ sort_order: 0,+ user_id: userId,+ ...overrides,+ };+}++describe('JourneyEntryStaysRepository', () => {+ it('JESTAYS-001: writes the stays of an entry together and reads which of them the journey holds', async () => {+ const { user, journey, entryId } = await journeyWithEntry('Morning in San Marco');+ await stays.insertStays([+ stay(journey.id, entryId, user.id),+ stay(journey.id, entryId, user.id, { source_visit_id: '102', name: 'Rialto', sort_order: 1 }),+ ]);++ const held = await stays.listHeld(journey.id, user.id, 'dawarich', ['101', '102', '103']);+ expect(held).toHaveLength(2);+ expect(held).toEqual(+ expect.arrayContaining([+ { source_visit_id: '101', entry_id: entryId, entry_title: 'Morning in San Marco' },+ { source_visit_id: '102', entry_id: entryId, entry_title: 'Morning in San Marco' },+ ]),+ );+ expect(await findRows(t, JourneyEntryStays, { entry: entryId })).toHaveLength(2);+ });++ it('JESTAYS-002: the ledger is per person, journey and source, and an empty ask reads nothing', async () => {+ const { user, journey, entryId } = await journeyWithEntry();+ const { user: editor } = await makeUser(t);+ const other = await makeJourney(t, user.id);+ await stays.insertStays([stay(journey.id, entryId, user.id)]);++ expect(await stays.listHeld(journey.id, editor.id, 'dawarich', ['101'])).toEqual([]);+ expect(await stays.listHeld(other.id, user.id, 'dawarich', ['101'])).toEqual([]);+ expect(await stays.listHeld(journey.id, user.id, 'other', ['101'])).toEqual([]);+ expect(await stays.listHeld(journey.id, user.id, 'dawarich', [])).toEqual([]);+ await stays.insertStays([]);+ expect(await countRows(t, JourneyEntryStays, {})).toBe(1);+ });++ it('JESTAYS-003: the same stay of the same person lands in a journey once; another person may hold the same visit id', async () => {+ const { user, journey, entryId } = await journeyWithEntry();+ const { user: editor } = await makeUser(t);+ await stays.insertStays([stay(journey.id, entryId, user.id)]);++ await expect(stays.insertStays([stay(journey.id, entryId, user.id)])).rejects.toThrow();+ await stays.insertStays([stay(journey.id, entryId, editor.id)]);+ expect(await countRows(t, JourneyEntryStays, {})).toBe(2);+ });++ it('JESTAYS-004: the stays go with their entry and outlive the account they came from', async () => {+ const { user, journey, entryId } = await journeyWithEntry();+ const { user: editor } = await makeUser(t);+ const second = await entry(journey.id, user.id, 'Afternoon');+ await stays.insertStays([+ stay(journey.id, entryId, editor.id),+ stay(journey.id, second, user.id, { source_visit_id: '200' }),+ ]);++ await deleteRows(t, Users, { id: editor.id });+ expect(await countRows(t, JourneyEntryStays, { entry: entryId, user: null })).toBe(1);++ await deleteRows(t, JourneyEntries, { id: second });+ expect(await countRows(t, JourneyEntryStays, {})).toBe(1);+ });+});diff --git a/server/tests/unit/nest/dawarich-suggestions.service.test.ts b/server/tests/unit/nest/dawarich-suggestions.service.test.tsindex f22570b22..e2bff347f 100644--- a/server/tests/unit/nest/dawarich-suggestions.service.test.ts+++ b/server/tests/unit/nest/dawarich-suggestions.service.test.ts@@ -28,6 +28,7 @@ import { AcceptError, DawarichSuggestionsService } from '../../../src/nest/integimport type { DawarichClient } from '../../../src/nest/integrations/dawarich.client';import type { DawarichService } from '../../../src/nest/integrations/dawarich.service';import type { JourneyDomainService } from '../../../src/nest/journey/journey-domain.service';+import type { JourneyEntryStaysService } from '../../../src/nest/journey/journey-entry-stays.service';import type { PermissionsService } from '../../../src/nest/permissions/permissions.service';import type { PlacesService } from '../../../src/nest/places/places.service';import { createTestDawarichVisitSuggestionsRepo } from '../../helpers/dawarich-repos';@@ -96,6 +97,8 @@ const assignmentsStub = { dayExists: vi.fn(), createAssignment: vi.fn(), broadca// day_edit to the owner the way an admin would and watch a member be refused.const permissionsStub = { checkPermission: vi.fn() };const journeyStub = { canEdit: vi.fn(), createEntry: vi.fn() };+// The stay an entry was taken over from is recorded on it (JRN-02); its own suite has the rows.+const journeyStaysStub = { record: vi.fn() };let t: TestOrm;let suggestions: DawarichVisitSuggestionsRepository;@@ -124,6 +127,7 @@ beforeAll(async () => {assignmentsStub as unknown as AssignmentsService,permissionsStub as unknown as PermissionsService,journeyStub as unknown as JourneyDomainService,+ journeyStaysStub as unknown as JourneyEntryStaysService,trips,placesRepo,bucketList,@@ -182,6 +186,7 @@ function armStubs(): void {permissionsStub.checkPermission.mockReset().mockReturnValue(true);journeyStub.canEdit.mockReset().mockReturnValue(true);journeyStub.createEntry.mockReset().mockReturnValue({ id: CREATED_ENTRY_ID });+ journeyStaysStub.record.mockReset();}// ── Fixtures ─────────────────────────────────────────────────────────────────@@ -642,6 +647,37 @@ describe('DawarichSuggestionsService — accepting into a journey', () => {expect(row.accepted_journal_entry_id).toBe(CREATED_ENTRY_ID);});+ it('DAWARICH-SUG-066: the stay is recorded on its entry, so taking its day over later finds it', async () => {+ const { user } = createUser(testDb);+ const id = await seedSuggestion({ userId: user.id, name: 'Cafe Central' });+ journeyStub.createEntry.mockReturnValue({ id: CREATED_ENTRY_ID, journey_id: 88 });++ await svc.accept(user.id, id, { target: 'journal', journalId: 88, name: 'Coffee' });++ const row = await rowOf(id);+ expect(journeyStaysStub.record).toHaveBeenCalledWith(88, CREATED_ENTRY_ID, user.id, [+ {+ sourceVisitId: row.source_visit_id,+ name: 'Coffee',+ lat: 48.2092,+ lng: 16.3658,+ startedAt: row.started_at,+ endedAt: row.ended_at,+ durationMinutes: row.duration_minutes,+ },+ ]);+ });++ it('DAWARICH-SUG-067: a stay that cannot be recorded leaves no entry accepted and the suggestion in review', async () => {+ const { user } = createUser(testDb);+ const id = await seedSuggestion({ userId: user.id });+ journeyStaysStub.record.mockRejectedValue(new Error('constraint'));++ await expect(svc.accept(user.id, id, { target: 'journal', journalId: 88 })).rejects.toThrow('constraint');++ expect((await rowOf(id)).state).toBe('new');+ });+it('DAWARICH-SUG-012: a journey id missing from the body is a 400, not a guess', async () => {const { user } = createUser(testDb);const id = await seedSuggestion({ userId: user.id });diff --git a/server/tests/unit/nest/dawarich-sync.service.test.ts b/server/tests/unit/nest/dawarich-sync.service.test.tsindex 40deae9bc..cc1fb3c3e 100644--- a/server/tests/unit/nest/dawarich-sync.service.test.ts+++ b/server/tests/unit/nest/dawarich-sync.service.test.ts@@ -1204,3 +1204,70 @@ describe('DawarichSyncService — runSync', () => {await first;});});++// ── One day read again (JRN-02) ──────────────────────────────────────────────++describe('DawarichSyncService — refreshing one day', () => {+ const CREDS: DawarichCreds = { baseUrl: 'https://dawarich.test', apiKey: 'secret-key', allowInsecureTls: false };++ it('DAWARICH-SYNC-080: asks a window a day past both sides and files a new stay under the trip that holds it', async () => {+ withVisits(visit({ id: 801, name: 'Museumsinsel' }));++ const result = await svc.refreshDay(USER, CREDS, VISIT_DAY);++ const [, from, to] = listVisits.mock.calls[0] as unknown as [DawarichCreds, Date, Date];+ expect(from.toISOString().slice(0, 10)).toBe(dayOffset(-29));+ expect(to.toISOString().slice(0, 10)).toBe(dayOffset(-26));+ expect(result).toEqual({ truncated: false });+ expect(await only()).toMatchObject({ source_visit_id: '801', name: 'Museumsinsel', trip_id: TRIP, state: 'new' });+ });++ it('DAWARICH-SYNC-081: a stay on a day no trip holds is kept without one, and nothing the day does not list is removed', async () => {+ const lonelyDay = dayOffset(-10);+ await seedSuggestion({+ source_visit_id: '900',+ trip: TRIP,+ name: 'Gone from the source',+ lat: LAT,+ lng: LNG,+ started_at: `${lonelyDay}T08:00:00Z`,+ ended_at: `${lonelyDay}T08:30:00Z`,+ duration_minutes: 30,+ local_date: lonelyDay,+ state: 'new',+ source_hash: 'old',+ });+ listVisits.mockResolvedValue({+ visits: [visit({ id: 901, started_at: `${lonelyDay}T10:00:00Z`, ended_at: `${lonelyDay}T11:00:00Z` })],+ truncated: true,+ version: null,+ });++ const result = await svc.refreshDay(USER, CREDS, lonelyDay);++ expect(result).toEqual({ truncated: true });+ expect((await rows()).map((row) => [row.source_visit_id, row.trip_id])).toEqual([+ ['900', TRIP],+ ['901', null],+ ]);+ });++ it('DAWARICH-SYNC-082: an accepted stay keeps what the traveller agreed to and only learns that the source changed', async () => {+ withVisits(visit({ id: 802, name: 'Before' }));+ await svc.refreshDay(USER, CREDS, VISIT_DAY);+ const before = await only();+ await updateRows(+ t,+ DawarichVisitSuggestions,+ { id: before.id },+ { state: 'accepted', accepted_hash: before.source_hash },+ );++ withVisits(visit({ id: 802, name: 'After' }));+ await svc.refreshDay(USER, CREDS, VISIT_DAY);++ const after = await only();+ expect(after).toMatchObject({ name: 'Before', state: 'accepted' });+ expect(after.source_hash).not.toBe(before.source_hash);+ });+});diff --git a/server/tests/unit/nest/journey-day-import.controller.test.ts b/server/tests/unit/nest/journey-day-import.controller.test.tsnew file mode 100644index 000000000..8955d9fd8--- /dev/null+++ b/server/tests/unit/nest/journey-day-import.controller.test.ts@@ -0,0 +1,82 @@+/**+ * JourneyDayImportController (JRN-02): the routes of a recorded day taken into+ * a journey with its stays, their guards, the date check it makes before the+ * service is asked, and what it hands the service and answers.+ */+import 'reflect-metadata';++import { AddonGuard } from '../../../src/nest/addons/addon.guard';+import { REQUIRE_ADDON } from '../../../src/nest/addons/require-addon.decorator';+import { JwtAuthGuard } from '../../../src/nest/auth-core/jwt-auth.guard';+import { JourneyDayImportController } from '../../../src/nest/journey-recordings/journey-day-import.controller';+import type { JourneyDayImportService } from '../../../src/nest/journey-recordings/journey-day-import.service';+import type { User } from '../../../src/types';+import { HttpException, RequestMethod } from '@nestjs/common';+import { GUARDS_METADATA, HTTP_CODE_METADATA, METHOD_METADATA, PATH_METADATA } from '@nestjs/common/constants';++import { describe, expect, it, vi } from 'vitest';++const user = { id: 4 } as User;++function controllerWith() {+ const service = {+ review: vi.fn(async () => ({ date: '2026-05-14', stays: [] })),+ takeOver: vi.fn(async () => ({ entries: [], alreadyTaken: [], skipped: [] })),+ };+ return {+ service,+ controller: new JourneyDayImportController(service as unknown as JourneyDayImportService),+ };+}++describe('JourneyDayImportController', () => {+ it('JRNDAY-CTL-001: sits behind the Journey addon before auth, both POSTs answering 200', () => {+ expect(Reflect.getMetadata(PATH_METADATA, JourneyDayImportController)).toBe('api/journeys/:id/recordings');+ expect(Reflect.getMetadata(GUARDS_METADATA, JourneyDayImportController)).toEqual([AddonGuard, JwtAuthGuard]);+ expect(Reflect.getMetadata(REQUIRE_ADDON, JourneyDayImportController)).toEqual({+ addonId: 'journey',+ label: 'Journey',+ });+ const routes = [+ ['review', ':date/stays/review'],+ ['takeOver', ':date/stays/import'],+ ] as const;+ for (const [handler, path] of routes) {+ const fn = JourneyDayImportController.prototype[handler];+ expect(Reflect.getMetadata(METHOD_METADATA, fn)).toBe(RequestMethod.POST);+ expect(Reflect.getMetadata(PATH_METADATA, fn)).toBe(path);+ expect(Reflect.getMetadata(HTTP_CODE_METADATA, fn)).toBe(200);+ }+ });++ it('JRNDAY-CTL-002: hands the caller, the journey, the day, the body and the socket id to the service', async () => {+ const { service, controller } = controllerWith();++ expect(await controller.review(user, '9', '2026-05-14')).toEqual({ date: '2026-05-14', stays: [] });+ expect(service.review).toHaveBeenCalledExactlyOnceWith(4, 9, '2026-05-14');++ const body = { groups: [{ kind: 'single' as const, stays: [{ suggestionId: 3 }] }], skipSuggestionIds: [5] };+ expect(await controller.takeOver(user, '9', '2026-05-14', body, 'sock-1')).toEqual({+ entries: [],+ alreadyTaken: [],+ skipped: [],+ });+ expect(service.takeOver).toHaveBeenCalledExactlyOnceWith(4, 9, '2026-05-14', body, 'sock-1');+ });++ it('JRNDAY-CTL-003: a day that is no calendar day is a 400 before the service is asked', async () => {+ const { service, controller } = controllerWith();+ const refusals = await Promise.all(+ ['2026-02-30', 'today'].map((date) => controller.review(user, '9', date).catch((e: unknown) => e)),+ );+ for (const err of refusals) {+ expect(err).toBeInstanceOf(HttpException);+ expect((err as HttpException).getResponse()).toEqual({ error: 'Invalid date' });+ }+ await expect(+ controller.takeOver(user, '9', 'nope', { groups: [{ kind: 'single', stays: [{ suggestionId: 1 }] }] }),+ ).rejects.toBeInstanceOf(HttpException);+ expect(service.review).not.toHaveBeenCalled();+ expect(service.takeOver).not.toHaveBeenCalled();+ });+});diff --git a/server/tests/unit/nest/journey-day-import.mcp.test.ts b/server/tests/unit/nest/journey-day-import.mcp.test.tsnew file mode 100644index 000000000..0e24c341a--- /dev/null+++ b/server/tests/unit/nest/journey-day-import.mcp.test.ts@@ -0,0 +1,174 @@+/**+ * JourneyDayImportMcp (JRN-02): a recorded day taken into a journey with its+ * stays over MCP, on the same service, refusals and journey access as REST.+ * The suite takes its subject from the container over a snapshot test db;+ * only the caller's Dawarich connection and the visits it answers are replaced.+ */+import { DawarichVisitSuggestions } from '../../../src/db/entities/DawarichVisitSuggestions.entity';+import { JourneyEntries } from '../../../src/db/entities/JourneyEntries.entity';+import type { McpContext } from '../../../src/nest-mcp';+import { getEntry, type ClassRef } from '../../../src/nest-mcp/metadata';+import { AddonsService } from '../../../src/nest/addons/addons.service';+import { DawarichClient, type DawarichVisitRaw } from '../../../src/nest/integrations/dawarich.client';+import { DawarichService } from '../../../src/nest/integrations/dawarich.service';+import { JourneyDayImportMcp } from '../../../src/nest/journey-recordings/journey-day-import.mcp';+import { JourneyRecordingsModule } from '../../../src/nest/journey-recordings/journey-recordings.module';+import { createSnapshotTestDb } from '../../helpers/db-mock';+import { addJourneyContributor, makeJourney } from '../../helpers/factories/journeys';+import { countRows, findRows } from '../../helpers/factories/rows';+import { setAddonEnabled } from '../../helpers/factories/settings';+import { makeUser } from '../../helpers/factories/users';+import { resetTestDb } from '../../helpers/test-db';+import { createTestModule, type TestModule } from '../../helpers/test-module';+import { createTestOrm, type TestOrm } from '../../helpers/test-orm';++import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';++const db = createSnapshotTestDb();+const listVisits = vi.fn();+let t: TestModule;+let orm: TestOrm;+let mcp: JourneyDayImportMcp;++beforeAll(async () => {+ t = await createTestModule({+ db,+ imports: [JourneyRecordingsModule],+ overrides: [+ { provide: DawarichClient, useValue: { listVisits } },+ {+ provide: DawarichService,+ useValue: {+ getCredentials: async () => ({+ baseUrl: 'https://dawarich.example.com',+ apiKey: 'k',+ allowInsecureTls: false,+ }),+ getConnection: async () => ({ lastSyncAt: null }),+ },+ },+ ],+ });+ mcp = t.get(JourneyDayImportMcp);+ orm = await createTestOrm(db);+});+beforeEach(async () => {+ resetTestDb(db);+ orm.clear();+ vi.restoreAllMocks();+ listVisits.mockReset();+ await setAddonEnabled(orm, 'journey', true);+ await setAddonEnabled(orm, 'dawarich', true);+});+afterAll(async () => {+ await orm.close();+ await t.close();+ db.close();+});++const ctx = (userId: number) => ({ userId }) as McpContext;+const DAY = '2026-05-14';++function read(result: { content: Array<{ type: string; text: string }>; isError?: boolean }) {+ const text = result.content[0]?.text ?? '';+ return result.isError ? { error: text } : JSON.parse(text);+}++function visit(id: number, name: string, from: string, to: string): DawarichVisitRaw {+ return {+ id,+ area_id: null,+ started_at: `${DAY}T${from}:00+02:00`,+ ended_at: `${DAY}T${to}:00+02:00`,+ duration: null,+ name,+ status: 'confirmed',+ confidence: null,+ confidence_band: null,+ place: { latitude: 45.434, longitude: 12.3388, id: null },+ };+}++async function fixture() {+ const { user: owner } = await makeUser(orm);+ const { user: viewer } = await makeUser(orm);+ const journey = await makeJourney(orm, owner.id, { title: 'Venice' });+ await addJourneyContributor(orm, journey.id, viewer.id, 'viewer');+ listVisits.mockResolvedValue({+ visits: [visit(101, 'Piazza San Marco', '09:10', '10:05'), visit(102, 'Rialto', '13:00', '13:30')],+ truncated: false,+ });+ return { owner, viewer, journey };+}++describe('JourneyDayImportMcp', () => {+ it('JRNDAY-MCP-001: reviews the day and takes a stay over as a draft, the other one left out', async () => {+ const f = await fixture();++ const review = read(await mcp.reviewDayStays({ journeyId: f.journey.id, date: DAY }, ctx(f.owner.id)));+ expect(review).toMatchObject({ journey: { id: f.journey.id, title: 'Venice' }, fresh: true, audience: 1 });+ const [markus, rialto] = review.stays as Array<{ suggestionId: number; status: string }>;+ expect([markus?.status, rialto?.status]).toEqual(['open', 'open']);++ const result = read(+ await mcp.takeOverDayStays(+ {+ journeyId: f.journey.id,+ date: DAY,+ groups: [{ kind: 'single', stays: [{ suggestionId: markus?.suggestionId ?? 0, name: 'San Marco' }] }],+ skipSuggestionIds: [rialto?.suggestionId ?? 0],+ },+ ctx(f.owner.id),+ ),+ );+ expect(result).toMatchObject({ entries: [{ title: 'San Marco', stayCount: 1 }], alreadyTaken: [] });+ expect(await findRows(orm, JourneyEntries, { journey: f.journey.id })).toEqual([+ expect.objectContaining({ title: 'San Marco', is_draft: 1 }),+ ]);+ expect((await findRows(orm, DawarichVisitSuggestions, { state: 'dismissed' })).map((row) => row.name)).toEqual([+ 'Rialto',+ ]);+ });++ it('JRNDAY-MCP-002: refuses what REST refuses: a viewer reviews nothing, a malformed group writes nothing', async () => {+ const f = await fixture();+ await expect(mcp.reviewDayStays({ journeyId: f.journey.id, date: DAY }, ctx(f.viewer.id))).rejects.toThrow(+ 'Not allowed',+ );+ await mcp.reviewDayStays({ journeyId: f.journey.id, date: DAY }, ctx(f.owner.id));+ const [first] = await findRows(orm, DawarichVisitSuggestions, { user: f.owner.id });++ await expect(+ mcp.takeOverDayStays(+ {+ journeyId: f.journey.id,+ date: DAY,+ groups: [{ kind: 'report', stays: [{ suggestionId: first?.id ?? 0 }], title: 'Day' }],+ },+ ctx(f.owner.id),+ ),+ ).rejects.toThrow('This take-over cannot be written');+ expect(await countRows(orm, JourneyEntries, {})).toBe(0);+ });++ it('JRNDAY-MCP-003: both tools need the Journey and the Dawarich addon; reviewing reads, taking over writes', async () => {+ const options = (name: string) => {+ const entry = getEntry(JourneyDayImportMcp as unknown as ClassRef, name);+ if (entry?.kind !== 'tool') throw new Error(`${name} is no tool`);+ return entry.options;+ };+ const enabled = vi.spyOn(t.get(AddonsService), 'isAddonEnabled').mockResolvedValue(true);+ const ALL = ['reviewDayStays', 'takeOverDayStays'];+ const gates = () => Promise.all(ALL.map((name) => options(name).when?.(ctx(1), mcp)));+ expect(await gates()).toEqual([true, true]);++ enabled.mockImplementation(async (id: string) => id !== 'dawarich');+ expect(await gates()).toEqual([false, false]);++ enabled.mockImplementation(async (id: string) => id !== 'journey');+ expect(await gates()).toEqual([false, false]);++ expect(options('reviewDayStays').access).toEqual({ group: 'journey', mode: 'read' });+ expect(options('takeOverDayStays').access).toEqual({ group: 'journey', mode: 'write' });+ });+});diff --git a/server/tests/unit/nest/journey-day-import.service.test.ts b/server/tests/unit/nest/journey-day-import.service.test.tsnew file mode 100644index 000000000..28022c91d--- /dev/null+++ b/server/tests/unit/nest/journey-day-import.service.test.ts@@ -0,0 +1,420 @@+/**+ * JourneyDayImportService (JRN-02): a recorded day reviewed with its stays and+ * taken into a journey as drafts. The suite takes the service from its module+ * over a snapshot test db; only the caller's Dawarich connection and the+ * visits it answers are replaced, so the stays it refreshes, the journey+ * access, the drafts, the stays they hold and the broadcasts are the real ones.+ *+ * What it pins: the review is about one day of the caller's own stays and+ * says where each stands for this journey; the take-over writes drafts (one+ * per stay, one per merged place, one day report), keeps every stay with its+ * place and times on its entry, marks the stays taken over or left out, and+ * announces the entries after the commit; a second take-over writes nothing+ * twice; a refusal or a failure on the way leaves nothing behind.+ */+import { DawarichVisitSuggestions } from '../../../src/db/entities/DawarichVisitSuggestions.entity';+import { JourneyEntries } from '../../../src/db/entities/JourneyEntries.entity';+import { JourneyEntryStays } from '../../../src/db/entities/JourneyEntryStays.entity';+import { DomainError } from '../../../src/nest/common/domain-error';+import { DawarichClient, DawarichError, type DawarichVisitRaw } from '../../../src/nest/integrations/dawarich.client';+import { DawarichService } from '../../../src/nest/integrations/dawarich.service';+import { JourneyDayImportService } from '../../../src/nest/journey-recordings/journey-day-import.service';+import { JourneyRecordingsModule } from '../../../src/nest/journey-recordings/journey-recordings.module';+import { JourneyEntryStaysService } from '../../../src/nest/journey/journey-entry-stays.service';+import { createSnapshotTestDb } from '../../helpers/db-mock';+import { addJourneyContributor, makeJourney, makeJourneyEntry } from '../../helpers/factories/journeys';+import { countRows, findRow, findRows, insertRow } from '../../helpers/factories/rows';+import { setAddonEnabled } from '../../helpers/factories/settings';+import { makeUser } from '../../helpers/factories/users';+import { resetTestDb } from '../../helpers/test-db';+import { createTestModule, type TestModule } from '../../helpers/test-module';+import { createTestOrm, type TestOrm } from '../../helpers/test-orm';++import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';++const db = createSnapshotTestDb();+const CREDS = { baseUrl: 'https://dawarich.example.com', apiKey: 'key', allowInsecureTls: false };+const listVisits = vi.fn<(...args: unknown[]) => Promise<{ visits: DawarichVisitRaw[]; truncated: boolean }>>();+const getCredentials = vi.fn();+const getConnection = vi.fn();+let t: TestModule;+let orm: TestOrm;+let svc: JourneyDayImportService;++beforeAll(async () => {+ t = await createTestModule({+ db,+ imports: [JourneyRecordingsModule],+ overrides: [+ { provide: DawarichClient, useValue: { listVisits } },+ { provide: DawarichService, useValue: { getCredentials, getConnection } },+ ],+ });+ svc = t.get(JourneyDayImportService);+ orm = await createTestOrm(db);+});+beforeEach(async () => {+ resetTestDb(db);+ orm.clear();+ t.realtime.reset();+ listVisits.mockReset().mockResolvedValue({ visits: [], truncated: false });+ getCredentials.mockReset().mockResolvedValue(CREDS);+ getConnection.mockReset().mockResolvedValue({ lastSyncAt: '2026-05-14T20:00:00Z' });+ await setAddonEnabled(orm, 'journey', true);+ await setAddonEnabled(orm, 'dawarich', true);+});+afterAll(async () => {+ await orm.close();+ await t.close();+ db.close();+});++const DAY = '2026-05-14';++function visit(id: number, name: string, from: string, to: string, lat = 45.434, lng = 12.3388): DawarichVisitRaw {+ return {+ id,+ area_id: null,+ started_at: `${DAY}T${from}:00+02:00`,+ ended_at: `${DAY}T${to}:00+02:00`,+ duration: null,+ name,+ status: 'suggested',+ confidence: 80,+ confidence_band: 'high',+ place: { latitude: lat, longitude: lng, id: null },+ };+}++/** A visit on the day after. */+function nextDay(id: number, name: string): DawarichVisitRaw {+ return {+ ...visit(id, name, '09:00', '10:00'),+ started_at: '2026-05-15T09:00:00+02:00',+ ended_at: '2026-05-15T10:00:00+02:00',+ };+}++const MARKUS_1 = visit(101, 'Piazza San Marco', '09:10', '10:05');+const MARKUS_2 = visit(102, 'Piazza San Marco', '10:20', '11:40', 45.4341, 12.3391);+const PARKING = visit(103, 'Parcheggio', '08:30', '08:40', 45.44, 12.31);+const RIALTO = visit(104, 'Rialto', '13:00', '13:30', 45.438, 12.3359);+const GIUDECCA = visit(105, 'Giudecca', '16:00', '17:30', 45.427, 12.325);+const ZATTERE = visit(106, 'Zattere', '18:00', '18:30', 45.4295, 12.3262);++async function fixture() {+ const { user: owner } = await makeUser(orm, { username: 'marta' });+ const { user: editor } = await makeUser(orm, { username: 'jonas' });+ const { user: viewer } = await makeUser(orm);+ const { user: outsider } = await makeUser(orm);+ const journey = await makeJourney(orm, owner.id, { title: 'Venice' });+ await addJourneyContributor(orm, journey.id, editor.id, 'editor');+ await addJourneyContributor(orm, journey.id, viewer.id, 'viewer');+ return { owner, editor, viewer, outsider, journey };+}++/** The suggestion rows the review brought in, by Dawarich visit id. */+async function staysOf(userId: number): Promise<Map<string, number>> {+ const rows = await findRows(orm, DawarichVisitSuggestions, { user: userId });+ return new Map(rows.map((row) => [row.source_visit_id, row.id]));+}++async function reviewed(userId: number, journeyId: number, visits: DawarichVisitRaw[]) {+ listVisits.mockResolvedValue({ visits, truncated: false });+ await svc.review(userId, journeyId, DAY);+ return await staysOf(userId);+}++async function refusal(promise: Promise<unknown>): Promise<{ status: number; body: Record<string, unknown> }> {+ const err = await promise.then(+ () => null,+ (e: unknown) => e,+ );+ expect(err).toBeInstanceOf(DomainError);+ return { status: (err as DomainError).getStatus(), body: (err as DomainError).toBody() };+}++function id(stays: Map<string, number>, visitId: number): number {+ const found = stays.get(String(visitId));+ if (found === undefined) throw new Error(`no stay for visit ${visitId}`);+ return found;+}++describe('JourneyDayImportService.review', () => {+ it("JRNDAY-SVC-001: reads the day from the caller's Dawarich and lists its stays in order with the day's entries", async () => {+ const f = await fixture();+ await makeJourneyEntry(orm, f.journey.id, f.owner.id, { title: 'Arrival', entry_date: DAY, entry_time: '08:00' });+ await makeJourneyEntry(orm, f.journey.id, f.owner.id, { title: 'Next day', entry_date: '2026-05-15' });+ listVisits.mockResolvedValue({ visits: [RIALTO, MARKUS_1, nextDay(200, 'Lido')], truncated: true });++ const review = await svc.review(f.owner.id, f.journey.id, DAY);++ const [, from, to] = listVisits.mock.calls[0] as [unknown, Date, Date];+ expect(from.toISOString()).toBe('2026-05-13T00:00:00.000Z');+ expect(to.toISOString()).toBe('2026-05-16T00:00:00.000Z');+ expect(review).toMatchObject({+ journey: { id: f.journey.id, title: 'Venice' },+ date: DAY,+ fresh: true,+ error: null,+ syncedAt: null,+ truncated: true,+ audience: 2,+ entries: [{ title: 'Arrival', entryTime: '08:00', isDraft: false }],+ });+ expect(review.stays.map((stay) => [stay.name, stay.status])).toEqual([+ ['Piazza San Marco', 'open'],+ ['Rialto', 'open'],+ ]);+ expect(review.stays[0]).toMatchObject({ lat: 45.434, lng: 12.3388, sourceStatus: 'suggested', entry: null });+ });++ it('JRNDAY-SVC-002: says which stays the journey holds, which were left out and which went elsewhere', async () => {+ const f = await fixture();+ const stays = await reviewed(f.owner.id, f.journey.id, [MARKUS_1, MARKUS_2, PARKING, RIALTO]);+ await svc.takeOver(f.owner.id, f.journey.id, DAY, {+ groups: [{ kind: 'single', stays: [{ suggestionId: id(stays, 101) }] }],+ skipSuggestionIds: [id(stays, 103)],+ });+ const handwritten = await insertRow(orm, JourneyEntries, {+ journey: f.journey.id,+ author: f.owner.id,+ type: 'entry',+ entry_date: DAY,+ created_at: 0,+ updated_at: 0,+ });+ // Accepted into another journal: the other journal's entry exists, so it stays accepted.+ const elsewhere = await makeJourney(orm, f.owner.id, { title: 'Italy, the sequel' });+ const theirEntry = await makeJourneyEntry(orm, elsewhere.id, f.owner.id, { entry_date: DAY });+ await orm.repo(DawarichVisitSuggestions).markAccepted(id(stays, 104), {+ target: 'journal',+ placeId: null,+ journalEntryId: theirEntry.id,+ bucketItemId: null,+ });++ const review = await svc.review(f.owner.id, f.journey.id, DAY);++ expect(Object.fromEntries(review.stays.map((stay) => [stay.suggestionId, stay.status]))).toEqual({+ [id(stays, 101)]: 'here',+ [id(stays, 102)]: 'open',+ [id(stays, 103)]: 'skipped',+ [id(stays, 104)]: 'elsewhere',+ });+ expect(review.stays.find((stay) => stay.status === 'here')?.entry).toEqual({+ id: expect.any(Number),+ title: 'Piazza San Marco',+ });+ expect(review.entries.map((entry) => entry.id)).toContain(handwritten);+ });++ it('JRNDAY-SVC-003: when Dawarich does not answer, shows the stays of the last sync and says why', async () => {+ const f = await fixture();+ await reviewed(f.owner.id, f.journey.id, [MARKUS_1]);+ listVisits.mockRejectedValue(new DawarichError('unreachable', 'down'));++ const review = await svc.review(f.owner.id, f.journey.id, DAY);++ expect(review).toMatchObject({ fresh: false, error: 'unreachable', syncedAt: '2026-05-14T20:00:00Z' });+ expect(review.stays.map((stay) => stay.name)).toEqual(['Piazza San Marco']);+ });++ it('JRNDAY-SVC-004: needs the right to edit the journey, the Dawarich addon and a connection', async () => {+ const f = await fixture();+ expect((await refusal(svc.review(f.viewer.id, f.journey.id, DAY))).status).toBe(403);+ expect((await refusal(svc.review(f.outsider.id, f.journey.id, DAY))).status).toBe(404);+ getCredentials.mockResolvedValue(null);+ expect(await refusal(svc.review(f.editor.id, f.journey.id, DAY))).toEqual({+ status: 409,+ body: { error: 'Dawarich is not connected', code: 'not_connected' },+ });+ await setAddonEnabled(orm, 'dawarich', false);+ expect((await refusal(svc.review(f.owner.id, f.journey.id, DAY))).body).toMatchObject({ code: 'addon_disabled' });+ expect(listVisits).not.toHaveBeenCalled();+ });+});++describe('JourneyDayImportService.takeOver', () => {+ it('JRNDAY-SVC-005: writes drafts for a renamed stay, a merged place and a day report, each holding its stays', async () => {+ const f = await fixture();+ const stays = await reviewed(f.owner.id, f.journey.id, [MARKUS_1, MARKUS_2, PARKING, RIALTO, GIUDECCA, ZATTERE]);++ const result = await svc.takeOver(f.owner.id, f.journey.id, DAY, {+ groups: [+ {+ kind: 'merged',+ stays: [{ suggestionId: id(stays, 102) }, { suggestionId: id(stays, 101) }],+ title: 'San Marco',+ anchorSuggestionId: id(stays, 102),+ },+ { kind: 'single', stays: [{ suggestionId: id(stays, 104), name: 'Ponte di Rialto' }] },+ {+ kind: 'report',+ stays: [{ suggestionId: id(stays, 106) }, { suggestionId: id(stays, 105) }],+ title: 'Evening',+ anchorSuggestionId: null,+ },+ ],+ skipSuggestionIds: [id(stays, 103)],+ });++ expect(result.entries.map((entry) => [entry.title, entry.stayCount])).toEqual([+ ['San Marco', 2],+ ['Ponte di Rialto', 1],+ ['Evening', 2],+ ]);+ expect(result).toMatchObject({ alreadyTaken: [], skipped: [id(stays, 103)] });++ const [merged, single, report] = await Promise.all(+ result.entries.map((entry) => findRow(orm, JourneyEntries, { id: entry.id })),+ );+ expect(merged).toMatchObject({+ is_draft: 1,+ entry_date: DAY,+ entry_time: '09:10',+ location_name: 'Piazza San Marco',+ location_lat: 45.4341,+ location_lng: 12.3391,+ });+ expect(single).toMatchObject({ is_draft: 1, title: 'Ponte di Rialto', location_name: 'Ponte di Rialto' });+ expect(report).toMatchObject({+ is_draft: 1,+ entry_time: '16:00',+ location_name: null,+ location_lat: null,+ story: '- 16:00-17:30 Giudecca\n- 18:00-18:30 Zattere',+ });++ const [mergedId = 0] = result.entries.map((entry) => entry.id);+ const kept = await findRows(orm, JourneyEntryStays, { entry: mergedId });+ kept.sort((a, b) => a.sort_order - b.sort_order);+ expect(kept.map((stay) => [stay.source_visit_id, stay.sort_order, stay.started_at])).toEqual([+ ['101', 0, `${DAY}T09:10:00+02:00`],+ ['102', 1, `${DAY}T10:20:00+02:00`],+ ]);+ const states = await findRows(orm, DawarichVisitSuggestions, { user: f.owner.id });+ expect(Object.fromEntries(states.map((row) => [row.source_visit_id, row.state]))).toEqual({+ '101': 'accepted',+ '102': 'accepted',+ '103': 'dismissed',+ '104': 'accepted',+ '105': 'accepted',+ '106': 'accepted',+ });+ const created = t.realtime.broadcastToUserMock.mock.calls.filter(+ ([userId, payload]) => userId === f.owner.id && payload.type === 'journey:entry:created',+ );+ expect(created).toHaveLength(3);+ });++ it('JRNDAY-SVC-006: taking the same day over again writes nothing twice and says what was held', async () => {+ const f = await fixture();+ const stays = await reviewed(f.owner.id, f.journey.id, [MARKUS_1, PARKING]);+ const request = {+ groups: [{ kind: 'single' as const, stays: [{ suggestionId: id(stays, 101) }] }],+ skipSuggestionIds: [id(stays, 103)],+ };+ await svc.takeOver(f.owner.id, f.journey.id, DAY, request);+ t.realtime.reset();++ const again = await svc.takeOver(f.owner.id, f.journey.id, DAY, request);++ expect(again).toEqual({ entries: [], alreadyTaken: [id(stays, 101)], skipped: [] });+ expect(await countRows(orm, JourneyEntries, { journey: f.journey.id })).toBe(1);+ expect(await countRows(orm, JourneyEntryStays, {})).toBe(1);+ expect(t.realtime.broadcastToUserMock).not.toHaveBeenCalled();+ });++ it("JRNDAY-SVC-007: refuses a stay that is not the caller's or not of that day, writing nothing", async () => {+ const f = await fixture();+ const own = await reviewed(f.owner.id, f.journey.id, [MARKUS_1]);+ const theirs = await reviewed(f.editor.id, f.journey.id, [RIALTO]);+ listVisits.mockResolvedValue({ visits: [nextDay(300, 'Murano')], truncated: false });+ await svc.review(f.owner.id, f.journey.id, '2026-05-15');+ const otherDay = await staysOf(f.owner.id);++ const attempt = (suggestionId: number) =>+ refusal(+ svc.takeOver(f.owner.id, f.journey.id, DAY, {+ groups: [+ { kind: 'single', stays: [{ suggestionId: id(own, 101) }] },+ { kind: 'single', stays: [{ suggestionId }] },+ ],+ }),+ );+ const notOnDay = {+ status: 404,+ body: { error: 'A stay is not one of yours on that day', code: 'stay_not_on_day' },+ };+ expect(await attempt(id(theirs, 104))).toEqual(notOnDay);+ expect(await attempt(id(otherDay, 300))).toEqual(notOnDay);+ expect(await countRows(orm, JourneyEntries, {})).toBe(0);+ expect(await countRows(orm, JourneyEntryStays, {})).toBe(0);+ });++ it('JRNDAY-SVC-008: a take-over the shared contract refuses is refused here too, for callers that spread its shape', async () => {+ const f = await fixture();+ const stays = await reviewed(f.owner.id, f.journey.id, [MARKUS_1, MARKUS_2]);+ const merged = {+ kind: 'merged' as const,+ stays: [{ suggestionId: id(stays, 101) }, { suggestionId: id(stays, 102) }],+ };+ expect(await refusal(svc.takeOver(f.owner.id, f.journey.id, DAY, { groups: [merged] }))).toEqual({+ status: 400,+ body: { error: 'This take-over cannot be written', code: 'group_needs_title' },+ });+ expect(+ (await refusal(svc.takeOver(f.viewer.id, f.journey.id, DAY, { groups: [{ ...merged, title: 'A' }] }))).status,+ ).toBe(403);+ });++ it('JRNDAY-SVC-009: a failure on the way leaves no draft, no stay and no announcement', async () => {+ const f = await fixture();+ const stays = await reviewed(f.owner.id, f.journey.id, [MARKUS_1, RIALTO]);+ const record = vi.spyOn(t.get(JourneyEntryStaysService), 'record').mockRejectedValueOnce(new Error('disk full'));++ await expect(+ svc.takeOver(f.owner.id, f.journey.id, DAY, {+ groups: [+ { kind: 'single', stays: [{ suggestionId: id(stays, 101) }] },+ { kind: 'single', stays: [{ suggestionId: id(stays, 104) }] },+ ],+ }),+ ).rejects.toThrow('disk full');++ record.mockRestore();+ expect(await countRows(orm, JourneyEntries, {})).toBe(0);+ expect(await countRows(orm, JourneyEntryStays, {})).toBe(0);+ expect((await findRows(orm, DawarichVisitSuggestions, { user: f.owner.id })).map((row) => row.state)).toEqual([+ 'new',+ 'new',+ ]);+ expect(t.realtime.broadcastToUserMock).not.toHaveBeenCalled();+ });++ it('JRNDAY-SVC-010: an editor takes their own stays over, and what the journal held stays as it was', async () => {+ const f = await fixture();+ const written = await makeJourneyEntry(orm, f.journey.id, f.owner.id, {+ title: 'Our day',+ story: 'Written by hand',+ entry_date: DAY,+ location_name: 'Hotel',+ });+ const stays = await reviewed(f.editor.id, f.journey.id, [RIALTO]);++ const result = await svc.takeOver(f.editor.id, f.journey.id, DAY, {+ groups: [{ kind: 'single', stays: [{ suggestionId: id(stays, 104) }] }],+ });++ expect(result.entries).toHaveLength(1);+ expect(await findRow(orm, JourneyEntries, { id: written.id })).toMatchObject({+ title: 'Our day',+ story: 'Written by hand',+ location_name: 'Hotel',+ is_draft: 0,+ });+ const [draftId = 0] = result.entries.map((entry) => entry.id);+ expect(await findRow(orm, JourneyEntries, { id: draftId })).toMatchObject({ author_id: f.editor.id, is_draft: 1 });+ });+});diff --git a/shared/src/i18n/ar/journey.ts b/shared/src/i18n/ar/journey.tsindex 9ab2bfc86..a39a74f19 100644--- a/shared/src/i18n/ar/journey.ts+++ b/shared/src/i18n/ar/journey.ts@@ -815,5 +815,91 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'قارب','journey.recording.mode.stationary': 'ثابت','journey.recording.mode.unknown': 'وسيلة غير معروفة',+ 'journey.dayImport.open': 'استيراد اليوم',+ 'journey.dayImport.openHint': 'استيراد هذا اليوم مع محطات توقفه',+ 'journey.dayImport.openOn': 'استيراد {date} مع محطات التوقف',+ 'journey.dayImport.pending': '{count} محطة توقف للمراجعة',+ 'journey.dayImport.pending.zero': 'لا محطات توقف للمراجعة',+ 'journey.dayImport.pending.one': 'محطة توقف واحدة للمراجعة',+ 'journey.dayImport.pending.two': 'محطتا توقف للمراجعة',+ 'journey.dayImport.pending.few': '{count} محطات توقف للمراجعة',+ 'journey.dayImport.pending.many': '{count} محطة توقف للمراجعة',+ 'journey.dayImport.sub': 'محطات توقفك من Dawarich في هذا اليوم. اخترها وأعد تسميتها وادمجها؛ لتصبح مسودات.',+ 'journey.dayImport.loading': 'جارٍ قراءة محطات توقف اليوم من Dawarich…',+ 'journey.dayImport.map': 'اليوم على الخريطة',+ 'journey.dayImport.stays': 'محطات التوقف',+ 'journey.dayImport.modeEntries': 'إدخالات',+ 'journey.dayImport.modeReport': 'تقرير اليوم',+ 'journey.dayImport.reportDefault': 'يوم {date}',+ 'journey.dayImport.reportHint':+ 'تصبح كل محطات التوقف المختارة إدخالًا واحدًا يسردها مع أوقاتها. يبقى كل مكان محفوظًا للخريطة.',+ 'journey.dayImport.reportNeedsTwo': 'اختر محطتي توقف أو أكثر لتقرير اليوم.',+ 'journey.dayImport.groupTitle': 'عنوان الإدخال',+ 'journey.dayImport.groupPin': 'الموقع على الخريطة',+ 'journey.dayImport.noPin': 'بلا موقع على الخريطة',+ 'journey.dayImport.join': 'دمج في إدخال واحد',+ 'journey.dayImport.split': 'إبقاؤها منفصلة',+ 'journey.dayImport.choose': 'استيراد {name}',+ 'journey.dayImport.name': 'اسم {name}',+ 'journey.dayImport.unconfirmed': 'غير مؤكدة',+ 'journey.dayImport.noPlace': 'بلا موقع',+ 'journey.dayImport.noPlaceHint': 'لم يسجّل Dawarich موقعًا لمحطة التوقف هذه، لذلك لا يظهر إدخالها على الخريطة.',+ 'journey.dayImport.statusHere': 'في {title}',+ 'journey.dayImport.statusHereUntitled': 'في اليوميات',+ 'journey.dayImport.statusElsewhere': 'مستوردة',+ 'journey.dayImport.statusElsewhereHint': 'سبق استيرادها كمكان أو أمنية أو إلى يوميات أخرى.',+ 'journey.dayImport.statusSkipped': 'مستبعدة',+ 'journey.dayImport.keepRoute': 'احفظ مسار اليوم أيضًا',+ 'journey.dayImport.keepRouteHint': 'تم تسجيل {distance}. يراه كل من في الرحلة على الخريطة.',+ 'journey.dayImport.routeNone': 'لم يسجّل Dawarich أي مسار في هذا اليوم.',+ 'journey.dayImport.routeKept': 'تم حفظ المسار',+ 'journey.dayImport.routeDiffers': 'لدى Dawarich الآن نسخة أخرى من المسار. استبدلها بزر مسار اليوم.',+ 'journey.dayImport.existing': 'موجود في هذا اليوم',+ 'journey.dayImport.untitled': 'إدخال بلا عنوان',+ 'journey.dayImport.draft': 'مسودة',+ 'journey.dayImport.audience': 'لا تظهر المسودات في الروابط المشتركة. يراها {count} شخص آخر في هذه الرحلة.',+ 'journey.dayImport.audience.zero': 'لا تظهر المسودات في الروابط المشتركة. لا يراها أحد آخر في هذه الرحلة.',+ 'journey.dayImport.audience.one': 'لا تظهر المسودات في الروابط المشتركة. يراها شخص آخر واحد في هذه الرحلة.',+ 'journey.dayImport.audience.two': 'لا تظهر المسودات في الروابط المشتركة. يراها شخصان آخران في هذه الرحلة.',+ 'journey.dayImport.audience.few': 'لا تظهر المسودات في الروابط المشتركة. يراها {count} أشخاص آخرين في هذه الرحلة.',+ 'journey.dayImport.audience.many': 'لا تظهر المسودات في الروابط المشتركة. يراها {count} شخصًا آخر في هذه الرحلة.',+ 'journey.dayImport.draftsNote': 'لا تظهر المسودات في الروابط المشتركة حتى تنشرها. أضف الصور والنص لاحقًا.',+ 'journey.dayImport.submit': 'استيراد {count} مسودة',+ 'journey.dayImport.submit.zero': 'لا مسودات للاستيراد',+ 'journey.dayImport.submit.one': 'استيراد مسودة واحدة',+ 'journey.dayImport.submit.two': 'استيراد مسودتين',+ 'journey.dayImport.submit.few': 'استيراد {count} مسودات',+ 'journey.dayImport.submit.many': 'استيراد {count} مسودة',+ 'journey.dayImport.skipped': '{count} مستبعدة',+ 'journey.dayImport.skipped.zero': 'لا شيء مستبعد',+ 'journey.dayImport.skipped.one': 'واحدة مستبعدة',+ 'journey.dayImport.skipped.two': 'اثنتان مستبعدتان',+ 'journey.dayImport.skipped.few': '{count} مستبعدات',+ 'journey.dayImport.skipped.many': '{count} مستبعدة',+ 'journey.dayImport.skipHint':+ 'لم تعد محطات التوقف المستبعدة معلّقة في هذا اليوم. يمكنك استعادتها من قائمة محطات توقف Dawarich.',+ 'journey.dayImport.problem.nothing': 'اختر محطة توقف واحدة على الأقل.',+ 'journey.dayImport.problem.name': 'تحتاج كل محطة توقف مختارة إلى اسم.',+ 'journey.dayImport.problem.title': 'يحتاج كل إدخال مدمج وتقرير اليوم إلى عنوان.',+ 'journey.dayImport.done': 'تم استيراد {count} مسودة',+ 'journey.dayImport.done.zero': 'لم تُستورد أي مسودة',+ 'journey.dayImport.done.one': 'تم استيراد مسودة واحدة',+ 'journey.dayImport.done.two': 'تم استيراد مسودتين',+ 'journey.dayImport.done.few': 'تم استيراد {count} مسودات',+ 'journey.dayImport.done.many': 'تم استيراد {count} مسودة',+ 'journey.dayImport.alreadyTaken': 'كانت {count} محطة توقف في اليوميات بالفعل. لم يُكتب شيء مرتين.',+ 'journey.dayImport.alreadyTaken.zero': 'لم تكن أي محطة توقف في اليوميات بالفعل. لم يُكتب شيء مرتين.',+ 'journey.dayImport.alreadyTaken.one': 'كانت محطة توقف واحدة في اليوميات بالفعل. لم يُكتب شيء مرتين.',+ 'journey.dayImport.alreadyTaken.two': 'كانت محطتا توقف في اليوميات بالفعل. لم يُكتب شيء مرتين.',+ 'journey.dayImport.alreadyTaken.few': 'كانت {count} محطات توقف في اليوميات بالفعل. لم يُكتب شيء مرتين.',+ 'journey.dayImport.alreadyTaken.many': 'كانت {count} محطة توقف في اليوميات بالفعل. لم يُكتب شيء مرتين.',+ 'journey.dayImport.failed':+ 'لم يُستورد شيء: {reason} تعرض القائمة ما تحتويه اليوميات الآن؛ المحاولة مجددًا لا تكتب شيئًا مرتين.',+ 'journey.dayImport.routeFailed': 'أُنشئت المسودات، لكن المسار لم يُحفظ: {reason}',+ 'journey.dayImport.routeRetry': 'احفظ المسار مجددًا',+ 'journey.dayImport.stale': 'لم يستجب Dawarich: {reason} تُعرض محطات التوقف من آخر مزامنة في {date}.',+ 'journey.dayImport.staleNever': 'لم يستجب Dawarich: {reason} تُعرض محطات التوقف التي يعرفها TREK بالفعل.',+ 'journey.dayImport.truncated': 'أرسل Dawarich جزءًا من هذا اليوم فقط. قد تكون بعض محطات التوقف مفقودة.',+ 'journey.dayImport.empty': 'لم يجد Dawarich أي محطات توقف في هذا اليوم.',};export default journey;diff --git a/shared/src/i18n/az/journey.ts b/shared/src/i18n/az/journey.tsindex 8e26295d9..faa715d87 100644--- a/shared/src/i18n/az/journey.ts+++ b/shared/src/i18n/az/journey.ts@@ -841,5 +841,73 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Qayıq','journey.recording.mode.stationary': 'Hərəkətsiz','journey.recording.mode.unknown': 'Naməlum növ',+ 'journey.dayImport.open': 'Günü köçür',+ 'journey.dayImport.openHint': 'Bu günü dayanacaqları ilə köçür',+ 'journey.dayImport.openOn': '{date} gününü dayanacaqları ilə köçür',+ 'journey.dayImport.pending': 'Yoxlanacaq {count} dayanacaq',+ 'journey.dayImport.pending.one': 'Yoxlanacaq {count} dayanacaq',+ 'journey.dayImport.sub': 'Bu gün Dawarich-dəki dayanacaqların. Seç, adını dəyiş və birləşdir; onlar qaralama olur.',+ 'journey.dayImport.loading': 'Günün dayanacaqları Dawarich-dən oxunur…',+ 'journey.dayImport.map': 'Gün xəritədə',+ 'journey.dayImport.stays': 'Dayanacaqlar',+ 'journey.dayImport.modeEntries': 'Qeydlər',+ 'journey.dayImport.modeReport': 'Gün hesabatı',+ 'journey.dayImport.reportDefault': '{date} günü',+ 'journey.dayImport.reportHint':+ 'Seçilmiş bütün dayanacaqlar onları vaxtları ilə sadalayan bir qeydə çevrilir. Hər yer xəritə üçün saxlanılır.',+ 'journey.dayImport.reportNeedsTwo': 'Gün hesabatı üçün iki və ya daha çox dayanacaq seç.',+ 'journey.dayImport.groupTitle': 'Qeydin başlığı',+ 'journey.dayImport.groupPin': 'Xəritədəki mövqe',+ 'journey.dayImport.noPin': 'Xəritədə mövqe yoxdur',+ 'journey.dayImport.join': 'Bir qeyddə birləşdir',+ 'journey.dayImport.split': 'Ayrı saxla',+ 'journey.dayImport.choose': '{name} köçür',+ 'journey.dayImport.name': '{name} adı',+ 'journey.dayImport.unconfirmed': 'Təsdiqlənməyib',+ 'journey.dayImport.noPlace': 'Mövqesiz',+ 'journey.dayImport.noPlaceHint':+ 'Dawarich bu dayanacaq üçün mövqe qeyd etməyib, ona görə də qeydi xəritədə görünmür.',+ 'journey.dayImport.statusHere': '{title} içində',+ 'journey.dayImport.statusHereUntitled': 'Gündəlikdə',+ 'journey.dayImport.statusElsewhere': 'Köçürülüb',+ 'journey.dayImport.statusElsewhereHint': 'Artıq yer, arzu kimi və ya başqa gündəliyə köçürülüb.',+ 'journey.dayImport.statusSkipped': 'Kənarda qalıb',+ 'journey.dayImport.keepRoute': 'Günün marşrutunu da saxla',+ 'journey.dayImport.keepRouteHint': '{distance} qeyd edilib. Səyahətdəki hər kəs onu xəritədə görür.',+ 'journey.dayImport.routeNone': 'Dawarich bu gün heç bir marşrut qeyd etməyib.',+ 'journey.dayImport.routeKept': 'Marşrut saxlanıb',+ 'journey.dayImport.routeDiffers':+ 'Dawarich-də indi marşrutun başqa versiyası var. Onu günün marşrut düyməsi ilə əvəz et.',+ 'journey.dayImport.existing': 'Artıq bu gündə',+ 'journey.dayImport.untitled': 'Başlıqsız qeyd',+ 'journey.dayImport.draft': 'Qaralama',+ 'journey.dayImport.audience':+ 'Qaralamalar paylaşılan keçidlərdə görünmür. Bu səyahətdə daha {count} nəfər onları görür.',+ 'journey.dayImport.audience.one':+ 'Qaralamalar paylaşılan keçidlərdə görünmür. Bu səyahətdə daha {count} nəfər onları görür.',+ 'journey.dayImport.draftsNote':+ 'Qaralamalar sən dərc edənə qədər paylaşılan keçidlərdə görünmür. Foto və mətni sonra əlavə et.',+ 'journey.dayImport.submit': '{count} qaralamanı köçür',+ 'journey.dayImport.submit.one': '{count} qaralamanı köçür',+ 'journey.dayImport.skipped': '{count} kənarda',+ 'journey.dayImport.skipped.one': '{count} kənarda',+ 'journey.dayImport.skipHint':+ 'Kənarda qoyduğun dayanacaqlar bu gündə artıq gözləmir. Onları Dawarich dayanacaq siyahısında bərpa edə bilərsən.',+ 'journey.dayImport.problem.nothing': 'Ən azı bir dayanacaq seç.',+ 'journey.dayImport.problem.name': 'Seçilmiş hər dayanacağın adı olmalıdır.',+ 'journey.dayImport.problem.title': 'Birləşdirilmiş hər qeydin və gün hesabatının başlığı olmalıdır.',+ 'journey.dayImport.done': '{count} qaralama köçürüldü',+ 'journey.dayImport.done.one': '{count} qaralama köçürüldü',+ 'journey.dayImport.alreadyTaken': '{count} dayanacaq artıq gündəlikdə idi. Heç nə iki dəfə yazılmadı.',+ 'journey.dayImport.alreadyTaken.one': '{count} dayanacaq artıq gündəlikdə idi. Heç nə iki dəfə yazılmadı.',+ 'journey.dayImport.failed':+ 'Heç nə köçürülmədi: {reason} Siyahı gündəliyin indi nəyi saxladığını göstərir; yenidən cəhd heç nəyi iki dəfə yazmır.',+ 'journey.dayImport.routeFailed': 'Qaralamalar əlavə olundu, amma marşrut saxlanmadı: {reason}',+ 'journey.dayImport.routeRetry': 'Marşrutu yenidən saxla',+ 'journey.dayImport.stale':+ 'Dawarich cavab vermədi: {reason} {date} tarixli son sinxronlaşmanın dayanacaqları göstərilir.',+ 'journey.dayImport.staleNever': 'Dawarich cavab vermədi: {reason} TREK-in artıq bildiyi dayanacaqlar göstərilir.',+ 'journey.dayImport.truncated': 'Dawarich bu günün yalnız bir hissəsini göndərdi. Bəzi dayanacaqlar çatışmaya bilər.',+ 'journey.dayImport.empty': 'Dawarich bu gün heç bir dayanacaq tapmadı.',};export default journey;diff --git a/shared/src/i18n/br/journey.ts b/shared/src/i18n/br/journey.tsindex 324b19b54..773648ee0 100644--- a/shared/src/i18n/br/journey.ts+++ b/shared/src/i18n/br/journey.ts@@ -769,5 +769,72 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Barco','journey.recording.mode.stationary': 'Parado','journey.recording.mode.unknown': 'Meio desconhecido',+ 'journey.dayImport.open': 'Importar dia',+ 'journey.dayImport.openHint': 'Importar este dia com suas paradas',+ 'journey.dayImport.openOn': 'Importar {date} com suas paradas',+ 'journey.dayImport.pending': '{count} paradas para revisar',+ 'journey.dayImport.pending.one': '{count} parada para revisar',+ 'journey.dayImport.sub': 'Suas paradas do Dawarich neste dia. Escolha, renomeie e junte; elas viram rascunhos.',+ 'journey.dayImport.loading': 'Lendo as paradas do dia no Dawarich…',+ 'journey.dayImport.map': 'O dia no mapa',+ 'journey.dayImport.stays': 'Paradas',+ 'journey.dayImport.modeEntries': 'Entradas',+ 'journey.dayImport.modeReport': 'Relato do dia',+ 'journey.dayImport.reportDefault': 'Dia {date}',+ 'journey.dayImport.reportHint':+ 'Todas as paradas escolhidas viram uma entrada que as lista com seus horários. Cada lugar continua registrado para o mapa.',+ 'journey.dayImport.reportNeedsTwo': 'Escolha duas ou mais paradas para um relato do dia.',+ 'journey.dayImport.groupTitle': 'Título da entrada',+ 'journey.dayImport.groupPin': 'Posição no mapa',+ 'journey.dayImport.noPin': 'Sem posição no mapa',+ 'journey.dayImport.join': 'Juntar em uma entrada',+ 'journey.dayImport.split': 'Manter separadas',+ 'journey.dayImport.choose': 'Importar {name}',+ 'journey.dayImport.name': 'Nome de {name}',+ 'journey.dayImport.unconfirmed': 'Não confirmada',+ 'journey.dayImport.noPlace': 'Sem posição',+ 'journey.dayImport.noPlaceHint':+ 'O Dawarich não registrou posição para esta parada, então a entrada dela não aparece no mapa.',+ 'journey.dayImport.statusHere': 'Em {title}',+ 'journey.dayImport.statusHereUntitled': 'No diário',+ 'journey.dayImport.statusElsewhere': 'Já importada',+ 'journey.dayImport.statusElsewhereHint': 'Já importada como lugar, como desejo ou para outro diário.',+ 'journey.dayImport.statusSkipped': 'Deixada de fora',+ 'journey.dayImport.keepRoute': 'Salvar também a rota do dia',+ 'journey.dayImport.keepRouteHint': '{distance} registrados. Todos na viagem a veem no mapa.',+ 'journey.dayImport.routeNone': 'O Dawarich não registrou nenhuma rota neste dia.',+ 'journey.dayImport.routeKept': 'Rota salva',+ 'journey.dayImport.routeDiffers': 'O Dawarich agora tem outra versão da rota. Substitua pelo botão de rota do dia.',+ 'journey.dayImport.existing': 'Já neste dia',+ 'journey.dayImport.untitled': 'Entrada sem título',+ 'journey.dayImport.draft': 'Rascunho',+ 'journey.dayImport.audience':+ 'Rascunhos não aparecem em links compartilhados. Outras {count} pessoas desta viagem os veem.',+ 'journey.dayImport.audience.one':+ 'Rascunhos não aparecem em links compartilhados. Outra {count} pessoa desta viagem os vê.',+ 'journey.dayImport.draftsNote':+ 'Rascunhos não aparecem em links compartilhados até você publicá-los. Adicione fotos e texto depois.',+ 'journey.dayImport.submit': 'Importar {count} rascunhos',+ 'journey.dayImport.submit.one': 'Importar {count} rascunho',+ 'journey.dayImport.skipped': '{count} deixadas de fora',+ 'journey.dayImport.skipped.one': '{count} deixada de fora',+ 'journey.dayImport.skipHint':+ 'Paradas deixadas de fora não ficam mais pendentes neste dia. Você pode restaurá-las na lista de paradas do Dawarich.',+ 'journey.dayImport.problem.nothing': 'Escolha pelo menos uma parada.',+ 'journey.dayImport.problem.name': 'Cada parada escolhida precisa de um nome.',+ 'journey.dayImport.problem.title': 'Cada entrada juntada e o relato do dia precisam de um título.',+ 'journey.dayImport.done': '{count} rascunhos importados',+ 'journey.dayImport.done.one': '{count} rascunho importado',+ 'journey.dayImport.alreadyTaken': '{count} paradas já estavam no diário. Nada foi gravado duas vezes.',+ 'journey.dayImport.alreadyTaken.one': '{count} parada já estava no diário. Nada foi gravado duas vezes.',+ 'journey.dayImport.failed':+ 'Nada foi importado: {reason} A lista mostra o que o diário contém agora; tentar de novo não grava nada duas vezes.',+ 'journey.dayImport.routeFailed': 'Os rascunhos foram criados, mas a rota não foi salva: {reason}',+ 'journey.dayImport.routeRetry': 'Salvar a rota de novo',+ 'journey.dayImport.stale':+ 'O Dawarich não respondeu: {reason} Mostrando as paradas da última sincronização em {date}.',+ 'journey.dayImport.staleNever': 'O Dawarich não respondeu: {reason} Mostrando as paradas que o TREK já conhece.',+ 'journey.dayImport.truncated': 'O Dawarich enviou só parte deste dia. Podem faltar paradas.',+ 'journey.dayImport.empty': 'O Dawarich não encontrou paradas neste dia.',};export default journey;diff --git a/shared/src/i18n/ca/journey.ts b/shared/src/i18n/ca/journey.tsindex 5bc984362..73816fcb0 100644--- a/shared/src/i18n/ca/journey.ts+++ b/shared/src/i18n/ca/journey.ts@@ -771,5 +771,74 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Vaixell','journey.recording.mode.stationary': 'Aturat','journey.recording.mode.unknown': 'Mitjà desconegut',+ 'journey.dayImport.open': 'Incorporar el dia',+ 'journey.dayImport.openHint': 'Incorporar aquest dia amb les seves estades',+ 'journey.dayImport.openOn': 'Incorporar el {date} amb les seves estades',+ 'journey.dayImport.pending': '{count} estades per revisar',+ 'journey.dayImport.pending.one': '{count} estada per revisar',+ 'journey.dayImport.sub':+ 'Les teves estades de Dawarich en aquest dia. Tria-les, canvia’ls el nom i uneix-les; esdevenen esborranys.',+ 'journey.dayImport.loading': 'Llegint les estades del dia des de Dawarich…',+ 'journey.dayImport.map': 'El dia al mapa',+ 'journey.dayImport.stays': 'Estades',+ 'journey.dayImport.modeEntries': 'Entrades',+ 'journey.dayImport.modeReport': 'Crònica del dia',+ 'journey.dayImport.reportDefault': 'Dia del {date}',+ 'journey.dayImport.reportHint':+ 'Totes les estades triades esdevenen una entrada que les enumera amb les seves hores. Cada lloc queda registrat per al mapa.',+ 'journey.dayImport.reportNeedsTwo': 'Tria dues o més estades per a una crònica del dia.',+ 'journey.dayImport.groupTitle': 'Títol de l’entrada',+ 'journey.dayImport.groupPin': 'Posició al mapa',+ 'journey.dayImport.noPin': 'Sense posició al mapa',+ 'journey.dayImport.join': 'Unir en una entrada',+ 'journey.dayImport.split': 'Mantenir separades',+ 'journey.dayImport.choose': 'Incorporar {name}',+ 'journey.dayImport.name': 'Nom de {name}',+ 'journey.dayImport.unconfirmed': 'Sense confirmar',+ 'journey.dayImport.noPlace': 'Sense posició',+ 'journey.dayImport.noPlaceHint':+ 'Dawarich no va registrar cap posició per a aquesta estada, així que la seva entrada no surt al mapa.',+ 'journey.dayImport.statusHere': 'A {title}',+ 'journey.dayImport.statusHereUntitled': 'Al diari',+ 'journey.dayImport.statusElsewhere': 'Ja incorporada',+ 'journey.dayImport.statusElsewhereHint': 'Ja incorporada com a lloc, com a desig o en un altre diari.',+ 'journey.dayImport.statusSkipped': 'Omesa',+ 'journey.dayImport.keepRoute': 'Desar també la ruta del dia',+ 'journey.dayImport.keepRouteHint': '{distance} registrats. Tothom del viatge la veu al mapa.',+ 'journey.dayImport.routeNone': 'Dawarich no va registrar cap ruta aquest dia.',+ 'journey.dayImport.routeKept': 'Ruta desada',+ 'journey.dayImport.routeDiffers':+ 'Dawarich té ara una altra versió de la ruta. Substitueix-la amb el botó de ruta del dia.',+ 'journey.dayImport.existing': 'Ja en aquest dia',+ 'journey.dayImport.untitled': 'Entrada sense títol',+ 'journey.dayImport.draft': 'Esborrany',+ 'journey.dayImport.audience':+ 'Els esborranys no apareixen als enllaços compartits. {count} persones més d’aquest viatge els veuen.',+ 'journey.dayImport.audience.one':+ 'Els esborranys no apareixen als enllaços compartits. {count} persona més d’aquest viatge els veu.',+ 'journey.dayImport.draftsNote':+ 'Els esborranys no apareixen als enllaços compartits fins que els publiquis. Afegeix fotos i text després.',+ 'journey.dayImport.submit': 'Incorporar {count} esborranys',+ 'journey.dayImport.submit.one': 'Incorporar {count} esborrany',+ 'journey.dayImport.skipped': '{count} omeses',+ 'journey.dayImport.skipped.one': '{count} omesa',+ 'journey.dayImport.skipHint':+ 'Les estades que omets ja no queden pendents en aquest dia. Les pots restaurar a la llista d’estades de Dawarich.',+ 'journey.dayImport.problem.nothing': 'Tria almenys una estada.',+ 'journey.dayImport.problem.name': 'Cada estada triada necessita un nom.',+ 'journey.dayImport.problem.title': 'Cada entrada unida i la crònica del dia necessiten un títol.',+ 'journey.dayImport.done': '{count} esborranys incorporats',+ 'journey.dayImport.done.one': '{count} esborrany incorporat',+ 'journey.dayImport.alreadyTaken': '{count} estades ja eren al diari. No s’ha escrit res dues vegades.',+ 'journey.dayImport.alreadyTaken.one': '{count} estada ja era al diari. No s’ha escrit res dues vegades.',+ 'journey.dayImport.failed':+ 'No s’ha incorporat res: {reason} La llista mostra el que conté ara el diari; tornar-ho a provar no escriu res dues vegades.',+ 'journey.dayImport.routeFailed': 'Els esborranys s’han creat, però la ruta no s’ha desat: {reason}',+ 'journey.dayImport.routeRetry': 'Desar la ruta de nou',+ 'journey.dayImport.stale':+ 'Dawarich no ha respost: {reason} Es mostren les estades de l’última sincronització del {date}.',+ 'journey.dayImport.staleNever': 'Dawarich no ha respost: {reason} Es mostren les estades que TREK ja coneix.',+ 'journey.dayImport.truncated': 'Dawarich només ha enviat una part d’aquest dia. Pot ser que faltin estades.',+ 'journey.dayImport.empty': 'Dawarich no ha trobat estades en aquest dia.',};export default journey;diff --git a/shared/src/i18n/cs/journey.ts b/shared/src/i18n/cs/journey.tsindex 79e361b43..22f7d7802 100644--- a/shared/src/i18n/cs/journey.ts+++ b/shared/src/i18n/cs/journey.ts@@ -777,5 +777,77 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Loď','journey.recording.mode.stationary': 'Na místě','journey.recording.mode.unknown': 'Neznámý způsob',+ 'journey.dayImport.open': 'Převzít den',+ 'journey.dayImport.openHint': 'Převzít tento den i s pobyty',+ 'journey.dayImport.openOn': 'Převzít {date} i s pobyty',+ 'journey.dayImport.pending': '{count} pobytů ke kontrole',+ 'journey.dayImport.pending.one': '{count} pobyt ke kontrole',+ 'journey.dayImport.pending.few': '{count} pobyty ke kontrole',+ 'journey.dayImport.sub': 'Tvé pobyty z Dawarich v tento den. Vyber je, přejmenuj a spoj; stanou se z nich koncepty.',+ 'journey.dayImport.loading': 'Načítání pobytů dne z Dawarich…',+ 'journey.dayImport.map': 'Den na mapě',+ 'journey.dayImport.stays': 'Pobyty',+ 'journey.dayImport.modeEntries': 'Záznamy',+ 'journey.dayImport.modeReport': 'Denní zpráva',+ 'journey.dayImport.reportDefault': 'Den {date}',+ 'journey.dayImport.reportHint':+ 'Všechny vybrané pobyty se stanou jedním záznamem, který je vypíše i s časy. Každé místo zůstane uložené pro mapu.',+ 'journey.dayImport.reportNeedsTwo': 'Pro denní zprávu vyber dva nebo více pobytů.',+ 'journey.dayImport.groupTitle': 'Název záznamu',+ 'journey.dayImport.groupPin': 'Poloha na mapě',+ 'journey.dayImport.noPin': 'Bez polohy na mapě',+ 'journey.dayImport.join': 'Spojit do jednoho záznamu',+ 'journey.dayImport.split': 'Ponechat zvlášť',+ 'journey.dayImport.choose': 'Převzít {name}',+ 'journey.dayImport.name': 'Název pro {name}',+ 'journey.dayImport.unconfirmed': 'Nepotvrzeno',+ 'journey.dayImport.noPlace': 'Bez polohy',+ 'journey.dayImport.noPlaceHint':+ 'Dawarich pro tento pobyt nezaznamenal polohu, proto se jeho záznam na mapě nezobrazí.',+ 'journey.dayImport.statusHere': 'V záznamu {title}',+ 'journey.dayImport.statusHereUntitled': 'V deníku',+ 'journey.dayImport.statusElsewhere': 'Převzato',+ 'journey.dayImport.statusElsewhereHint': 'Už převzato jako místo, přání nebo do jiného deníku.',+ 'journey.dayImport.statusSkipped': 'Vynecháno',+ 'journey.dayImport.keepRoute': 'Uložit i trasu dne',+ 'journey.dayImport.keepRouteHint': 'Zaznamenáno {distance}. Všichni na cestě ji uvidí na mapě.',+ 'journey.dayImport.routeNone': 'Dawarich v tento den nezaznamenal žádnou trasu.',+ 'journey.dayImport.routeKept': 'Trasa uložena',+ 'journey.dayImport.routeDiffers': 'Dawarich má teď jinou verzi trasy. Nahraď ji tlačítkem trasy daného dne.',+ 'journey.dayImport.existing': 'Už v tento den',+ 'journey.dayImport.untitled': 'Záznam bez názvu',+ 'journey.dayImport.draft': 'Koncept',+ 'journey.dayImport.audience':+ 'Koncepty se v sdílených odkazech nezobrazují. Vidí je dalších {count} lidí na této cestě.',+ 'journey.dayImport.audience.one':+ 'Koncepty se v sdílených odkazech nezobrazují. Vidí je {count} další člověk na této cestě.',+ 'journey.dayImport.audience.few':+ 'Koncepty se v sdílených odkazech nezobrazují. Vidí je další {count} lidé na této cestě.',+ 'journey.dayImport.draftsNote':+ 'Koncepty se v sdílených odkazech nezobrazují, dokud je nezveřejníš. Fotky a text přidáš potom.',+ 'journey.dayImport.submit': 'Převzít {count} konceptů',+ 'journey.dayImport.submit.one': 'Převzít {count} koncept',+ 'journey.dayImport.submit.few': 'Převzít {count} koncepty',+ 'journey.dayImport.skipped': '{count} vynecháno',+ 'journey.dayImport.skipped.one': '{count} vynechán',+ 'journey.dayImport.skipped.few': '{count} vynechány',+ 'journey.dayImport.skipHint': 'Vynechané pobyty už v tento den nečekají. Obnovit je můžeš v seznamu pobytů Dawarich.',+ 'journey.dayImport.problem.nothing': 'Vyber alespoň jeden pobyt.',+ 'journey.dayImport.problem.name': 'Každý vybraný pobyt potřebuje název.',+ 'journey.dayImport.problem.title': 'Každý spojený záznam i denní zpráva potřebují název.',+ 'journey.dayImport.done': 'Převzato {count} konceptů',+ 'journey.dayImport.done.one': 'Převzat {count} koncept',+ 'journey.dayImport.done.few': 'Převzaty {count} koncepty',+ 'journey.dayImport.alreadyTaken': '{count} pobytů už bylo v deníku. Nic se nezapsalo dvakrát.',+ 'journey.dayImport.alreadyTaken.one': '{count} pobyt už byl v deníku. Nic se nezapsalo dvakrát.',+ 'journey.dayImport.alreadyTaken.few': '{count} pobyty už byly v deníku. Nic se nezapsalo dvakrát.',+ 'journey.dayImport.failed':+ 'Nic nebylo převzato: {reason} Seznam ukazuje, co deník teď obsahuje; nový pokus nic nezapíše dvakrát.',+ 'journey.dayImport.routeFailed': 'Koncepty jsou vytvořené, ale trasa se neuložila: {reason}',+ 'journey.dayImport.routeRetry': 'Uložit trasu znovu',+ 'journey.dayImport.stale': 'Dawarich neodpověděl: {reason} Zobrazují se pobyty z poslední synchronizace {date}.',+ 'journey.dayImport.staleNever': 'Dawarich neodpověděl: {reason} Zobrazují se pobyty, které TREK už zná.',+ 'journey.dayImport.truncated': 'Dawarich poslal jen část tohoto dne. Některé pobyty mohou chybět.',+ 'journey.dayImport.empty': 'Dawarich v tento den nenašel žádné pobyty.',};export default journey;diff --git a/shared/src/i18n/de/journey.ts b/shared/src/i18n/de/journey.tsindex ace041eca..802981483 100644--- a/shared/src/i18n/de/journey.ts+++ b/shared/src/i18n/de/journey.ts@@ -774,5 +774,75 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Boot','journey.recording.mode.stationary': 'Stillstand','journey.recording.mode.unknown': 'Unbekannte Fortbewegung',+ 'journey.dayImport.open': 'Tag übernehmen',+ 'journey.dayImport.openHint': 'Diesen Tag mit seinen Aufenthalten übernehmen',+ 'journey.dayImport.openOn': '{date} mit Aufenthalten übernehmen',+ 'journey.dayImport.pending': '{count} Aufenthalte zum Prüfen',+ 'journey.dayImport.pending.one': '{count} Aufenthalt zum Prüfen',+ 'journey.dayImport.sub':+ 'Deine Aufenthalte aus Dawarich an diesem Tag. Wähle, benenne und fasse sie zusammen; sie werden zu Entwürfen.',+ 'journey.dayImport.loading': 'Aufenthalte des Tages werden aus Dawarich gelesen…',+ 'journey.dayImport.map': 'Tag auf der Karte',+ 'journey.dayImport.stays': 'Aufenthalte',+ 'journey.dayImport.modeEntries': 'Einträge',+ 'journey.dayImport.modeReport': 'Tagesbericht',+ 'journey.dayImport.reportDefault': 'Tag am {date}',+ 'journey.dayImport.reportHint':+ 'Alle gewählten Aufenthalte werden ein Eintrag, der sie mit ihren Zeiten auflistet. Jeder Ort bleibt für die Karte erhalten.',+ 'journey.dayImport.reportNeedsTwo': 'Wähle zwei oder mehr Aufenthalte für einen Tagesbericht.',+ 'journey.dayImport.groupTitle': 'Titel des Eintrags',+ 'journey.dayImport.groupPin': 'Kartenposition',+ 'journey.dayImport.noPin': 'Keine Kartenposition',+ 'journey.dayImport.join': 'Zu einem Eintrag verbinden',+ 'journey.dayImport.split': 'Getrennt lassen',+ 'journey.dayImport.choose': '{name} übernehmen',+ 'journey.dayImport.name': 'Name von {name}',+ 'journey.dayImport.unconfirmed': 'Unbestätigt',+ 'journey.dayImport.noPlace': 'Ohne Position',+ 'journey.dayImport.noPlaceHint':+ 'Dawarich hat für diesen Aufenthalt keine Position aufgezeichnet, sein Eintrag erscheint daher nicht auf der Karte.',+ 'journey.dayImport.statusHere': 'In {title}', // same-as-en+ 'journey.dayImport.statusHereUntitled': 'Im Journal',+ 'journey.dayImport.statusElsewhere': 'Übernommen',+ 'journey.dayImport.statusElsewhereHint': 'Schon als Ort, als Wunsch oder in ein anderes Journal übernommen.',+ 'journey.dayImport.statusSkipped': 'Ausgelassen',+ 'journey.dayImport.keepRoute': 'Tagesstrecke mitspeichern',+ 'journey.dayImport.keepRouteHint': '{distance} aufgezeichnet. Alle in dieser Journey sehen sie auf der Karte.',+ 'journey.dayImport.routeNone': 'Dawarich hat an diesem Tag keine Strecke aufgezeichnet.',+ 'journey.dayImport.routeKept': 'Strecke gespeichert',+ 'journey.dayImport.routeDiffers':+ 'Dawarich hat inzwischen eine andere Fassung der Strecke. Ersetze sie über den Streckenknopf des Tages.',+ 'journey.dayImport.existing': 'Schon an diesem Tag',+ 'journey.dayImport.untitled': 'Eintrag ohne Titel',+ 'journey.dayImport.draft': 'Entwurf',+ 'journey.dayImport.audience':+ 'Entwürfe erscheinen nicht in geteilten Links. {count} weitere Personen in dieser Journey sehen sie.',+ 'journey.dayImport.audience.one':+ 'Entwürfe erscheinen nicht in geteilten Links. {count} weitere Person in dieser Journey sieht sie.',+ 'journey.dayImport.draftsNote':+ 'Entwürfe erscheinen nicht in geteilten Links, bis du sie veröffentlichst. Fotos und Text ergänzt du danach.',+ 'journey.dayImport.submit': '{count} Entwürfe übernehmen',+ 'journey.dayImport.submit.one': '{count} Entwurf übernehmen',+ 'journey.dayImport.skipped': '{count} ausgelassen',+ 'journey.dayImport.skipped.one': '{count} ausgelassen',+ 'journey.dayImport.skipHint':+ 'Ausgelassene Aufenthalte warten an diesem Tag nicht mehr. Du kannst sie in der Dawarich-Aufenthaltsliste wiederherstellen.',+ 'journey.dayImport.problem.nothing': 'Wähle mindestens einen Aufenthalt.',+ 'journey.dayImport.problem.name': 'Jeder gewählte Aufenthalt braucht einen Namen.',+ 'journey.dayImport.problem.title': 'Jeder verbundene Eintrag und der Tagesbericht brauchen einen Titel.',+ 'journey.dayImport.done': '{count} Entwürfe übernommen',+ 'journey.dayImport.done.one': '{count} Entwurf übernommen',+ 'journey.dayImport.alreadyTaken': '{count} Aufenthalte waren schon im Journal. Nichts wurde doppelt angelegt.',+ 'journey.dayImport.alreadyTaken.one': '{count} Aufenthalt war schon im Journal. Nichts wurde doppelt angelegt.',+ 'journey.dayImport.failed':+ 'Nichts wurde übernommen: {reason} Die Liste zeigt, was das Journal jetzt enthält; ein neuer Versuch legt nichts doppelt an.',+ 'journey.dayImport.routeFailed': 'Die Entwürfe sind angelegt, die Strecke wurde aber nicht gespeichert: {reason}',+ 'journey.dayImport.routeRetry': 'Strecke erneut speichern',+ 'journey.dayImport.stale':+ 'Dawarich hat nicht geantwortet: {reason} Gezeigt werden die Aufenthalte des letzten Abgleichs vom {date}.',+ 'journey.dayImport.staleNever':+ 'Dawarich hat nicht geantwortet: {reason} Gezeigt werden die Aufenthalte, die TREK schon kennt.',+ 'journey.dayImport.truncated': 'Dawarich hat nur einen Teil dieses Tages geliefert. Es können Aufenthalte fehlen.',+ 'journey.dayImport.empty': 'Dawarich hat an diesem Tag keine Aufenthalte erkannt.',};export default journey;diff --git a/shared/src/i18n/en/journey.ts b/shared/src/i18n/en/journey.tsindex ea05552e8..0c6a26c3a 100644--- a/shared/src/i18n/en/journey.ts+++ b/shared/src/i18n/en/journey.ts@@ -765,5 +765,69 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Boat','journey.recording.mode.stationary': 'Standing still','journey.recording.mode.unknown': 'Unknown mode',+ 'journey.dayImport.open': 'Take over day',+ 'journey.dayImport.openHint': 'Take over this day with its stays',+ 'journey.dayImport.openOn': 'Take over {date} with its stays',+ 'journey.dayImport.pending': '{count} stays to review',+ 'journey.dayImport.pending.one': '{count} stay to review',+ 'journey.dayImport.sub': 'Your stays from Dawarich on this day. Choose, rename and join them; they become drafts.',+ 'journey.dayImport.loading': 'Reading the stays of the day from Dawarich…',+ 'journey.dayImport.map': 'Day on the map',+ 'journey.dayImport.stays': 'Stays',+ 'journey.dayImport.modeEntries': 'Entries',+ 'journey.dayImport.modeReport': 'Day report',+ 'journey.dayImport.reportDefault': 'Day of {date}',+ 'journey.dayImport.reportHint':+ 'All chosen stays become one entry that lists them with their times. Every place stays on record for the map.',+ 'journey.dayImport.reportNeedsTwo': 'Choose two or more stays for a day report.',+ 'journey.dayImport.groupTitle': 'Title of the entry',+ 'journey.dayImport.groupPin': 'Map position',+ 'journey.dayImport.noPin': 'No map position',+ 'journey.dayImport.join': 'Join into one entry',+ 'journey.dayImport.split': 'Keep apart',+ 'journey.dayImport.choose': 'Take over {name}',+ 'journey.dayImport.name': 'Name of {name}',+ 'journey.dayImport.unconfirmed': 'Unconfirmed',+ 'journey.dayImport.noPlace': 'No position',+ 'journey.dayImport.noPlaceHint': 'Dawarich recorded no position for this stay, so its entry has none on the map.',+ 'journey.dayImport.statusHere': 'In {title}',+ 'journey.dayImport.statusHereUntitled': 'In the journal',+ 'journey.dayImport.statusElsewhere': 'Taken over',+ 'journey.dayImport.statusElsewhereHint': 'Already taken over as a place, a wish or into another journal.',+ 'journey.dayImport.statusSkipped': 'Left out',+ 'journey.dayImport.keepRoute': "Keep the day's route too",+ 'journey.dayImport.keepRouteHint': '{distance} recorded. Everyone on the journey sees it on the map.',+ 'journey.dayImport.routeNone': 'Dawarich recorded no route on this day.',+ 'journey.dayImport.routeKept': 'Route kept',+ 'journey.dayImport.routeDiffers':+ 'Dawarich now has another version of the route. Replace it with the route button of the day.',+ 'journey.dayImport.existing': 'Already on this day',+ 'journey.dayImport.untitled': 'Untitled entry',+ 'journey.dayImport.draft': 'Draft',+ 'journey.dayImport.audience': 'Drafts stay off shared links. {count} other people on this journey see them.',+ 'journey.dayImport.audience.one': 'Drafts stay off shared links. {count} other person on this journey sees them.',+ 'journey.dayImport.draftsNote':+ 'Drafts stay off shared links until you publish them. Add photos and text afterwards.',+ 'journey.dayImport.submit': 'Take over {count} drafts',+ 'journey.dayImport.submit.one': 'Take over {count} draft',+ 'journey.dayImport.skipped': '{count} left out',+ 'journey.dayImport.skipped.one': '{count} left out',+ 'journey.dayImport.skipHint':+ 'Stays you leave out are no longer pending on this day. You can restore them in the Dawarich stay list.',+ 'journey.dayImport.problem.nothing': 'Choose at least one stay.',+ 'journey.dayImport.problem.name': 'Every chosen stay needs a name.',+ 'journey.dayImport.problem.title': 'Every joined entry and the day report need a title.',+ 'journey.dayImport.done': '{count} drafts taken over',+ 'journey.dayImport.done.one': '{count} draft taken over',+ 'journey.dayImport.alreadyTaken': '{count} stays were in the journal already. Nothing was written twice.',+ 'journey.dayImport.alreadyTaken.one': '{count} stay was in the journal already. Nothing was written twice.',+ 'journey.dayImport.failed':+ 'Nothing was taken over: {reason} The list shows what the journal holds now; trying again writes nothing twice.',+ 'journey.dayImport.routeFailed': 'The drafts are in, but the route was not kept: {reason}',+ 'journey.dayImport.routeRetry': 'Keep route again',+ 'journey.dayImport.stale': 'Dawarich did not answer: {reason} Showing the stays of the last sync on {date}.',+ 'journey.dayImport.staleNever': 'Dawarich did not answer: {reason} Showing the stays TREK knows already.',+ 'journey.dayImport.truncated': 'Dawarich sent only part of this day. Some stays may be missing.',+ 'journey.dayImport.empty': 'Dawarich found no stays on this day.',};export default journey;diff --git a/shared/src/i18n/es/journey.ts b/shared/src/i18n/es/journey.tsindex f2347e540..2eca56183 100644--- a/shared/src/i18n/es/journey.ts+++ b/shared/src/i18n/es/journey.ts@@ -769,5 +769,74 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Barco','journey.recording.mode.stationary': 'Parado','journey.recording.mode.unknown': 'Modo desconocido',+ 'journey.dayImport.open': 'Incorporar día',+ 'journey.dayImport.openHint': 'Incorporar este día con sus estancias',+ 'journey.dayImport.openOn': 'Incorporar el {date} con sus estancias',+ 'journey.dayImport.pending': '{count} estancias por revisar',+ 'journey.dayImport.pending.one': '{count} estancia por revisar',+ 'journey.dayImport.sub':+ 'Tus estancias de Dawarich en este día. Elígelas, cámbiales el nombre y únelas; se convierten en borradores.',+ 'journey.dayImport.loading': 'Leyendo las estancias del día desde Dawarich…',+ 'journey.dayImport.map': 'El día en el mapa',+ 'journey.dayImport.stays': 'Estancias',+ 'journey.dayImport.modeEntries': 'Entradas',+ 'journey.dayImport.modeReport': 'Crónica del día',+ 'journey.dayImport.reportDefault': 'Día del {date}',+ 'journey.dayImport.reportHint':+ 'Todas las estancias elegidas se convierten en una entrada que las enumera con sus horas. Cada lugar queda registrado para el mapa.',+ 'journey.dayImport.reportNeedsTwo': 'Elige dos o más estancias para una crónica del día.',+ 'journey.dayImport.groupTitle': 'Título de la entrada',+ 'journey.dayImport.groupPin': 'Posición en el mapa',+ 'journey.dayImport.noPin': 'Sin posición en el mapa',+ 'journey.dayImport.join': 'Unir en una entrada',+ 'journey.dayImport.split': 'Mantener separadas',+ 'journey.dayImport.choose': 'Incorporar {name}',+ 'journey.dayImport.name': 'Nombre de {name}',+ 'journey.dayImport.unconfirmed': 'Sin confirmar',+ 'journey.dayImport.noPlace': 'Sin posición',+ 'journey.dayImport.noPlaceHint':+ 'Dawarich no registró ninguna posición para esta estancia, así que su entrada no aparece en el mapa.',+ 'journey.dayImport.statusHere': 'En {title}',+ 'journey.dayImport.statusHereUntitled': 'En el diario',+ 'journey.dayImport.statusElsewhere': 'Ya incorporada',+ 'journey.dayImport.statusElsewhereHint': 'Ya incorporada como lugar, como deseo o en otro diario.',+ 'journey.dayImport.statusSkipped': 'Omitida',+ 'journey.dayImport.keepRoute': 'Guardar también la ruta del día',+ 'journey.dayImport.keepRouteHint': '{distance} registrados. Todos en el viaje la ven en el mapa.',+ 'journey.dayImport.routeNone': 'Dawarich no registró ninguna ruta este día.',+ 'journey.dayImport.routeKept': 'Ruta guardada',+ 'journey.dayImport.routeDiffers':+ 'Dawarich tiene ahora otra versión de la ruta. Sustitúyela con el botón de ruta del día.',+ 'journey.dayImport.existing': 'Ya en este día',+ 'journey.dayImport.untitled': 'Entrada sin título',+ 'journey.dayImport.draft': 'Borrador',+ 'journey.dayImport.audience':+ 'Los borradores no aparecen en los enlaces compartidos. Otras {count} personas de este viaje los ven.',+ 'journey.dayImport.audience.one':+ 'Los borradores no aparecen en los enlaces compartidos. Otra {count} persona de este viaje los ve.',+ 'journey.dayImport.draftsNote':+ 'Los borradores no aparecen en los enlaces compartidos hasta que los publiques. Añade fotos y texto después.',+ 'journey.dayImport.submit': 'Incorporar {count} borradores',+ 'journey.dayImport.submit.one': 'Incorporar {count} borrador',+ 'journey.dayImport.skipped': '{count} omitidas',+ 'journey.dayImport.skipped.one': '{count} omitida',+ 'journey.dayImport.skipHint':+ 'Las estancias que omites dejan de estar pendientes en este día. Puedes restaurarlas en la lista de estancias de Dawarich.',+ 'journey.dayImport.problem.nothing': 'Elige al menos una estancia.',+ 'journey.dayImport.problem.name': 'Cada estancia elegida necesita un nombre.',+ 'journey.dayImport.problem.title': 'Cada entrada unida y la crónica del día necesitan un título.',+ 'journey.dayImport.done': '{count} borradores incorporados',+ 'journey.dayImport.done.one': '{count} borrador incorporado',+ 'journey.dayImport.alreadyTaken': '{count} estancias ya estaban en el diario. No se escribió nada dos veces.',+ 'journey.dayImport.alreadyTaken.one': '{count} estancia ya estaba en el diario. No se escribió nada dos veces.',+ 'journey.dayImport.failed':+ 'No se incorporó nada: {reason} La lista muestra lo que contiene ahora el diario; volver a intentarlo no escribe nada dos veces.',+ 'journey.dayImport.routeFailed': 'Los borradores están creados, pero la ruta no se guardó: {reason}',+ 'journey.dayImport.routeRetry': 'Guardar la ruta otra vez',+ 'journey.dayImport.stale':+ 'Dawarich no respondió: {reason} Se muestran las estancias de la última sincronización del {date}.',+ 'journey.dayImport.staleNever': 'Dawarich no respondió: {reason} Se muestran las estancias que TREK ya conoce.',+ 'journey.dayImport.truncated': 'Dawarich solo envió una parte de este día. Puede que falten estancias.',+ 'journey.dayImport.empty': 'Dawarich no encontró estancias en este día.',};export default journey;diff --git a/shared/src/i18n/et/journey.ts b/shared/src/i18n/et/journey.tsindex 58cb96268..503d89fea 100644--- a/shared/src/i18n/et/journey.ts+++ b/shared/src/i18n/et/journey.ts@@ -765,5 +765,72 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Paat','journey.recording.mode.stationary': 'Paigal','journey.recording.mode.unknown': 'Tundmatu liikumisviis',+ 'journey.dayImport.open': 'Võta päev üle',+ 'journey.dayImport.openHint': 'Võta see päev koos peatustega üle',+ 'journey.dayImport.openOn': 'Võta {date} koos peatustega üle',+ 'journey.dayImport.pending': '{count} peatust ülevaatamiseks',+ 'journey.dayImport.pending.one': '{count} peatus ülevaatamiseks',+ 'journey.dayImport.sub':+ 'Sinu peatused Dawarichist sel päeval. Vali, nimeta ümber ja ühenda need; neist saavad mustandid.',+ 'journey.dayImport.loading': 'Päeva peatusi loetakse Dawarichist…',+ 'journey.dayImport.map': 'Päev kaardil',+ 'journey.dayImport.stays': 'Peatused',+ 'journey.dayImport.modeEntries': 'Sissekanded',+ 'journey.dayImport.modeReport': 'Päevaülevaade',+ 'journey.dayImport.reportDefault': 'Päev {date}',+ 'journey.dayImport.reportHint':+ 'Kõik valitud peatused saavad üheks sissekandeks, mis loetleb need koos aegadega. Iga koht jääb kaardi jaoks alles.',+ 'journey.dayImport.reportNeedsTwo': 'Päevaülevaate jaoks vali kaks või rohkem peatust.',+ 'journey.dayImport.groupTitle': 'Sissekande pealkiri',+ 'journey.dayImport.groupPin': 'Asukoht kaardil',+ 'journey.dayImport.noPin': 'Asukohta kaardil pole',+ 'journey.dayImport.join': 'Ühenda üheks sissekandeks',+ 'journey.dayImport.split': 'Hoia eraldi',+ 'journey.dayImport.choose': 'Võta {name} üle',+ 'journey.dayImport.name': '{name} nimi',+ 'journey.dayImport.unconfirmed': 'Kinnitamata',+ 'journey.dayImport.noPlace': 'Asukohata',+ 'journey.dayImport.noPlaceHint':+ 'Dawarich ei salvestanud sellele peatusele asukohta, seega ei ole selle sissekanne kaardil.',+ 'journey.dayImport.statusHere': 'Sissekandes {title}',+ 'journey.dayImport.statusHereUntitled': 'Päevikus',+ 'journey.dayImport.statusElsewhere': 'Üle võetud',+ 'journey.dayImport.statusElsewhereHint': 'Juba üle võetud kohana, soovina või teise päevikusse.',+ 'journey.dayImport.statusSkipped': 'Välja jäetud',+ 'journey.dayImport.keepRoute': 'Hoia ka päeva teekond',+ 'journey.dayImport.keepRouteHint': '{distance} salvestatud. Kõik reisil osalejad näevad seda kaardil.',+ 'journey.dayImport.routeNone': 'Dawarich ei salvestanud sel päeval teekonda.',+ 'journey.dayImport.routeKept': 'Teekond hoitud',+ 'journey.dayImport.routeDiffers': 'Dawarichil on nüüd teekonna teine versioon. Asenda see päeva teekonnanupuga.',+ 'journey.dayImport.existing': 'Juba sel päeval',+ 'journey.dayImport.untitled': 'Pealkirjata sissekanne',+ 'journey.dayImport.draft': 'Mustand',+ 'journey.dayImport.audience':+ 'Mustandid ei ole jagatud linkidel nähtavad. {count} teist inimest sellel reisil näevad neid.',+ 'journey.dayImport.audience.one':+ 'Mustandid ei ole jagatud linkidel nähtavad. {count} teine inimene sellel reisil näeb neid.',+ 'journey.dayImport.draftsNote':+ 'Mustandid ei ole jagatud linkidel nähtavad enne, kui need avaldad. Lisa fotod ja tekst hiljem.',+ 'journey.dayImport.submit': 'Võta üle {count} mustandit',+ 'journey.dayImport.submit.one': 'Võta üle {count} mustand',+ 'journey.dayImport.skipped': '{count} välja jäetud',+ 'journey.dayImport.skipped.one': '{count} välja jäetud',+ 'journey.dayImport.skipHint':+ 'Välja jäetud peatused ei oota sel päeval enam. Saad need taastada Dawarichi peatuste loendis.',+ 'journey.dayImport.problem.nothing': 'Vali vähemalt üks peatus.',+ 'journey.dayImport.problem.name': 'Igal valitud peatusel peab olema nimi.',+ 'journey.dayImport.problem.title': 'Igal ühendatud sissekandel ja päevaülevaatel peab olema pealkiri.',+ 'journey.dayImport.done': '{count} mustandit üle võetud',+ 'journey.dayImport.done.one': '{count} mustand üle võetud',+ 'journey.dayImport.alreadyTaken': '{count} peatust oli juba päevikus. Midagi ei kirjutatud kaks korda.',+ 'journey.dayImport.alreadyTaken.one': '{count} peatus oli juba päevikus. Midagi ei kirjutatud kaks korda.',+ 'journey.dayImport.failed':+ 'Midagi ei võetud üle: {reason} Loend näitab, mis päevikus praegu on; uus katse ei kirjuta midagi kaks korda.',+ 'journey.dayImport.routeFailed': 'Mustandid on olemas, kuid teekonda ei hoitud: {reason}',+ 'journey.dayImport.routeRetry': 'Hoia teekond uuesti',+ 'journey.dayImport.stale': 'Dawarich ei vastanud: {reason} Näidatakse viimase sünkroonimise ({date}) peatusi.',+ 'journey.dayImport.staleNever': 'Dawarich ei vastanud: {reason} Näidatakse peatusi, mida TREK juba teab.',+ 'journey.dayImport.truncated': 'Dawarich saatis sellest päevast ainult osa. Mõni peatus võib puududa.',+ 'journey.dayImport.empty': 'Dawarich ei leidnud sel päeval ühtegi peatust.',};export default journey;diff --git a/shared/src/i18n/fr/journey.ts b/shared/src/i18n/fr/journey.tsindex f78a6d6f1..a7392b386 100644--- a/shared/src/i18n/fr/journey.ts+++ b/shared/src/i18n/fr/journey.ts@@ -768,5 +768,74 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Bateau','journey.recording.mode.stationary': 'À l’arrêt','journey.recording.mode.unknown': 'Mode inconnu',+ 'journey.dayImport.open': 'Reprendre la journée',+ 'journey.dayImport.openHint': 'Reprendre cette journée avec ses séjours',+ 'journey.dayImport.openOn': 'Reprendre le {date} avec ses séjours',+ 'journey.dayImport.pending': '{count} séjours à vérifier',+ 'journey.dayImport.pending.one': '{count} séjour à vérifier',+ 'journey.dayImport.sub':+ 'Vos séjours Dawarich de cette journée. Choisissez, renommez et regroupez-les ; ils deviennent des brouillons.',+ 'journey.dayImport.loading': 'Lecture des séjours de la journée depuis Dawarich…',+ 'journey.dayImport.map': 'La journée sur la carte',+ 'journey.dayImport.stays': 'Séjours',+ 'journey.dayImport.modeEntries': 'Entrées',+ 'journey.dayImport.modeReport': 'Récit du jour',+ 'journey.dayImport.reportDefault': 'Journée du {date}',+ 'journey.dayImport.reportHint':+ 'Tous les séjours choisis deviennent une seule entrée qui les liste avec leurs horaires. Chaque lieu reste enregistré pour la carte.',+ 'journey.dayImport.reportNeedsTwo': 'Choisissez au moins deux séjours pour un récit du jour.',+ 'journey.dayImport.groupTitle': "Titre de l'entrée",+ 'journey.dayImport.groupPin': 'Position sur la carte',+ 'journey.dayImport.noPin': 'Sans position sur la carte',+ 'journey.dayImport.join': 'Regrouper en une entrée',+ 'journey.dayImport.split': 'Garder séparés',+ 'journey.dayImport.choose': 'Reprendre {name}',+ 'journey.dayImport.name': 'Nom de {name}',+ 'journey.dayImport.unconfirmed': 'Non confirmé',+ 'journey.dayImport.noPlace': 'Sans position',+ 'journey.dayImport.noPlaceHint':+ "Dawarich n'a enregistré aucune position pour ce séjour ; son entrée n'apparaît donc pas sur la carte.",+ 'journey.dayImport.statusHere': 'Dans {title}',+ 'journey.dayImport.statusHereUntitled': 'Dans le journal',+ 'journey.dayImport.statusElsewhere': 'Déjà repris',+ 'journey.dayImport.statusElsewhereHint': 'Déjà repris comme lieu, comme souhait ou dans un autre journal.',+ 'journey.dayImport.statusSkipped': 'Écarté',+ 'journey.dayImport.keepRoute': 'Garder aussi le trajet du jour',+ 'journey.dayImport.keepRouteHint': '{distance} enregistrés. Tous les membres du voyage le voient sur la carte.',+ 'journey.dayImport.routeNone': "Dawarich n'a enregistré aucun trajet ce jour-là.",+ 'journey.dayImport.routeKept': 'Trajet gardé',+ 'journey.dayImport.routeDiffers':+ 'Dawarich a maintenant une autre version du trajet. Remplacez-la avec le bouton de trajet de la journée.',+ 'journey.dayImport.existing': 'Déjà dans cette journée',+ 'journey.dayImport.untitled': 'Entrée sans titre',+ 'journey.dayImport.draft': 'Brouillon',+ 'journey.dayImport.audience':+ "Les brouillons n'apparaissent pas dans les liens partagés. {count} autres personnes de ce voyage les voient.",+ 'journey.dayImport.audience.one':+ "Les brouillons n'apparaissent pas dans les liens partagés. {count} autre personne de ce voyage les voit.",+ 'journey.dayImport.draftsNote':+ "Les brouillons n'apparaissent pas dans les liens partagés tant que vous ne les publiez pas. Ajoutez photos et texte ensuite.",+ 'journey.dayImport.submit': 'Reprendre {count} brouillons',+ 'journey.dayImport.submit.one': 'Reprendre {count} brouillon',+ 'journey.dayImport.skipped': '{count} écartés',+ 'journey.dayImport.skipped.one': '{count} écarté',+ 'journey.dayImport.skipHint':+ 'Les séjours écartés ne sont plus en attente pour cette journée. Vous pouvez les rétablir dans la liste des séjours Dawarich.',+ 'journey.dayImport.problem.nothing': 'Choisissez au moins un séjour.',+ 'journey.dayImport.problem.name': 'Chaque séjour choisi doit avoir un nom.',+ 'journey.dayImport.problem.title': 'Chaque entrée regroupée et le récit du jour doivent avoir un titre.',+ 'journey.dayImport.done': '{count} brouillons repris',+ 'journey.dayImport.done.one': '{count} brouillon repris',+ 'journey.dayImport.alreadyTaken': "{count} séjours étaient déjà dans le journal. Rien n'a été écrit deux fois.",+ 'journey.dayImport.alreadyTaken.one': "{count} séjour était déjà dans le journal. Rien n'a été écrit deux fois.",+ 'journey.dayImport.failed':+ "Rien n'a été repris : {reason} La liste montre ce que contient le journal maintenant ; un nouvel essai n'écrit rien deux fois.",+ 'journey.dayImport.routeFailed': "Les brouillons sont créés, mais le trajet n'a pas été gardé : {reason}",+ 'journey.dayImport.routeRetry': 'Garder le trajet à nouveau',+ 'journey.dayImport.stale':+ "Dawarich n'a pas répondu : {reason} Affichage des séjours de la dernière synchronisation du {date}.",+ 'journey.dayImport.staleNever': "Dawarich n'a pas répondu : {reason} Affichage des séjours que TREK connaît déjà.",+ 'journey.dayImport.truncated': "Dawarich n'a envoyé qu'une partie de cette journée. Des séjours peuvent manquer.",+ 'journey.dayImport.empty': "Dawarich n'a trouvé aucun séjour ce jour-là.",};export default journey;diff --git a/shared/src/i18n/gr/journey.ts b/shared/src/i18n/gr/journey.tsindex 987903ef2..5f3619faa 100644--- a/shared/src/i18n/gr/journey.ts+++ b/shared/src/i18n/gr/journey.ts@@ -778,5 +778,75 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Πλοίο','journey.recording.mode.stationary': 'Ακίνητος','journey.recording.mode.unknown': 'Άγνωστο μέσο',+ 'journey.dayImport.open': 'Μεταφορά ημέρας',+ 'journey.dayImport.openHint': 'Μεταφορά αυτής της ημέρας με τις στάσεις της',+ 'journey.dayImport.openOn': 'Μεταφορά της {date} με τις στάσεις της',+ 'journey.dayImport.pending': '{count} στάσεις για έλεγχο',+ 'journey.dayImport.pending.one': '{count} στάση για έλεγχο',+ 'journey.dayImport.sub':+ 'Οι στάσεις σου από το Dawarich αυτή την ημέρα. Διάλεξε, μετονόμασε και ένωσέ τες· γίνονται πρόχειρα.',+ 'journey.dayImport.loading': 'Ανάγνωση των στάσεων της ημέρας από το Dawarich…',+ 'journey.dayImport.map': 'Η ημέρα στον χάρτη',+ 'journey.dayImport.stays': 'Στάσεις',+ 'journey.dayImport.modeEntries': 'Καταχωρίσεις',+ 'journey.dayImport.modeReport': 'Αναφορά ημέρας',+ 'journey.dayImport.reportDefault': 'Ημέρα {date}',+ 'journey.dayImport.reportHint':+ 'Όλες οι επιλεγμένες στάσεις γίνονται μία καταχώριση που τις παραθέτει με τις ώρες τους. Κάθε τόπος μένει καταγεγραμμένος για τον χάρτη.',+ 'journey.dayImport.reportNeedsTwo': 'Διάλεξε δύο ή περισσότερες στάσεις για αναφορά ημέρας.',+ 'journey.dayImport.groupTitle': 'Τίτλος καταχώρισης',+ 'journey.dayImport.groupPin': 'Θέση στον χάρτη',+ 'journey.dayImport.noPin': 'Χωρίς θέση στον χάρτη',+ 'journey.dayImport.join': 'Ένωση σε μία καταχώριση',+ 'journey.dayImport.split': 'Να μείνουν χωριστά',+ 'journey.dayImport.choose': 'Μεταφορά {name}',+ 'journey.dayImport.name': 'Όνομα του {name}',+ 'journey.dayImport.unconfirmed': 'Ανεπιβεβαίωτη',+ 'journey.dayImport.noPlace': 'Χωρίς θέση',+ 'journey.dayImport.noPlaceHint':+ 'Το Dawarich δεν κατέγραψε θέση για αυτή τη στάση, οπότε η καταχώρισή της δεν εμφανίζεται στον χάρτη.',+ 'journey.dayImport.statusHere': 'Στο {title}',+ 'journey.dayImport.statusHereUntitled': 'Στο ημερολόγιο',+ 'journey.dayImport.statusElsewhere': 'Μεταφέρθηκε',+ 'journey.dayImport.statusElsewhereHint': 'Έχει ήδη μεταφερθεί ως μέρος, ως επιθυμία ή σε άλλο ημερολόγιο.',+ 'journey.dayImport.statusSkipped': 'Παραλείφθηκε',+ 'journey.dayImport.keepRoute': 'Αποθήκευση και της διαδρομής της ημέρας',+ 'journey.dayImport.keepRouteHint': '{distance} καταγεγραμμένα. Όλοι στο ταξίδι τη βλέπουν στον χάρτη.',+ 'journey.dayImport.routeNone': 'Το Dawarich δεν κατέγραψε διαδρομή αυτή την ημέρα.',+ 'journey.dayImport.routeKept': 'Η διαδρομή αποθηκεύτηκε',+ 'journey.dayImport.routeDiffers':+ 'Το Dawarich έχει τώρα άλλη έκδοση της διαδρομής. Αντικατάστησέ τη με το κουμπί διαδρομής της ημέρας.',+ 'journey.dayImport.existing': 'Ήδη σε αυτή την ημέρα',+ 'journey.dayImport.untitled': 'Καταχώριση χωρίς τίτλο',+ 'journey.dayImport.draft': 'Πρόχειρο',+ 'journey.dayImport.audience':+ 'Τα πρόχειρα δεν εμφανίζονται σε κοινόχρηστους συνδέσμους. Άλλα {count} άτομα αυτού του ταξιδιού τα βλέπουν.',+ 'journey.dayImport.audience.one':+ 'Τα πρόχειρα δεν εμφανίζονται σε κοινόχρηστους συνδέσμους. {count} άλλο άτομο αυτού του ταξιδιού τα βλέπει.',+ 'journey.dayImport.draftsNote':+ 'Τα πρόχειρα δεν εμφανίζονται σε κοινόχρηστους συνδέσμους μέχρι να τα δημοσιεύσεις. Πρόσθεσε φωτογραφίες και κείμενο μετά.',+ 'journey.dayImport.submit': 'Μεταφορά {count} πρόχειρων',+ 'journey.dayImport.submit.one': 'Μεταφορά {count} πρόχειρου',+ 'journey.dayImport.skipped': '{count} παραλείφθηκαν',+ 'journey.dayImport.skipped.one': '{count} παραλείφθηκε',+ 'journey.dayImport.skipHint':+ 'Οι στάσεις που παραλείπεις δεν περιμένουν πια σε αυτή την ημέρα. Μπορείς να τις επαναφέρεις στη λίστα στάσεων του Dawarich.',+ 'journey.dayImport.problem.nothing': 'Διάλεξε τουλάχιστον μία στάση.',+ 'journey.dayImport.problem.name': 'Κάθε επιλεγμένη στάση χρειάζεται όνομα.',+ 'journey.dayImport.problem.title': 'Κάθε ενωμένη καταχώριση και η αναφορά ημέρας χρειάζονται τίτλο.',+ 'journey.dayImport.done': '{count} πρόχειρα μεταφέρθηκαν',+ 'journey.dayImport.done.one': '{count} πρόχειρο μεταφέρθηκε',+ 'journey.dayImport.alreadyTaken': '{count} στάσεις υπήρχαν ήδη στο ημερολόγιο. Τίποτα δεν γράφτηκε δύο φορές.',+ 'journey.dayImport.alreadyTaken.one': '{count} στάση υπήρχε ήδη στο ημερολόγιο. Τίποτα δεν γράφτηκε δύο φορές.',+ 'journey.dayImport.failed':+ 'Δεν μεταφέρθηκε τίποτα: {reason} Η λίστα δείχνει τι περιέχει τώρα το ημερολόγιο· μια νέα προσπάθεια δεν γράφει τίποτα δύο φορές.',+ 'journey.dayImport.routeFailed': 'Τα πρόχειρα δημιουργήθηκαν, αλλά η διαδρομή δεν αποθηκεύτηκε: {reason}',+ 'journey.dayImport.routeRetry': 'Νέα αποθήκευση διαδρομής',+ 'journey.dayImport.stale':+ 'Το Dawarich δεν απάντησε: {reason} Εμφανίζονται οι στάσεις του τελευταίου συγχρονισμού στις {date}.',+ 'journey.dayImport.staleNever':+ 'Το Dawarich δεν απάντησε: {reason} Εμφανίζονται οι στάσεις που ήδη γνωρίζει το TREK.',+ 'journey.dayImport.truncated': 'Το Dawarich έστειλε μόνο μέρος αυτής της ημέρας. Μπορεί να λείπουν στάσεις.',+ 'journey.dayImport.empty': 'Το Dawarich δεν βρήκε στάσεις αυτή την ημέρα.',};export default journey;diff --git a/shared/src/i18n/hu/journey.ts b/shared/src/i18n/hu/journey.tsindex ca6bd9848..689c1d703 100644--- a/shared/src/i18n/hu/journey.ts+++ b/shared/src/i18n/hu/journey.ts@@ -766,5 +766,74 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Hajó','journey.recording.mode.stationary': 'Egy helyben','journey.recording.mode.unknown': 'Ismeretlen mód',+ 'journey.dayImport.open': 'Nap átvétele',+ 'journey.dayImport.openHint': 'Ennek a napnak az átvétele a tartózkodásokkal',+ 'journey.dayImport.openOn': '{date} átvétele a tartózkodásokkal',+ 'journey.dayImport.pending': '{count} tartózkodás vár ellenőrzésre',+ 'journey.dayImport.pending.one': '{count} tartózkodás vár ellenőrzésre',+ 'journey.dayImport.sub':+ 'A Dawarichban rögzített tartózkodásaid ezen a napon. Válaszd ki, nevezd át és vond össze őket; piszkozatok lesznek belőlük.',+ 'journey.dayImport.loading': 'A nap tartózkodásainak beolvasása a Dawarichból…',+ 'journey.dayImport.map': 'A nap a térképen',+ 'journey.dayImport.stays': 'Tartózkodások',+ 'journey.dayImport.modeEntries': 'Bejegyzések',+ 'journey.dayImport.modeReport': 'Napi beszámoló',+ 'journey.dayImport.reportDefault': 'A(z) {date} napja',+ 'journey.dayImport.reportHint':+ 'A kiválasztott tartózkodásokból egy bejegyzés lesz, amely időpontjaikkal együtt felsorolja őket. Minden hely megmarad a térképhez.',+ 'journey.dayImport.reportNeedsTwo': 'Napi beszámolóhoz válassz legalább két tartózkodást.',+ 'journey.dayImport.groupTitle': 'A bejegyzés címe',+ 'journey.dayImport.groupPin': 'Hely a térképen',+ 'journey.dayImport.noPin': 'Nincs hely a térképen',+ 'journey.dayImport.join': 'Összevonás egy bejegyzésbe',+ 'journey.dayImport.split': 'Külön marad',+ 'journey.dayImport.choose': '{name} átvétele',+ 'journey.dayImport.name': '{name} neve',+ 'journey.dayImport.unconfirmed': 'Nem megerősített',+ 'journey.dayImport.noPlace': 'Hely nélkül',+ 'journey.dayImport.noPlaceHint':+ 'A Dawarich nem rögzített helyet ehhez a tartózkodáshoz, ezért a bejegyzése nem jelenik meg a térképen.',+ 'journey.dayImport.statusHere': 'Itt: {title}',+ 'journey.dayImport.statusHereUntitled': 'A naplóban',+ 'journey.dayImport.statusElsewhere': 'Átvéve',+ 'journey.dayImport.statusElsewhereHint': 'Már átvéve helyként, kívánságként vagy egy másik naplóba.',+ 'journey.dayImport.statusSkipped': 'Kihagyva',+ 'journey.dayImport.keepRoute': 'A nap útvonalának mentése is',+ 'journey.dayImport.keepRouteHint': '{distance} rögzítve. Az utazás minden tagja látja a térképen.',+ 'journey.dayImport.routeNone': 'A Dawarich ezen a napon nem rögzített útvonalat.',+ 'journey.dayImport.routeKept': 'Útvonal mentve',+ 'journey.dayImport.routeDiffers':+ 'A Dawarichban most az útvonal egy másik változata van. Cseréld le a nap útvonal gombjával.',+ 'journey.dayImport.existing': 'Már ezen a napon',+ 'journey.dayImport.untitled': 'Cím nélküli bejegyzés',+ 'journey.dayImport.draft': 'Piszkozat',+ 'journey.dayImport.audience':+ 'A piszkozatok nem jelennek meg a megosztott linkeken. Az utazás {count} további tagja látja őket.',+ 'journey.dayImport.audience.one':+ 'A piszkozatok nem jelennek meg a megosztott linkeken. Az utazás {count} további tagja látja őket.',+ 'journey.dayImport.draftsNote':+ 'A piszkozatok nem jelennek meg a megosztott linkeken, amíg közzé nem teszed őket. Fotókat és szöveget utána adhatsz hozzá.',+ 'journey.dayImport.submit': '{count} piszkozat átvétele',+ 'journey.dayImport.submit.one': '{count} piszkozat átvétele',+ 'journey.dayImport.skipped': '{count} kihagyva',+ 'journey.dayImport.skipped.one': '{count} kihagyva',+ 'journey.dayImport.skipHint':+ 'A kihagyott tartózkodások ezen a napon már nem várnak. Visszaállíthatod őket a Dawarich tartózkodáslistájában.',+ 'journey.dayImport.problem.nothing': 'Válassz legalább egy tartózkodást.',+ 'journey.dayImport.problem.name': 'Minden kiválasztott tartózkodásnak kell név.',+ 'journey.dayImport.problem.title': 'Minden összevont bejegyzésnek és a napi beszámolónak kell cím.',+ 'journey.dayImport.done': '{count} piszkozat átvéve',+ 'journey.dayImport.done.one': '{count} piszkozat átvéve',+ 'journey.dayImport.alreadyTaken': '{count} tartózkodás már a naplóban volt. Semmi sem lett kétszer felvéve.',+ 'journey.dayImport.alreadyTaken.one': '{count} tartózkodás már a naplóban volt. Semmi sem lett kétszer felvéve.',+ 'journey.dayImport.failed':+ 'Semmi sem lett átvéve: {reason} A lista azt mutatja, mi van most a naplóban; az újrapróbálás semmit sem ír kétszer.',+ 'journey.dayImport.routeFailed': 'A piszkozatok elkészültek, de az útvonal nem lett mentve: {reason}',+ 'journey.dayImport.routeRetry': 'Útvonal mentése újra',+ 'journey.dayImport.stale':+ 'A Dawarich nem válaszolt: {reason} A legutóbbi, {date} időpontú szinkronizálás tartózkodásai látszanak.',+ 'journey.dayImport.staleNever': 'A Dawarich nem válaszolt: {reason} A TREK által már ismert tartózkodások látszanak.',+ 'journey.dayImport.truncated': 'A Dawarich csak a nap egy részét küldte el. Hiányozhatnak tartózkodások.',+ 'journey.dayImport.empty': 'A Dawarich nem talált tartózkodást ezen a napon.',};export default journey;diff --git a/shared/src/i18n/id/journey.ts b/shared/src/i18n/id/journey.tsindex 8753fdb94..63e80e050 100644--- a/shared/src/i18n/id/journey.ts+++ b/shared/src/i18n/id/journey.ts@@ -752,5 +752,68 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Perahu','journey.recording.mode.stationary': 'Diam','journey.recording.mode.unknown': 'Moda tidak dikenal',+ 'journey.dayImport.open': 'Ambil hari',+ 'journey.dayImport.openHint': 'Ambil hari ini beserta persinggahannya',+ 'journey.dayImport.openOn': 'Ambil {date} beserta persinggahannya',+ 'journey.dayImport.pending': '{count} persinggahan untuk ditinjau',+ 'journey.dayImport.sub':+ 'Persinggahanmu dari Dawarich pada hari ini. Pilih, ganti nama, dan gabungkan; semuanya menjadi draf.',+ 'journey.dayImport.loading': 'Membaca persinggahan hari ini dari Dawarich…',+ 'journey.dayImport.map': 'Hari di peta',+ 'journey.dayImport.stays': 'Persinggahan',+ 'journey.dayImport.modeEntries': 'Catatan',+ 'journey.dayImport.modeReport': 'Laporan harian',+ 'journey.dayImport.reportDefault': 'Hari {date}',+ 'journey.dayImport.reportHint':+ 'Semua persinggahan yang dipilih menjadi satu catatan yang mencantumkannya beserta waktunya. Setiap tempat tetap tersimpan untuk peta.',+ 'journey.dayImport.reportNeedsTwo': 'Pilih dua persinggahan atau lebih untuk laporan harian.',+ 'journey.dayImport.groupTitle': 'Judul catatan',+ 'journey.dayImport.groupPin': 'Posisi di peta',+ 'journey.dayImport.noPin': 'Tanpa posisi di peta',+ 'journey.dayImport.join': 'Gabungkan jadi satu catatan',+ 'journey.dayImport.split': 'Biarkan terpisah',+ 'journey.dayImport.choose': 'Ambil {name}',+ 'journey.dayImport.name': 'Nama {name}',+ 'journey.dayImport.unconfirmed': 'Belum dikonfirmasi',+ 'journey.dayImport.noPlace': 'Tanpa posisi',+ 'journey.dayImport.noPlaceHint':+ 'Dawarich tidak mencatat posisi untuk persinggahan ini, jadi catatannya tidak muncul di peta.',+ 'journey.dayImport.statusHere': 'Di {title}',+ 'journey.dayImport.statusHereUntitled': 'Di jurnal',+ 'journey.dayImport.statusElsewhere': 'Sudah diambil',+ 'journey.dayImport.statusElsewhereHint': 'Sudah diambil sebagai tempat, keinginan, atau ke jurnal lain.',+ 'journey.dayImport.statusSkipped': 'Dilewati',+ 'journey.dayImport.keepRoute': 'Simpan juga rute hari ini',+ 'journey.dayImport.keepRouteHint': '{distance} tercatat. Semua orang di perjalanan melihatnya di peta.',+ 'journey.dayImport.routeNone': 'Dawarich tidak mencatat rute pada hari ini.',+ 'journey.dayImport.routeKept': 'Rute disimpan',+ 'journey.dayImport.routeDiffers':+ 'Dawarich sekarang punya versi lain dari rute ini. Ganti lewat tombol rute hari itu.',+ 'journey.dayImport.existing': 'Sudah ada di hari ini',+ 'journey.dayImport.untitled': 'Catatan tanpa judul',+ 'journey.dayImport.draft': 'Draf',+ 'journey.dayImport.audience':+ 'Draf tidak tampil di tautan yang dibagikan. {count} orang lain di perjalanan ini melihatnya.',+ 'journey.dayImport.draftsNote':+ 'Draf tidak tampil di tautan yang dibagikan sampai kamu menerbitkannya. Tambahkan foto dan teks setelahnya.',+ 'journey.dayImport.submit': 'Ambil {count} draf',+ 'journey.dayImport.skipped': '{count} dilewati',+ 'journey.dayImport.skipHint':+ 'Persinggahan yang kamu lewati tidak lagi menunggu di hari ini. Kamu bisa memulihkannya di daftar persinggahan Dawarich.',+ 'journey.dayImport.problem.nothing': 'Pilih setidaknya satu persinggahan.',+ 'journey.dayImport.problem.name': 'Setiap persinggahan yang dipilih perlu nama.',+ 'journey.dayImport.problem.title': 'Setiap catatan gabungan dan laporan harian perlu judul.',+ 'journey.dayImport.done': '{count} draf diambil',+ 'journey.dayImport.alreadyTaken': '{count} persinggahan sudah ada di jurnal. Tidak ada yang ditulis dua kali.',+ 'journey.dayImport.failed':+ 'Tidak ada yang diambil: {reason} Daftar menunjukkan isi jurnal sekarang; mencoba lagi tidak menulis apa pun dua kali.',+ 'journey.dayImport.routeFailed': 'Draf sudah dibuat, tetapi rute tidak disimpan: {reason}',+ 'journey.dayImport.routeRetry': 'Simpan rute lagi',+ 'journey.dayImport.stale':+ 'Dawarich tidak menjawab: {reason} Menampilkan persinggahan dari sinkronisasi terakhir pada {date}.',+ 'journey.dayImport.staleNever':+ 'Dawarich tidak menjawab: {reason} Menampilkan persinggahan yang sudah diketahui TREK.',+ 'journey.dayImport.truncated': 'Dawarich hanya mengirim sebagian hari ini. Beberapa persinggahan mungkin hilang.',+ 'journey.dayImport.empty': 'Dawarich tidak menemukan persinggahan pada hari ini.',};export default journey;diff --git a/shared/src/i18n/it/journey.ts b/shared/src/i18n/it/journey.tsindex fefd9c6ac..11aaa640a 100644--- a/shared/src/i18n/it/journey.ts+++ b/shared/src/i18n/it/journey.ts@@ -769,5 +769,75 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Barca','journey.recording.mode.stationary': 'Fermo','journey.recording.mode.unknown': 'Mezzo sconosciuto',+ 'journey.dayImport.open': 'Riprendi giornata',+ 'journey.dayImport.openHint': 'Riprendi questa giornata con le sue soste',+ 'journey.dayImport.openOn': 'Riprendi il {date} con le sue soste',+ 'journey.dayImport.pending': '{count} soste da controllare',+ 'journey.dayImport.pending.one': '{count} sosta da controllare',+ 'journey.dayImport.sub':+ 'Le tue soste da Dawarich in questa giornata. Sceglile, rinominale e uniscile; diventano bozze.',+ 'journey.dayImport.loading': 'Lettura delle soste della giornata da Dawarich…',+ 'journey.dayImport.map': 'La giornata sulla mappa',+ 'journey.dayImport.stays': 'Soste',+ 'journey.dayImport.modeEntries': 'Voci',+ 'journey.dayImport.modeReport': 'Resoconto del giorno',+ 'journey.dayImport.reportDefault': 'Giornata del {date}',+ 'journey.dayImport.reportHint':+ 'Tutte le soste scelte diventano una sola voce che le elenca con i loro orari. Ogni luogo resta registrato per la mappa.',+ 'journey.dayImport.reportNeedsTwo': 'Scegli due o più soste per un resoconto del giorno.',+ 'journey.dayImport.groupTitle': 'Titolo della voce',+ 'journey.dayImport.groupPin': 'Posizione sulla mappa',+ 'journey.dayImport.noPin': 'Nessuna posizione sulla mappa',+ 'journey.dayImport.join': 'Unisci in una voce',+ 'journey.dayImport.split': 'Tieni separate',+ 'journey.dayImport.choose': 'Riprendi {name}',+ 'journey.dayImport.name': 'Nome di {name}',+ 'journey.dayImport.unconfirmed': 'Non confermata',+ 'journey.dayImport.noPlace': 'Senza posizione',+ 'journey.dayImport.noPlaceHint':+ 'Dawarich non ha registrato una posizione per questa sosta, quindi la sua voce non compare sulla mappa.',+ 'journey.dayImport.statusHere': 'In {title}', // same-as-en+ 'journey.dayImport.statusHereUntitled': 'Nel diario',+ 'journey.dayImport.statusElsewhere': 'Già ripresa',+ 'journey.dayImport.statusElsewhereHint': 'Già ripresa come luogo, come desiderio o in un altro diario.',+ 'journey.dayImport.statusSkipped': 'Esclusa',+ 'journey.dayImport.keepRoute': 'Conserva anche il percorso del giorno',+ 'journey.dayImport.keepRouteHint': '{distance} registrati. Tutti nel viaggio lo vedono sulla mappa.',+ 'journey.dayImport.routeNone': 'Dawarich non ha registrato alcun percorso in questa giornata.',+ 'journey.dayImport.routeKept': 'Percorso conservato',+ 'journey.dayImport.routeDiffers':+ 'Dawarich ha ora un’altra versione del percorso. Sostituiscila con il pulsante del percorso della giornata.',+ 'journey.dayImport.existing': 'Già in questa giornata',+ 'journey.dayImport.untitled': 'Voce senza titolo',+ 'journey.dayImport.draft': 'Bozza',+ 'journey.dayImport.audience':+ 'Le bozze non compaiono nei link condivisi. Altre {count} persone di questo viaggio le vedono.',+ 'journey.dayImport.audience.one':+ 'Le bozze non compaiono nei link condivisi. {count} altra persona di questo viaggio le vede.',+ 'journey.dayImport.draftsNote':+ 'Le bozze non compaiono nei link condivisi finché non le pubblichi. Aggiungi foto e testo in seguito.',+ 'journey.dayImport.submit': 'Riprendi {count} bozze',+ 'journey.dayImport.submit.one': 'Riprendi {count} bozza',+ 'journey.dayImport.skipped': '{count} escluse',+ 'journey.dayImport.skipped.one': '{count} esclusa',+ 'journey.dayImport.skipHint':+ 'Le soste escluse non sono più in attesa in questa giornata. Puoi ripristinarle nell’elenco delle soste di Dawarich.',+ 'journey.dayImport.problem.nothing': 'Scegli almeno una sosta.',+ 'journey.dayImport.problem.name': 'Ogni sosta scelta ha bisogno di un nome.',+ 'journey.dayImport.problem.title': 'Ogni voce unita e il resoconto del giorno hanno bisogno di un titolo.',+ 'journey.dayImport.done': '{count} bozze riprese',+ 'journey.dayImport.done.one': '{count} bozza ripresa',+ 'journey.dayImport.alreadyTaken': '{count} soste erano già nel diario. Nulla è stato scritto due volte.',+ 'journey.dayImport.alreadyTaken.one': '{count} sosta era già nel diario. Nulla è stato scritto due volte.',+ 'journey.dayImport.failed':+ 'Non è stato ripreso nulla: {reason} L’elenco mostra ciò che il diario contiene ora; riprovare non scrive nulla due volte.',+ 'journey.dayImport.routeFailed': 'Le bozze sono state create, ma il percorso non è stato conservato: {reason}',+ 'journey.dayImport.routeRetry': 'Conserva di nuovo il percorso',+ 'journey.dayImport.stale':+ 'Dawarich non ha risposto: {reason} Vengono mostrate le soste dell’ultima sincronizzazione del {date}.',+ 'journey.dayImport.staleNever': 'Dawarich non ha risposto: {reason} Vengono mostrate le soste che TREK conosce già.',+ 'journey.dayImport.truncated':+ 'Dawarich ha inviato solo una parte di questa giornata. Alcune soste potrebbero mancare.',+ 'journey.dayImport.empty': 'Dawarich non ha trovato soste in questa giornata.',};export default journey;diff --git a/shared/src/i18n/ja/journey.ts b/shared/src/i18n/ja/journey.tsindex 9b94ffd20..6ae6df604 100644--- a/shared/src/i18n/ja/journey.ts+++ b/shared/src/i18n/ja/journey.ts@@ -746,5 +746,61 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': '船','journey.recording.mode.stationary': '停止','journey.recording.mode.unknown': '不明な手段',+ 'journey.dayImport.open': '1日を取り込む',+ 'journey.dayImport.openHint': 'この日を滞在先ごと取り込む',+ 'journey.dayImport.openOn': '{date}を滞在先ごと取り込む',+ 'journey.dayImport.pending': '確認待ちの滞在先 {count} 件',+ 'journey.dayImport.sub': 'この日のDawarichの滞在先です。選んで名前を直し、まとめると下書きになります。',+ 'journey.dayImport.loading': 'この日の滞在先をDawarichから読み込み中…',+ 'journey.dayImport.map': '地図で見るこの日',+ 'journey.dayImport.stays': '滞在先',+ 'journey.dayImport.modeEntries': 'エントリー',+ 'journey.dayImport.modeReport': '1日のレポート',+ 'journey.dayImport.reportDefault': '{date}の1日',+ 'journey.dayImport.reportHint':+ '選んだ滞在先はすべて、時刻付きで並べた1つのエントリーになります。各場所は地図用に残ります。',+ 'journey.dayImport.reportNeedsTwo': '1日のレポートには滞在先を2つ以上選んでください。',+ 'journey.dayImport.groupTitle': 'エントリーのタイトル',+ 'journey.dayImport.groupPin': '地図上の位置',+ 'journey.dayImport.noPin': '地図上の位置なし',+ 'journey.dayImport.join': '1つのエントリーにまとめる',+ 'journey.dayImport.split': '別々にする',+ 'journey.dayImport.choose': '{name}を取り込む',+ 'journey.dayImport.name': '{name}の名前',+ 'journey.dayImport.unconfirmed': '未確認',+ 'journey.dayImport.noPlace': '位置なし',+ 'journey.dayImport.noPlaceHint': 'Dawarichはこの滞在先の位置を記録していないため、エントリーは地図に表示されません。',+ 'journey.dayImport.statusHere': '{title}に含まれています',+ 'journey.dayImport.statusHereUntitled': 'ジャーナルに含まれています',+ 'journey.dayImport.statusElsewhere': '取り込み済み',+ 'journey.dayImport.statusElsewhereHint': '場所や願い事として、または別のジャーナルにすでに取り込まれています。',+ 'journey.dayImport.statusSkipped': '除外済み',+ 'journey.dayImport.keepRoute': 'この日のルートも保存する',+ 'journey.dayImport.keepRouteHint': '{distance}を記録。旅のメンバー全員が地図で見られます。',+ 'journey.dayImport.routeNone': 'Dawarichはこの日のルートを記録していません。',+ 'journey.dayImport.routeKept': 'ルート保存済み',+ 'journey.dayImport.routeDiffers':+ 'Dawarichに別のバージョンのルートがあります。この日のルートボタンから置き換えてください。',+ 'journey.dayImport.existing': 'この日にすでにあるもの',+ 'journey.dayImport.untitled': '無題のエントリー',+ 'journey.dayImport.draft': '下書き',+ 'journey.dayImport.audience': '下書きは共有リンクには表示されません。この旅の他の {count} 人には見えます。',+ 'journey.dayImport.draftsNote': '下書きは公開するまで共有リンクに表示されません。写真や本文は後から追加できます。',+ 'journey.dayImport.submit': '下書き {count} 件を取り込む',+ 'journey.dayImport.skipped': '除外 {count} 件',+ 'journey.dayImport.skipHint': '除外した滞在先はこの日の確認待ちから外れます。Dawarichの滞在先リストで元に戻せます。',+ 'journey.dayImport.problem.nothing': '滞在先を1つ以上選んでください。',+ 'journey.dayImport.problem.name': '選んだ滞在先にはすべて名前が必要です。',+ 'journey.dayImport.problem.title': 'まとめたエントリーと1日のレポートにはタイトルが必要です。',+ 'journey.dayImport.done': '下書き {count} 件を取り込みました',+ 'journey.dayImport.alreadyTaken': '{count} 件の滞在先はすでにジャーナルにありました。二重には書き込まれていません。',+ 'journey.dayImport.failed':+ '何も取り込まれませんでした: {reason} リストは現在のジャーナルの内容を示しています。再試行しても二重には書き込まれません。',+ 'journey.dayImport.routeFailed': '下書きは作成されましたが、ルートは保存されませんでした: {reason}',+ 'journey.dayImport.routeRetry': 'ルートをもう一度保存',+ 'journey.dayImport.stale': 'Dawarichが応答しませんでした: {reason} {date}の前回の同期で得た滞在先を表示しています。',+ 'journey.dayImport.staleNever': 'Dawarichが応答しませんでした: {reason} TREKが把握している滞在先を表示しています。',+ 'journey.dayImport.truncated': 'Dawarichはこの日の一部しか送ってきませんでした。滞在先が欠けている可能性があります。',+ 'journey.dayImport.empty': 'Dawarichはこの日の滞在先を見つけられませんでした。',};export default journey;diff --git a/shared/src/i18n/ko/journey.ts b/shared/src/i18n/ko/journey.tsindex e769447fd..57dd9f461 100644--- a/shared/src/i18n/ko/journey.ts+++ b/shared/src/i18n/ko/journey.ts@@ -743,5 +743,61 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': '배','journey.recording.mode.stationary': '정지','journey.recording.mode.unknown': '알 수 없는 수단',+ 'journey.dayImport.open': '하루 가져오기',+ 'journey.dayImport.openHint': '이 날을 머문 곳과 함께 가져오기',+ 'journey.dayImport.openOn': '{date}을 머문 곳과 함께 가져오기',+ 'journey.dayImport.pending': '확인할 머문 곳 {count}개',+ 'journey.dayImport.sub': '이 날 Dawarich에 기록된 머문 곳입니다. 고르고 이름을 고치고 합치면 초안이 됩니다.',+ 'journey.dayImport.loading': 'Dawarich에서 이 날의 머문 곳을 읽는 중…',+ 'journey.dayImport.map': '지도에서 본 하루',+ 'journey.dayImport.stays': '머문 곳',+ 'journey.dayImport.modeEntries': '항목',+ 'journey.dayImport.modeReport': '하루 기록',+ 'journey.dayImport.reportDefault': '{date}의 하루',+ 'journey.dayImport.reportHint':+ '선택한 머문 곳이 모두 시간과 함께 나열된 하나의 항목이 됩니다. 각 장소는 지도용으로 남습니다.',+ 'journey.dayImport.reportNeedsTwo': '하루 기록에는 머문 곳을 두 개 이상 고르세요.',+ 'journey.dayImport.groupTitle': '항목 제목',+ 'journey.dayImport.groupPin': '지도 위치',+ 'journey.dayImport.noPin': '지도 위치 없음',+ 'journey.dayImport.join': '하나의 항목으로 합치기',+ 'journey.dayImport.split': '따로 두기',+ 'journey.dayImport.choose': '{name} 가져오기',+ 'journey.dayImport.name': '{name}의 이름',+ 'journey.dayImport.unconfirmed': '미확인',+ 'journey.dayImport.noPlace': '위치 없음',+ 'journey.dayImport.noPlaceHint': 'Dawarich가 이 머문 곳의 위치를 기록하지 않아 항목이 지도에 표시되지 않습니다.',+ 'journey.dayImport.statusHere': '{title}에 있음',+ 'journey.dayImport.statusHereUntitled': '저널에 있음',+ 'journey.dayImport.statusElsewhere': '가져옴',+ 'journey.dayImport.statusElsewhereHint': '이미 장소나 위시로, 또는 다른 저널로 가져왔습니다.',+ 'journey.dayImport.statusSkipped': '제외됨',+ 'journey.dayImport.keepRoute': '이 날의 경로도 저장',+ 'journey.dayImport.keepRouteHint': '{distance} 기록됨. 여행의 모든 사람이 지도에서 봅니다.',+ 'journey.dayImport.routeNone': 'Dawarich가 이 날 경로를 기록하지 않았습니다.',+ 'journey.dayImport.routeKept': '경로 저장됨',+ 'journey.dayImport.routeDiffers': 'Dawarich에 다른 버전의 경로가 있습니다. 이 날의 경로 버튼으로 바꾸세요.',+ 'journey.dayImport.existing': '이 날에 이미 있음',+ 'journey.dayImport.untitled': '제목 없는 항목',+ 'journey.dayImport.draft': '초안',+ 'journey.dayImport.audience': '초안은 공유 링크에 나타나지 않습니다. 이 여행의 다른 {count}명이 볼 수 있습니다.',+ 'journey.dayImport.draftsNote': '초안은 게시할 때까지 공유 링크에 나타나지 않습니다. 사진과 글은 나중에 추가하세요.',+ 'journey.dayImport.submit': '초안 {count}개 가져오기',+ 'journey.dayImport.skipped': '{count}개 제외',+ 'journey.dayImport.skipHint':+ '제외한 머문 곳은 이 날 더 이상 대기하지 않습니다. Dawarich 머문 곳 목록에서 되살릴 수 있습니다.',+ 'journey.dayImport.problem.nothing': '머문 곳을 하나 이상 고르세요.',+ 'journey.dayImport.problem.name': '선택한 머문 곳마다 이름이 필요합니다.',+ 'journey.dayImport.problem.title': '합친 항목과 하루 기록에는 제목이 필요합니다.',+ 'journey.dayImport.done': '초안 {count}개를 가져왔습니다',+ 'journey.dayImport.alreadyTaken': '머문 곳 {count}개는 이미 저널에 있었습니다. 중복으로 기록된 것은 없습니다.',+ 'journey.dayImport.failed':+ '아무것도 가져오지 못했습니다: {reason} 목록은 지금 저널에 있는 내용을 보여 줍니다. 다시 시도해도 중복 기록되지 않습니다.',+ 'journey.dayImport.routeFailed': '초안은 만들어졌지만 경로는 저장되지 않았습니다: {reason}',+ 'journey.dayImport.routeRetry': '경로 다시 저장',+ 'journey.dayImport.stale': 'Dawarich가 응답하지 않았습니다: {reason} {date} 마지막 동기화의 머문 곳을 보여 줍니다.',+ 'journey.dayImport.staleNever': 'Dawarich가 응답하지 않았습니다: {reason} TREK가 이미 아는 머문 곳을 보여 줍니다.',+ 'journey.dayImport.truncated': 'Dawarich가 이 날의 일부만 보냈습니다. 빠진 머문 곳이 있을 수 있습니다.',+ 'journey.dayImport.empty': 'Dawarich가 이 날 머문 곳을 찾지 못했습니다.',};export default journey;diff --git a/shared/src/i18n/nl/journey.ts b/shared/src/i18n/nl/journey.tsindex 52e336247..6e67d21c0 100644--- a/shared/src/i18n/nl/journey.ts+++ b/shared/src/i18n/nl/journey.ts@@ -771,5 +771,74 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Boot','journey.recording.mode.stationary': 'Stilstand','journey.recording.mode.unknown': 'Onbekende vervoerswijze',+ 'journey.dayImport.open': 'Dag overnemen',+ 'journey.dayImport.openHint': 'Deze dag met zijn verblijven overnemen',+ 'journey.dayImport.openOn': '{date} met verblijven overnemen',+ 'journey.dayImport.pending': '{count} verblijven om na te kijken',+ 'journey.dayImport.pending.one': '{count} verblijf om na te kijken',+ 'journey.dayImport.sub':+ 'Je verblijven uit Dawarich op deze dag. Kies, hernoem en voeg ze samen; ze worden concepten.',+ 'journey.dayImport.loading': 'Verblijven van de dag worden uit Dawarich gelezen…',+ 'journey.dayImport.map': 'Dag op de kaart',+ 'journey.dayImport.stays': 'Verblijven',+ 'journey.dayImport.modeEntries': 'Items',+ 'journey.dayImport.modeReport': 'Dagverslag',+ 'journey.dayImport.reportDefault': 'Dag van {date}',+ 'journey.dayImport.reportHint':+ 'Alle gekozen verblijven worden één item dat ze met hun tijden opsomt. Elke plek blijft bewaard voor de kaart.',+ 'journey.dayImport.reportNeedsTwo': 'Kies twee of meer verblijven voor een dagverslag.',+ 'journey.dayImport.groupTitle': 'Titel van het item',+ 'journey.dayImport.groupPin': 'Positie op de kaart',+ 'journey.dayImport.noPin': 'Geen positie op de kaart',+ 'journey.dayImport.join': 'Samenvoegen tot één item',+ 'journey.dayImport.split': 'Apart houden',+ 'journey.dayImport.choose': '{name} overnemen',+ 'journey.dayImport.name': 'Naam van {name}',+ 'journey.dayImport.unconfirmed': 'Onbevestigd',+ 'journey.dayImport.noPlace': 'Zonder positie',+ 'journey.dayImport.noPlaceHint':+ 'Dawarich heeft voor dit verblijf geen positie vastgelegd, dus het item staat niet op de kaart.',+ 'journey.dayImport.statusHere': 'In {title}', // same-as-en+ 'journey.dayImport.statusHereUntitled': 'In het dagboek',+ 'journey.dayImport.statusElsewhere': 'Overgenomen',+ 'journey.dayImport.statusElsewhereHint': 'Al overgenomen als plek, als wens of in een ander dagboek.',+ 'journey.dayImport.statusSkipped': 'Weggelaten',+ 'journey.dayImport.keepRoute': 'Ook de route van de dag bewaren',+ 'journey.dayImport.keepRouteHint': '{distance} vastgelegd. Iedereen in de reis ziet hem op de kaart.',+ 'journey.dayImport.routeNone': 'Dawarich heeft op deze dag geen route vastgelegd.',+ 'journey.dayImport.routeKept': 'Route bewaard',+ 'journey.dayImport.routeDiffers':+ 'Dawarich heeft nu een andere versie van de route. Vervang die met de routeknop van de dag.',+ 'journey.dayImport.existing': 'Al op deze dag',+ 'journey.dayImport.untitled': 'Item zonder titel',+ 'journey.dayImport.draft': 'Concept',+ 'journey.dayImport.audience':+ 'Concepten verschijnen niet in gedeelde links. {count} andere mensen in deze reis zien ze.',+ 'journey.dayImport.audience.one':+ 'Concepten verschijnen niet in gedeelde links. {count} ander persoon in deze reis ziet ze.',+ 'journey.dayImport.draftsNote':+ 'Concepten verschijnen niet in gedeelde links tot je ze publiceert. Voeg daarna foto’s en tekst toe.',+ 'journey.dayImport.submit': '{count} concepten overnemen',+ 'journey.dayImport.submit.one': '{count} concept overnemen',+ 'journey.dayImport.skipped': '{count} weggelaten',+ 'journey.dayImport.skipped.one': '{count} weggelaten',+ 'journey.dayImport.skipHint':+ 'Weggelaten verblijven wachten op deze dag niet meer. Je kunt ze herstellen in de verblijvenlijst van Dawarich.',+ 'journey.dayImport.problem.nothing': 'Kies minstens één verblijf.',+ 'journey.dayImport.problem.name': 'Elk gekozen verblijf heeft een naam nodig.',+ 'journey.dayImport.problem.title': 'Elk samengevoegd item en het dagverslag hebben een titel nodig.',+ 'journey.dayImport.done': '{count} concepten overgenomen',+ 'journey.dayImport.done.one': '{count} concept overgenomen',+ 'journey.dayImport.alreadyTaken': '{count} verblijven stonden al in het dagboek. Er is niets dubbel geschreven.',+ 'journey.dayImport.alreadyTaken.one': '{count} verblijf stond al in het dagboek. Er is niets dubbel geschreven.',+ 'journey.dayImport.failed':+ 'Er is niets overgenomen: {reason} De lijst toont wat het dagboek nu bevat; opnieuw proberen schrijft niets dubbel.',+ 'journey.dayImport.routeFailed': 'De concepten staan erin, maar de route is niet bewaard: {reason}',+ 'journey.dayImport.routeRetry': 'Route opnieuw bewaren',+ 'journey.dayImport.stale':+ 'Dawarich antwoordde niet: {reason} Je ziet de verblijven van de laatste synchronisatie op {date}.',+ 'journey.dayImport.staleNever': 'Dawarich antwoordde niet: {reason} Je ziet de verblijven die TREK al kent.',+ 'journey.dayImport.truncated': 'Dawarich stuurde maar een deel van deze dag. Er kunnen verblijven ontbreken.',+ 'journey.dayImport.empty': 'Dawarich vond op deze dag geen verblijven.',};export default journey;diff --git a/shared/src/i18n/pl/journey.ts b/shared/src/i18n/pl/journey.tsindex a41eb51fa..bc4fd335a 100644--- a/shared/src/i18n/pl/journey.ts+++ b/shared/src/i18n/pl/journey.ts@@ -799,5 +799,84 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Łódź','journey.recording.mode.stationary': 'W miejscu','journey.recording.mode.unknown': 'Nieznany środek',+ 'journey.dayImport.open': 'Przejmij dzień',+ 'journey.dayImport.openHint': 'Przejmij ten dzień razem z postojami',+ 'journey.dayImport.openOn': 'Przejmij {date} razem z postojami',+ 'journey.dayImport.pending': '{count} postoju do przejrzenia',+ 'journey.dayImport.pending.one': '{count} postój do przejrzenia',+ 'journey.dayImport.pending.few': '{count} postoje do przejrzenia',+ 'journey.dayImport.pending.many': '{count} postojów do przejrzenia',+ 'journey.dayImport.sub': 'Twoje postoje z Dawarich tego dnia. Wybierz je, zmień nazwy i połącz; staną się szkicami.',+ 'journey.dayImport.loading': 'Wczytywanie postojów dnia z Dawarich…',+ 'journey.dayImport.map': 'Dzień na mapie',+ 'journey.dayImport.stays': 'Postoje',+ 'journey.dayImport.modeEntries': 'Wpisy',+ 'journey.dayImport.modeReport': 'Relacja dnia',+ 'journey.dayImport.reportDefault': 'Dzień {date}',+ 'journey.dayImport.reportHint':+ 'Wszystkie wybrane postoje staną się jednym wpisem, który wymienia je z godzinami. Każde miejsce zostaje zapisane dla mapy.',+ 'journey.dayImport.reportNeedsTwo': 'Na relację dnia wybierz dwa lub więcej postojów.',+ 'journey.dayImport.groupTitle': 'Tytuł wpisu',+ 'journey.dayImport.groupPin': 'Pozycja na mapie',+ 'journey.dayImport.noPin': 'Bez pozycji na mapie',+ 'journey.dayImport.join': 'Połącz w jeden wpis',+ 'journey.dayImport.split': 'Zostaw osobno',+ 'journey.dayImport.choose': 'Przejmij {name}',+ 'journey.dayImport.name': 'Nazwa dla {name}',+ 'journey.dayImport.unconfirmed': 'Niepotwierdzony',+ 'journey.dayImport.noPlace': 'Bez pozycji',+ 'journey.dayImport.noPlaceHint': 'Dawarich nie zapisał pozycji tego postoju, więc jego wpis nie pojawi się na mapie.',+ 'journey.dayImport.statusHere': 'We wpisie {title}',+ 'journey.dayImport.statusHereUntitled': 'W dzienniku',+ 'journey.dayImport.statusElsewhere': 'Przejęty',+ 'journey.dayImport.statusElsewhereHint': 'Już przejęty jako miejsce, życzenie albo do innego dziennika.',+ 'journey.dayImport.statusSkipped': 'Pominięty',+ 'journey.dayImport.keepRoute': 'Zapisz też trasę dnia',+ 'journey.dayImport.keepRouteHint': 'Zapisano {distance}. Wszyscy w podróży zobaczą ją na mapie.',+ 'journey.dayImport.routeNone': 'Dawarich nie zapisał tego dnia żadnej trasy.',+ 'journey.dayImport.routeKept': 'Trasa zapisana',+ 'journey.dayImport.routeDiffers': 'Dawarich ma teraz inną wersję trasy. Zastąp ją przyciskiem trasy tego dnia.',+ 'journey.dayImport.existing': 'Już tego dnia',+ 'journey.dayImport.untitled': 'Wpis bez tytułu',+ 'journey.dayImport.draft': 'Szkic',+ 'journey.dayImport.audience':+ 'Szkice nie pojawiają się w udostępnionych linkach. Widzi je {count} innej osoby w tej podróży.',+ 'journey.dayImport.audience.one':+ 'Szkice nie pojawiają się w udostępnionych linkach. Widzi je {count} inna osoba w tej podróży.',+ 'journey.dayImport.audience.few':+ 'Szkice nie pojawiają się w udostępnionych linkach. Widzą je {count} inne osoby w tej podróży.',+ 'journey.dayImport.audience.many':+ 'Szkice nie pojawiają się w udostępnionych linkach. Widzi je {count} innych osób w tej podróży.',+ 'journey.dayImport.draftsNote':+ 'Szkice nie pojawiają się w udostępnionych linkach, dopóki ich nie opublikujesz. Zdjęcia i tekst dodasz później.',+ 'journey.dayImport.submit': 'Przejmij {count} szkicu',+ 'journey.dayImport.submit.one': 'Przejmij {count} szkic',+ 'journey.dayImport.submit.few': 'Przejmij {count} szkice',+ 'journey.dayImport.submit.many': 'Przejmij {count} szkiców',+ 'journey.dayImport.skipped': '{count} pominiętego',+ 'journey.dayImport.skipped.one': '{count} pominięty',+ 'journey.dayImport.skipped.few': '{count} pominięte',+ 'journey.dayImport.skipped.many': '{count} pominiętych',+ 'journey.dayImport.skipHint':+ 'Pominięte postoje nie czekają już tego dnia. Możesz je przywrócić na liście postojów Dawarich.',+ 'journey.dayImport.problem.nothing': 'Wybierz co najmniej jeden postój.',+ 'journey.dayImport.problem.name': 'Każdy wybrany postój potrzebuje nazwy.',+ 'journey.dayImport.problem.title': 'Każdy połączony wpis i relacja dnia potrzebują tytułu.',+ 'journey.dayImport.done': 'Przejęto {count} szkicu',+ 'journey.dayImport.done.one': 'Przejęto {count} szkic',+ 'journey.dayImport.done.few': 'Przejęto {count} szkice',+ 'journey.dayImport.done.many': 'Przejęto {count} szkiców',+ 'journey.dayImport.alreadyTaken': '{count} postoju było już w dzienniku. Nic nie zapisano dwa razy.',+ 'journey.dayImport.alreadyTaken.one': '{count} postój był już w dzienniku. Nic nie zapisano dwa razy.',+ 'journey.dayImport.alreadyTaken.few': '{count} postoje były już w dzienniku. Nic nie zapisano dwa razy.',+ 'journey.dayImport.alreadyTaken.many': '{count} postojów było już w dzienniku. Nic nie zapisano dwa razy.',+ 'journey.dayImport.failed':+ 'Nic nie przejęto: {reason} Lista pokazuje, co jest teraz w dzienniku; ponowna próba nic nie zapisze dwa razy.',+ 'journey.dayImport.routeFailed': 'Szkice zostały utworzone, ale trasy nie zapisano: {reason}',+ 'journey.dayImport.routeRetry': 'Zapisz trasę ponownie',+ 'journey.dayImport.stale': 'Dawarich nie odpowiedział: {reason} Widać postoje z ostatniej synchronizacji {date}.',+ 'journey.dayImport.staleNever': 'Dawarich nie odpowiedział: {reason} Widać postoje, które TREK już zna.',+ 'journey.dayImport.truncated': 'Dawarich przesłał tylko część tego dnia. Może brakować postojów.',+ 'journey.dayImport.empty': 'Dawarich nie znalazł tego dnia żadnych postojów.',};export default journey;diff --git a/shared/src/i18n/ru/journey.ts b/shared/src/i18n/ru/journey.tsindex 36a362da4..8061450b7 100644--- a/shared/src/i18n/ru/journey.ts+++ b/shared/src/i18n/ru/journey.ts@@ -799,5 +799,83 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Лодка','journey.recording.mode.stationary': 'На месте','journey.recording.mode.unknown': 'Неизвестный способ',+ 'journey.dayImport.open': 'Перенести день',+ 'journey.dayImport.openHint': 'Перенести этот день вместе с остановками',+ 'journey.dayImport.openOn': 'Перенести {date} вместе с остановками',+ 'journey.dayImport.pending': '{count} остановки на проверку',+ 'journey.dayImport.pending.one': '{count} остановка на проверку',+ 'journey.dayImport.pending.few': '{count} остановки на проверку',+ 'journey.dayImport.pending.many': '{count} остановок на проверку',+ 'journey.dayImport.sub':+ 'Ваши остановки из Dawarich за этот день. Выберите, переименуйте и объедините их; они станут черновиками.',+ 'journey.dayImport.loading': 'Загрузка остановок дня из Dawarich…',+ 'journey.dayImport.map': 'День на карте',+ 'journey.dayImport.stays': 'Остановки',+ 'journey.dayImport.modeEntries': 'Записи',+ 'journey.dayImport.modeReport': 'Отчёт за день',+ 'journey.dayImport.reportDefault': 'День {date}',+ 'journey.dayImport.reportHint':+ 'Все выбранные остановки станут одной записью, где они перечислены со временем. Каждое место сохранится для карты.',+ 'journey.dayImport.reportNeedsTwo': 'Для отчёта за день выберите две или больше остановок.',+ 'journey.dayImport.groupTitle': 'Заголовок записи',+ 'journey.dayImport.groupPin': 'Место на карте',+ 'journey.dayImport.noPin': 'Без места на карте',+ 'journey.dayImport.join': 'Объединить в одну запись',+ 'journey.dayImport.split': 'Оставить раздельно',+ 'journey.dayImport.choose': 'Перенести {name}',+ 'journey.dayImport.name': 'Название для {name}',+ 'journey.dayImport.unconfirmed': 'Не подтверждена',+ 'journey.dayImport.noPlace': 'Без координат',+ 'journey.dayImport.noPlaceHint':+ 'Dawarich не записал координаты этой остановки, поэтому её запись не появится на карте.',+ 'journey.dayImport.statusHere': 'В записи {title}',+ 'journey.dayImport.statusHereUntitled': 'В дневнике',+ 'journey.dayImport.statusElsewhere': 'Перенесена',+ 'journey.dayImport.statusElsewhereHint': 'Уже перенесена как место, как желание или в другой дневник.',+ 'journey.dayImport.statusSkipped': 'Пропущена',+ 'journey.dayImport.keepRoute': 'Сохранить и маршрут дня',+ 'journey.dayImport.keepRouteHint': 'Записано {distance}. Все участники путешествия увидят его на карте.',+ 'journey.dayImport.routeNone': 'Dawarich не записал маршрут в этот день.',+ 'journey.dayImport.routeKept': 'Маршрут сохранён',+ 'journey.dayImport.routeDiffers': 'В Dawarich теперь другая версия маршрута. Замените её кнопкой маршрута этого дня.',+ 'journey.dayImport.existing': 'Уже в этом дне',+ 'journey.dayImport.untitled': 'Запись без заголовка',+ 'journey.dayImport.draft': 'Черновик',+ 'journey.dayImport.audience': 'Черновики не видны по общим ссылкам. Их видят ещё {count} участника путешествия.',+ 'journey.dayImport.audience.one': 'Черновики не видны по общим ссылкам. Их видит ещё {count} участник путешествия.',+ 'journey.dayImport.audience.few': 'Черновики не видны по общим ссылкам. Их видят ещё {count} участника путешествия.',+ 'journey.dayImport.audience.many':+ 'Черновики не видны по общим ссылкам. Их видят ещё {count} участников путешествия.',+ 'journey.dayImport.draftsNote':+ 'Черновики не видны по общим ссылкам, пока вы их не опубликуете. Фото и текст добавьте потом.',+ 'journey.dayImport.submit': 'Перенести {count} черновика',+ 'journey.dayImport.submit.one': 'Перенести {count} черновик',+ 'journey.dayImport.submit.few': 'Перенести {count} черновика',+ 'journey.dayImport.submit.many': 'Перенести {count} черновиков',+ 'journey.dayImport.skipped': '{count} пропущено',+ 'journey.dayImport.skipped.one': '{count} пропущена',+ 'journey.dayImport.skipped.few': '{count} пропущены',+ 'journey.dayImport.skipped.many': '{count} пропущено',+ 'journey.dayImport.skipHint':+ 'Пропущенные остановки больше не ждут в этом дне. Их можно восстановить в списке остановок Dawarich.',+ 'journey.dayImport.problem.nothing': 'Выберите хотя бы одну остановку.',+ 'journey.dayImport.problem.name': 'У каждой выбранной остановки должно быть название.',+ 'journey.dayImport.problem.title': 'У каждой объединённой записи и у отчёта за день должен быть заголовок.',+ 'journey.dayImport.done': 'Перенесено {count} черновика',+ 'journey.dayImport.done.one': 'Перенесён {count} черновик',+ 'journey.dayImport.done.few': 'Перенесено {count} черновика',+ 'journey.dayImport.done.many': 'Перенесено {count} черновиков',+ 'journey.dayImport.alreadyTaken': '{count} остановки уже были в дневнике. Ничего не записано дважды.',+ 'journey.dayImport.alreadyTaken.one': '{count} остановка уже была в дневнике. Ничего не записано дважды.',+ 'journey.dayImport.alreadyTaken.few': '{count} остановки уже были в дневнике. Ничего не записано дважды.',+ 'journey.dayImport.alreadyTaken.many': '{count} остановок уже было в дневнике. Ничего не записано дважды.',+ 'journey.dayImport.failed':+ 'Ничего не перенесено: {reason} Список показывает, что сейчас в дневнике; повторная попытка ничего не запишет дважды.',+ 'journey.dayImport.routeFailed': 'Черновики созданы, но маршрут не сохранён: {reason}',+ 'journey.dayImport.routeRetry': 'Сохранить маршрут снова',+ 'journey.dayImport.stale': 'Dawarich не ответил: {reason} Показаны остановки последней синхронизации {date}.',+ 'journey.dayImport.staleNever': 'Dawarich не ответил: {reason} Показаны остановки, которые TREK уже знает.',+ 'journey.dayImport.truncated': 'Dawarich прислал только часть этого дня. Некоторых остановок может не хватать.',+ 'journey.dayImport.empty': 'Dawarich не нашёл остановок в этот день.',};export default journey;diff --git a/shared/src/i18n/sk/journey.ts b/shared/src/i18n/sk/journey.tsindex 922c26bc8..82578579b 100644--- a/shared/src/i18n/sk/journey.ts+++ b/shared/src/i18n/sk/journey.ts@@ -782,5 +782,78 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Loď','journey.recording.mode.stationary': 'Na mieste','journey.recording.mode.unknown': 'Neznámy spôsob',+ 'journey.dayImport.open': 'Prevziať deň',+ 'journey.dayImport.openHint': 'Prevziať tento deň aj s pobytmi',+ 'journey.dayImport.openOn': 'Prevziať {date} aj s pobytmi',+ 'journey.dayImport.pending': '{count} pobytov na kontrolu',+ 'journey.dayImport.pending.one': '{count} pobyt na kontrolu',+ 'journey.dayImport.pending.few': '{count} pobyty na kontrolu',+ 'journey.dayImport.sub': 'Tvoje pobyty z Dawarich v tento deň. Vyber ich, premenuj a spoj; stanú sa z nich koncepty.',+ 'journey.dayImport.loading': 'Načítavajú sa pobyty dňa z Dawarich…',+ 'journey.dayImport.map': 'Deň na mape',+ 'journey.dayImport.stays': 'Pobyty',+ 'journey.dayImport.modeEntries': 'Záznamy',+ 'journey.dayImport.modeReport': 'Denná správa',+ 'journey.dayImport.reportDefault': 'Deň {date}',+ 'journey.dayImport.reportHint':+ 'Všetky vybrané pobyty sa stanú jedným záznamom, ktorý ich vypíše aj s časmi. Každé miesto zostane uložené pre mapu.',+ 'journey.dayImport.reportNeedsTwo': 'Na dennú správu vyber dva alebo viac pobytov.',+ 'journey.dayImport.groupTitle': 'Názov záznamu',+ 'journey.dayImport.groupPin': 'Poloha na mape',+ 'journey.dayImport.noPin': 'Bez polohy na mape',+ 'journey.dayImport.join': 'Spojiť do jedného záznamu',+ 'journey.dayImport.split': 'Nechať oddelene',+ 'journey.dayImport.choose': 'Prevziať {name}',+ 'journey.dayImport.name': 'Názov pre {name}',+ 'journey.dayImport.unconfirmed': 'Nepotvrdené',+ 'journey.dayImport.noPlace': 'Bez polohy',+ 'journey.dayImport.noPlaceHint':+ 'Dawarich pre tento pobyt nezaznamenal polohu, preto sa jeho záznam na mape nezobrazí.',+ 'journey.dayImport.statusHere': 'V zázname {title}',+ 'journey.dayImport.statusHereUntitled': 'V denníku',+ 'journey.dayImport.statusElsewhere': 'Prevzaté',+ 'journey.dayImport.statusElsewhereHint': 'Už prevzaté ako miesto, želanie alebo do iného denníka.',+ 'journey.dayImport.statusSkipped': 'Vynechané',+ 'journey.dayImport.keepRoute': 'Uložiť aj trasu dňa',+ 'journey.dayImport.keepRouteHint': 'Zaznamenané {distance}. Všetci na ceste ju uvidia na mape.',+ 'journey.dayImport.routeNone': 'Dawarich v tento deň nezaznamenal žiadnu trasu.',+ 'journey.dayImport.routeKept': 'Trasa uložená',+ 'journey.dayImport.routeDiffers': 'Dawarich má teraz inú verziu trasy. Nahraď ju tlačidlom trasy daného dňa.',+ 'journey.dayImport.existing': 'Už v tento deň',+ 'journey.dayImport.untitled': 'Záznam bez názvu',+ 'journey.dayImport.draft': 'Koncept',+ 'journey.dayImport.audience':+ 'Koncepty sa v zdieľaných odkazoch nezobrazujú. Vidí ich ďalších {count} ľudí na tejto ceste.',+ 'journey.dayImport.audience.one':+ 'Koncepty sa v zdieľaných odkazoch nezobrazujú. Vidí ich {count} ďalší človek na tejto ceste.',+ 'journey.dayImport.audience.few':+ 'Koncepty sa v zdieľaných odkazoch nezobrazujú. Vidia ich ďalší {count} ľudia na tejto ceste.',+ 'journey.dayImport.draftsNote':+ 'Koncepty sa v zdieľaných odkazoch nezobrazujú, kým ich nezverejníš. Fotky a text pridáš potom.',+ 'journey.dayImport.submit': 'Prevziať {count} konceptov',+ 'journey.dayImport.submit.one': 'Prevziať {count} koncept',+ 'journey.dayImport.submit.few': 'Prevziať {count} koncepty',+ 'journey.dayImport.skipped': '{count} vynechaných',+ 'journey.dayImport.skipped.one': '{count} vynechaný',+ 'journey.dayImport.skipped.few': '{count} vynechané',+ 'journey.dayImport.skipHint':+ 'Vynechané pobyty už v tento deň nečakajú. Obnoviť ich môžeš v zozname pobytov Dawarich.',+ 'journey.dayImport.problem.nothing': 'Vyber aspoň jeden pobyt.',+ 'journey.dayImport.problem.name': 'Každý vybraný pobyt potrebuje názov.',+ 'journey.dayImport.problem.title': 'Každý spojený záznam aj denná správa potrebujú názov.',+ 'journey.dayImport.done': 'Prevzatých {count} konceptov',+ 'journey.dayImport.done.one': 'Prevzatý {count} koncept',+ 'journey.dayImport.done.few': 'Prevzaté {count} koncepty',+ 'journey.dayImport.alreadyTaken': '{count} pobytov už bolo v denníku. Nič sa nezapísalo dvakrát.',+ 'journey.dayImport.alreadyTaken.one': '{count} pobyt už bol v denníku. Nič sa nezapísalo dvakrát.',+ 'journey.dayImport.alreadyTaken.few': '{count} pobyty už boli v denníku. Nič sa nezapísalo dvakrát.',+ 'journey.dayImport.failed':+ 'Nič nebolo prevzaté: {reason} Zoznam ukazuje, čo denník teraz obsahuje; nový pokus nič nezapíše dvakrát.',+ 'journey.dayImport.routeFailed': 'Koncepty sú vytvorené, ale trasa sa neuložila: {reason}',+ 'journey.dayImport.routeRetry': 'Uložiť trasu znova',+ 'journey.dayImport.stale': 'Dawarich neodpovedal: {reason} Zobrazujú sa pobyty z poslednej synchronizácie {date}.',+ 'journey.dayImport.staleNever': 'Dawarich neodpovedal: {reason} Zobrazujú sa pobyty, ktoré TREK už pozná.',+ 'journey.dayImport.truncated': 'Dawarich poslal len časť tohto dňa. Niektoré pobyty môžu chýbať.',+ 'journey.dayImport.empty': 'Dawarich v tento deň nenašiel žiadne pobyty.',};export default journey;diff --git a/shared/src/i18n/sv/journey.ts b/shared/src/i18n/sv/journey.tsindex 30e0cef54..49d3b7685 100644--- a/shared/src/i18n/sv/journey.ts+++ b/shared/src/i18n/sv/journey.ts@@ -765,5 +765,71 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Båt','journey.recording.mode.stationary': 'Stillastående','journey.recording.mode.unknown': 'Okänt färdsätt',+ 'journey.dayImport.open': 'Ta över dag',+ 'journey.dayImport.openHint': 'Ta över den här dagen med dess vistelser',+ 'journey.dayImport.openOn': 'Ta över {date} med vistelser',+ 'journey.dayImport.pending': '{count} vistelser att granska',+ 'journey.dayImport.pending.one': '{count} vistelse att granska',+ 'journey.dayImport.sub':+ 'Dina vistelser från Dawarich den här dagen. Välj, byt namn på och slå ihop dem; de blir utkast.',+ 'journey.dayImport.loading': 'Läser dagens vistelser från Dawarich…',+ 'journey.dayImport.map': 'Dagen på kartan',+ 'journey.dayImport.stays': 'Vistelser',+ 'journey.dayImport.modeEntries': 'Inlägg',+ 'journey.dayImport.modeReport': 'Dagsrapport',+ 'journey.dayImport.reportDefault': 'Dagen {date}',+ 'journey.dayImport.reportHint':+ 'Alla valda vistelser blir ett inlägg som listar dem med sina tider. Varje plats sparas för kartan.',+ 'journey.dayImport.reportNeedsTwo': 'Välj två eller fler vistelser för en dagsrapport.',+ 'journey.dayImport.groupTitle': 'Inläggets rubrik',+ 'journey.dayImport.groupPin': 'Position på kartan',+ 'journey.dayImport.noPin': 'Ingen position på kartan',+ 'journey.dayImport.join': 'Slå ihop till ett inlägg',+ 'journey.dayImport.split': 'Håll isär',+ 'journey.dayImport.choose': 'Ta över {name}',+ 'journey.dayImport.name': 'Namn på {name}',+ 'journey.dayImport.unconfirmed': 'Obekräftad',+ 'journey.dayImport.noPlace': 'Utan position',+ 'journey.dayImport.noPlaceHint':+ 'Dawarich registrerade ingen position för den här vistelsen, så inlägget hamnar inte på kartan.',+ 'journey.dayImport.statusHere': 'I {title}',+ 'journey.dayImport.statusHereUntitled': 'I dagboken',+ 'journey.dayImport.statusElsewhere': 'Övertagen',+ 'journey.dayImport.statusElsewhereHint': 'Redan övertagen som plats, som önskan eller till en annan dagbok.',+ 'journey.dayImport.statusSkipped': 'Utelämnad',+ 'journey.dayImport.keepRoute': 'Spara även dagens rutt',+ 'journey.dayImport.keepRouteHint': '{distance} registrerat. Alla i resan ser den på kartan.',+ 'journey.dayImport.routeNone': 'Dawarich registrerade ingen rutt den här dagen.',+ 'journey.dayImport.routeKept': 'Rutt sparad',+ 'journey.dayImport.routeDiffers': 'Dawarich har nu en annan version av rutten. Ersätt den med dagens ruttknapp.',+ 'journey.dayImport.existing': 'Redan på den här dagen',+ 'journey.dayImport.untitled': 'Inlägg utan rubrik',+ 'journey.dayImport.draft': 'Utkast',+ 'journey.dayImport.audience': 'Utkast syns inte i delade länkar. {count} andra personer i resan ser dem.',+ 'journey.dayImport.audience.one': 'Utkast syns inte i delade länkar. {count} annan person i resan ser dem.',+ 'journey.dayImport.draftsNote':+ 'Utkast syns inte i delade länkar förrän du publicerar dem. Lägg till foton och text efteråt.',+ 'journey.dayImport.submit': 'Ta över {count} utkast',+ 'journey.dayImport.submit.one': 'Ta över {count} utkast',+ 'journey.dayImport.skipped': '{count} utelämnade',+ 'journey.dayImport.skipped.one': '{count} utelämnad',+ 'journey.dayImport.skipHint':+ 'Utelämnade vistelser väntar inte längre på den här dagen. Du kan återställa dem i Dawarichs vistelselista.',+ 'journey.dayImport.problem.nothing': 'Välj minst en vistelse.',+ 'journey.dayImport.problem.name': 'Varje vald vistelse behöver ett namn.',+ 'journey.dayImport.problem.title': 'Varje ihopslaget inlägg och dagsrapporten behöver en rubrik.',+ 'journey.dayImport.done': '{count} utkast övertagna',+ 'journey.dayImport.done.one': '{count} utkast övertaget',+ 'journey.dayImport.alreadyTaken': '{count} vistelser fanns redan i dagboken. Inget skrevs två gånger.',+ 'journey.dayImport.alreadyTaken.one': '{count} vistelse fanns redan i dagboken. Inget skrevs två gånger.',+ 'journey.dayImport.failed':+ 'Inget togs över: {reason} Listan visar vad dagboken innehåller nu; ett nytt försök skriver inget två gånger.',+ 'journey.dayImport.routeFailed': 'Utkasten är sparade, men rutten sparades inte: {reason}',+ 'journey.dayImport.routeRetry': 'Spara rutten igen',+ 'journey.dayImport.stale':+ 'Dawarich svarade inte: {reason} Vistelserna från den senaste synkroniseringen {date} visas.',+ 'journey.dayImport.staleNever': 'Dawarich svarade inte: {reason} Vistelserna som TREK redan känner till visas.',+ 'journey.dayImport.truncated': 'Dawarich skickade bara en del av den här dagen. Vistelser kan saknas.',+ 'journey.dayImport.empty': 'Dawarich hittade inga vistelser den här dagen.',};export default journey;diff --git a/shared/src/i18n/th/journey.ts b/shared/src/i18n/th/journey.tsindex ce5dc9bab..321af9384 100644--- a/shared/src/i18n/th/journey.ts+++ b/shared/src/i18n/th/journey.ts@@ -737,5 +737,60 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'เรือ','journey.recording.mode.stationary': 'อยู่กับที่','journey.recording.mode.unknown': 'ไม่ทราบวิธี',+ 'journey.dayImport.open': 'นำเข้าทั้งวัน',+ 'journey.dayImport.openHint': 'นำเข้าวันนี้พร้อมจุดแวะพัก',+ 'journey.dayImport.openOn': 'นำเข้า {date} พร้อมจุดแวะพัก',+ 'journey.dayImport.pending': 'จุดแวะพัก {count} แห่งรอตรวจ',+ 'journey.dayImport.sub': 'จุดแวะพักของคุณจาก Dawarich ในวันนี้ เลือก เปลี่ยนชื่อ และรวมกันได้ แล้วจะกลายเป็นฉบับร่าง',+ 'journey.dayImport.loading': 'กำลังอ่านจุดแวะพักของวันนี้จาก Dawarich…',+ 'journey.dayImport.map': 'วันนี้บนแผนที่',+ 'journey.dayImport.stays': 'จุดแวะพัก',+ 'journey.dayImport.modeEntries': 'รายการ',+ 'journey.dayImport.modeReport': 'บันทึกประจำวัน',+ 'journey.dayImport.reportDefault': 'วันที่ {date}',+ 'journey.dayImport.reportHint':+ 'จุดแวะพักที่เลือกทั้งหมดจะเป็นรายการเดียวที่แสดงพร้อมเวลา ทุกสถานที่ยังถูกเก็บไว้สำหรับแผนที่',+ 'journey.dayImport.reportNeedsTwo': 'เลือกจุดแวะพักสองแห่งขึ้นไปสำหรับบันทึกประจำวัน',+ 'journey.dayImport.groupTitle': 'ชื่อรายการ',+ 'journey.dayImport.groupPin': 'ตำแหน่งบนแผนที่',+ 'journey.dayImport.noPin': 'ไม่มีตำแหน่งบนแผนที่',+ 'journey.dayImport.join': 'รวมเป็นรายการเดียว',+ 'journey.dayImport.split': 'แยกไว้',+ 'journey.dayImport.choose': 'นำเข้า {name}',+ 'journey.dayImport.name': 'ชื่อของ {name}',+ 'journey.dayImport.unconfirmed': 'ยังไม่ยืนยัน',+ 'journey.dayImport.noPlace': 'ไม่มีตำแหน่ง',+ 'journey.dayImport.noPlaceHint': 'Dawarich ไม่ได้บันทึกตำแหน่งของจุดแวะพักนี้ รายการจึงไม่แสดงบนแผนที่',+ 'journey.dayImport.statusHere': 'อยู่ใน {title}',+ 'journey.dayImport.statusHereUntitled': 'อยู่ในบันทึก',+ 'journey.dayImport.statusElsewhere': 'นำเข้าแล้ว',+ 'journey.dayImport.statusElsewhereHint': 'นำเข้าแล้วเป็นสถานที่ สิ่งที่อยากทำ หรือไปยังบันทึกอื่น',+ 'journey.dayImport.statusSkipped': 'ข้ามแล้ว',+ 'journey.dayImport.keepRoute': 'เก็บเส้นทางของวันนี้ด้วย',+ 'journey.dayImport.keepRouteHint': 'บันทึกไว้ {distance} ทุกคนในทริปจะเห็นบนแผนที่',+ 'journey.dayImport.routeNone': 'Dawarich ไม่ได้บันทึกเส้นทางในวันนี้',+ 'journey.dayImport.routeKept': 'เก็บเส้นทางแล้ว',+ 'journey.dayImport.routeDiffers': 'ตอนนี้ Dawarich มีเส้นทางอีกเวอร์ชันหนึ่ง แทนที่ได้ด้วยปุ่มเส้นทางของวัน',+ 'journey.dayImport.existing': 'มีอยู่แล้วในวันนี้',+ 'journey.dayImport.untitled': 'รายการไม่มีชื่อ',+ 'journey.dayImport.draft': 'ฉบับร่าง',+ 'journey.dayImport.audience': 'ฉบับร่างไม่แสดงในลิงก์ที่แชร์ อีก {count} คนในทริปนี้มองเห็นได้',+ 'journey.dayImport.draftsNote': 'ฉบับร่างไม่แสดงในลิงก์ที่แชร์จนกว่าคุณจะเผยแพร่ เพิ่มรูปภาพและข้อความภายหลังได้',+ 'journey.dayImport.submit': 'นำเข้าฉบับร่าง {count} รายการ',+ 'journey.dayImport.skipped': 'ข้าม {count} แห่ง',+ 'journey.dayImport.skipHint': 'จุดแวะพักที่ข้ามจะไม่รออยู่ในวันนี้อีก กู้คืนได้ในรายการจุดแวะพักของ Dawarich',+ 'journey.dayImport.problem.nothing': 'เลือกจุดแวะพักอย่างน้อยหนึ่งแห่ง',+ 'journey.dayImport.problem.name': 'จุดแวะพักที่เลือกทุกแห่งต้องมีชื่อ',+ 'journey.dayImport.problem.title': 'รายการที่รวมกันและบันทึกประจำวันต้องมีชื่อ',+ 'journey.dayImport.done': 'นำเข้าฉบับร่าง {count} รายการแล้ว',+ 'journey.dayImport.alreadyTaken': 'จุดแวะพัก {count} แห่งอยู่ในบันทึกแล้ว ไม่มีอะไรถูกเขียนซ้ำ',+ 'journey.dayImport.failed':+ 'ยังไม่ได้นำเข้าอะไร: {reason} รายการแสดงสิ่งที่อยู่ในบันทึกตอนนี้ การลองใหม่จะไม่เขียนซ้ำ',+ 'journey.dayImport.routeFailed': 'สร้างฉบับร่างแล้ว แต่ยังไม่ได้เก็บเส้นทาง: {reason}',+ 'journey.dayImport.routeRetry': 'เก็บเส้นทางอีกครั้ง',+ 'journey.dayImport.stale': 'Dawarich ไม่ตอบกลับ: {reason} กำลังแสดงจุดแวะพักจากการซิงก์ครั้งล่าสุดเมื่อ {date}',+ 'journey.dayImport.staleNever': 'Dawarich ไม่ตอบกลับ: {reason} กำลังแสดงจุดแวะพักที่ TREK รู้อยู่แล้ว',+ 'journey.dayImport.truncated': 'Dawarich ส่งมาเพียงบางส่วนของวันนี้ อาจมีจุดแวะพักขาดหายไป',+ 'journey.dayImport.empty': 'Dawarich ไม่พบจุดแวะพักในวันนี้',};export default journey;diff --git a/shared/src/i18n/tr/journey.ts b/shared/src/i18n/tr/journey.tsindex 4c6c58852..79c6e766e 100644--- a/shared/src/i18n/tr/journey.ts+++ b/shared/src/i18n/tr/journey.ts@@ -765,5 +765,71 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Tekne','journey.recording.mode.stationary': 'Durağan','journey.recording.mode.unknown': 'Bilinmeyen tür',+ 'journey.dayImport.open': 'Günü aktar',+ 'journey.dayImport.openHint': 'Bu günü duraklarıyla birlikte aktar',+ 'journey.dayImport.openOn': '{date} gününü duraklarıyla aktar',+ 'journey.dayImport.pending': 'İncelenecek {count} durak',+ 'journey.dayImport.pending.one': 'İncelenecek {count} durak',+ 'journey.dayImport.sub':+ 'Bu gün Dawarich’teki durakların. Seç, yeniden adlandır ve birleştir; taslak olarak eklenirler.',+ 'journey.dayImport.loading': 'Günün durakları Dawarich’ten okunuyor…',+ 'journey.dayImport.map': 'Gün haritada',+ 'journey.dayImport.stays': 'Duraklar',+ 'journey.dayImport.modeEntries': 'Kayıtlar',+ 'journey.dayImport.modeReport': 'Gün raporu',+ 'journey.dayImport.reportDefault': '{date} günü',+ 'journey.dayImport.reportHint':+ 'Seçilen tüm duraklar, saatleriyle listelendikleri tek bir kayıt olur. Her yer harita için saklanır.',+ 'journey.dayImport.reportNeedsTwo': 'Gün raporu için iki veya daha fazla durak seç.',+ 'journey.dayImport.groupTitle': 'Kaydın başlığı',+ 'journey.dayImport.groupPin': 'Haritadaki konum',+ 'journey.dayImport.noPin': 'Haritada konum yok',+ 'journey.dayImport.join': 'Tek kayıtta birleştir',+ 'journey.dayImport.split': 'Ayrı tut',+ 'journey.dayImport.choose': '{name} aktar',+ 'journey.dayImport.name': '{name} adı',+ 'journey.dayImport.unconfirmed': 'Onaylanmamış',+ 'journey.dayImport.noPlace': 'Konumsuz',+ 'journey.dayImport.noPlaceHint': 'Dawarich bu durak için konum kaydetmedi, bu yüzden kaydı haritada görünmez.',+ 'journey.dayImport.statusHere': '{title} içinde',+ 'journey.dayImport.statusHereUntitled': 'Günlükte',+ 'journey.dayImport.statusElsewhere': 'Aktarıldı',+ 'journey.dayImport.statusElsewhereHint': 'Zaten yer, dilek olarak ya da başka bir günlüğe aktarıldı.',+ 'journey.dayImport.statusSkipped': 'Dışarıda bırakıldı',+ 'journey.dayImport.keepRoute': 'Günün rotasını da sakla',+ 'journey.dayImport.keepRouteHint': '{distance} kaydedildi. Yolculuktaki herkes onu haritada görür.',+ 'journey.dayImport.routeNone': 'Dawarich bu gün rota kaydetmedi.',+ 'journey.dayImport.routeKept': 'Rota saklandı',+ 'journey.dayImport.routeDiffers': 'Dawarich’te artık rotanın başka bir sürümü var. Günün rota düğmesiyle değiştir.',+ 'journey.dayImport.existing': 'Bu günde zaten var',+ 'journey.dayImport.untitled': 'Başlıksız kayıt',+ 'journey.dayImport.draft': 'Taslak',+ 'journey.dayImport.audience':+ 'Taslaklar paylaşılan bağlantılarda görünmez. Bu yolculuktaki {count} kişi daha onları görür.',+ 'journey.dayImport.audience.one':+ 'Taslaklar paylaşılan bağlantılarda görünmez. Bu yolculuktaki {count} kişi daha onları görür.',+ 'journey.dayImport.draftsNote':+ 'Taslaklar sen yayımlayana kadar paylaşılan bağlantılarda görünmez. Fotoğraf ve metni sonra ekle.',+ 'journey.dayImport.submit': '{count} taslağı aktar',+ 'journey.dayImport.submit.one': '{count} taslağı aktar',+ 'journey.dayImport.skipped': '{count} dışarıda',+ 'journey.dayImport.skipped.one': '{count} dışarıda',+ 'journey.dayImport.skipHint':+ 'Dışarıda bıraktığın duraklar bu günde artık beklemez. Onları Dawarich durak listesinde geri getirebilirsin.',+ 'journey.dayImport.problem.nothing': 'En az bir durak seç.',+ 'journey.dayImport.problem.name': 'Seçilen her durağın bir adı olmalı.',+ 'journey.dayImport.problem.title': 'Birleştirilen her kaydın ve gün raporunun bir başlığı olmalı.',+ 'journey.dayImport.done': '{count} taslak aktarıldı',+ 'journey.dayImport.done.one': '{count} taslak aktarıldı',+ 'journey.dayImport.alreadyTaken': '{count} durak zaten günlükteydi. Hiçbir şey iki kez yazılmadı.',+ 'journey.dayImport.alreadyTaken.one': '{count} durak zaten günlükteydi. Hiçbir şey iki kez yazılmadı.',+ 'journey.dayImport.failed':+ 'Hiçbir şey aktarılmadı: {reason} Liste günlüğün şu an neleri içerdiğini gösteriyor; yeniden denemek hiçbir şeyi iki kez yazmaz.',+ 'journey.dayImport.routeFailed': 'Taslaklar eklendi ama rota saklanmadı: {reason}',+ 'journey.dayImport.routeRetry': 'Rotayı yeniden sakla',+ 'journey.dayImport.stale': 'Dawarich yanıt vermedi: {reason} {date} tarihli son eşitlemenin durakları gösteriliyor.',+ 'journey.dayImport.staleNever': 'Dawarich yanıt vermedi: {reason} TREK’in zaten bildiği duraklar gösteriliyor.',+ 'journey.dayImport.truncated': 'Dawarich bu günün yalnızca bir kısmını gönderdi. Bazı duraklar eksik olabilir.',+ 'journey.dayImport.empty': 'Dawarich bu gün hiç durak bulmadı.',};export default journey;diff --git a/shared/src/i18n/uk/journey.ts b/shared/src/i18n/uk/journey.tsindex 99cb0cbbd..a3c372bc0 100644--- a/shared/src/i18n/uk/journey.ts+++ b/shared/src/i18n/uk/journey.ts@@ -805,5 +805,84 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Човен','journey.recording.mode.stationary': 'На місці','journey.recording.mode.unknown': 'Невідомий спосіб',+ 'journey.dayImport.open': 'Перенести день',+ 'journey.dayImport.openHint': 'Перенести цей день разом із зупинками',+ 'journey.dayImport.openOn': 'Перенести {date} разом із зупинками',+ 'journey.dayImport.pending': '{count} зупинки на перевірку',+ 'journey.dayImport.pending.one': '{count} зупинка на перевірку',+ 'journey.dayImport.pending.few': '{count} зупинки на перевірку',+ 'journey.dayImport.pending.many': '{count} зупинок на перевірку',+ 'journey.dayImport.sub':+ 'Ваші зупинки з Dawarich за цей день. Виберіть, перейменуйте й об’єднайте їх; вони стануть чернетками.',+ 'journey.dayImport.loading': 'Завантаження зупинок дня з Dawarich…',+ 'journey.dayImport.map': 'День на мапі',+ 'journey.dayImport.stays': 'Зупинки',+ 'journey.dayImport.modeEntries': 'Записи',+ 'journey.dayImport.modeReport': 'Звіт за день',+ 'journey.dayImport.reportDefault': 'День {date}',+ 'journey.dayImport.reportHint':+ 'Усі вибрані зупинки стануть одним записом, де вони перелічені з часом. Кожне місце збережеться для мапи.',+ 'journey.dayImport.reportNeedsTwo': 'Для звіту за день виберіть дві або більше зупинок.',+ 'journey.dayImport.groupTitle': 'Заголовок запису',+ 'journey.dayImport.groupPin': 'Місце на мапі',+ 'journey.dayImport.noPin': 'Без місця на мапі',+ 'journey.dayImport.join': 'Об’єднати в один запис',+ 'journey.dayImport.split': 'Залишити окремо',+ 'journey.dayImport.choose': 'Перенести {name}',+ 'journey.dayImport.name': 'Назва для {name}',+ 'journey.dayImport.unconfirmed': 'Не підтверджена',+ 'journey.dayImport.noPlace': 'Без координат',+ 'journey.dayImport.noPlaceHint': 'Dawarich не записав координати цієї зупинки, тож її запис не з’явиться на мапі.',+ 'journey.dayImport.statusHere': 'У записі {title}',+ 'journey.dayImport.statusHereUntitled': 'У щоденнику',+ 'journey.dayImport.statusElsewhere': 'Перенесена',+ 'journey.dayImport.statusElsewhereHint': 'Уже перенесена як місце, як бажання або до іншого щоденника.',+ 'journey.dayImport.statusSkipped': 'Пропущена',+ 'journey.dayImport.keepRoute': 'Зберегти й маршрут дня',+ 'journey.dayImport.keepRouteHint': 'Записано {distance}. Усі учасники подорожі побачать його на мапі.',+ 'journey.dayImport.routeNone': 'Dawarich не записав маршрут цього дня.',+ 'journey.dayImport.routeKept': 'Маршрут збережено',+ 'journey.dayImport.routeDiffers': 'У Dawarich тепер інша версія маршруту. Замініть її кнопкою маршруту цього дня.',+ 'journey.dayImport.existing': 'Уже в цьому дні',+ 'journey.dayImport.untitled': 'Запис без заголовка',+ 'journey.dayImport.draft': 'Чернетка',+ 'journey.dayImport.audience': 'Чернетки не видно за спільними посиланнями. Їх бачать ще {count} учасника подорожі.',+ 'journey.dayImport.audience.one':+ 'Чернетки не видно за спільними посиланнями. Їх бачить ще {count} учасник подорожі.',+ 'journey.dayImport.audience.few':+ 'Чернетки не видно за спільними посиланнями. Їх бачать ще {count} учасники подорожі.',+ 'journey.dayImport.audience.many':+ 'Чернетки не видно за спільними посиланнями. Їх бачать ще {count} учасників подорожі.',+ 'journey.dayImport.draftsNote':+ 'Чернетки не видно за спільними посиланнями, доки ви їх не опублікуєте. Фото й текст додайте пізніше.',+ 'journey.dayImport.submit': 'Перенести {count} чернетки',+ 'journey.dayImport.submit.one': 'Перенести {count} чернетку',+ 'journey.dayImport.submit.few': 'Перенести {count} чернетки',+ 'journey.dayImport.submit.many': 'Перенести {count} чернеток',+ 'journey.dayImport.skipped': '{count} пропущено',+ 'journey.dayImport.skipped.one': '{count} пропущена',+ 'journey.dayImport.skipped.few': '{count} пропущені',+ 'journey.dayImport.skipped.many': '{count} пропущено',+ 'journey.dayImport.skipHint':+ 'Пропущені зупинки більше не чекають у цьому дні. Їх можна відновити в списку зупинок Dawarich.',+ 'journey.dayImport.problem.nothing': 'Виберіть принаймні одну зупинку.',+ 'journey.dayImport.problem.name': 'Кожна вибрана зупинка потребує назви.',+ 'journey.dayImport.problem.title': 'Кожен об’єднаний запис і звіт за день потребують заголовка.',+ 'journey.dayImport.done': 'Перенесено {count} чернетки',+ 'journey.dayImport.done.one': 'Перенесено {count} чернетку',+ 'journey.dayImport.done.few': 'Перенесено {count} чернетки',+ 'journey.dayImport.done.many': 'Перенесено {count} чернеток',+ 'journey.dayImport.alreadyTaken': '{count} зупинки вже були в щоденнику. Нічого не записано двічі.',+ 'journey.dayImport.alreadyTaken.one': '{count} зупинка вже була в щоденнику. Нічого не записано двічі.',+ 'journey.dayImport.alreadyTaken.few': '{count} зупинки вже були в щоденнику. Нічого не записано двічі.',+ 'journey.dayImport.alreadyTaken.many': '{count} зупинок уже було в щоденнику. Нічого не записано двічі.',+ 'journey.dayImport.failed':+ 'Нічого не перенесено: {reason} Список показує, що зараз у щоденнику; повторна спроба нічого не запише двічі.',+ 'journey.dayImport.routeFailed': 'Чернетки створено, але маршрут не збережено: {reason}',+ 'journey.dayImport.routeRetry': 'Зберегти маршрут знову',+ 'journey.dayImport.stale': 'Dawarich не відповів: {reason} Показано зупинки останньої синхронізації {date}.',+ 'journey.dayImport.staleNever': 'Dawarich не відповів: {reason} Показано зупинки, які TREK уже знає.',+ 'journey.dayImport.truncated': 'Dawarich надіслав лише частину цього дня. Деяких зупинок може бракувати.',+ 'journey.dayImport.empty': 'Dawarich не знайшов зупинок цього дня.',};export default journey;diff --git a/shared/src/i18n/vi/journey.ts b/shared/src/i18n/vi/journey.tsindex 32330a730..c16421add 100644--- a/shared/src/i18n/vi/journey.ts+++ b/shared/src/i18n/vi/journey.ts@@ -749,5 +749,67 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': 'Thuyền','journey.recording.mode.stationary': 'Đứng yên','journey.recording.mode.unknown': 'Phương tiện không rõ',+ 'journey.dayImport.open': 'Nhập ngày',+ 'journey.dayImport.openHint': 'Nhập ngày này cùng các điểm dừng',+ 'journey.dayImport.openOn': 'Nhập {date} cùng các điểm dừng',+ 'journey.dayImport.pending': '{count} điểm dừng cần xem',+ 'journey.dayImport.sub':+ 'Các điểm dừng của bạn từ Dawarich trong ngày này. Chọn, đổi tên và gộp chúng; chúng sẽ thành bản nháp.',+ 'journey.dayImport.loading': 'Đang đọc các điểm dừng trong ngày từ Dawarich…',+ 'journey.dayImport.map': 'Ngày trên bản đồ',+ 'journey.dayImport.stays': 'Điểm dừng',+ 'journey.dayImport.modeEntries': 'Mục',+ 'journey.dayImport.modeReport': 'Báo cáo ngày',+ 'journey.dayImport.reportDefault': 'Ngày {date}',+ 'journey.dayImport.reportHint':+ 'Mọi điểm dừng đã chọn thành một mục liệt kê chúng kèm thời gian. Mỗi nơi vẫn được lưu cho bản đồ.',+ 'journey.dayImport.reportNeedsTwo': 'Chọn hai điểm dừng trở lên cho một báo cáo ngày.',+ 'journey.dayImport.groupTitle': 'Tiêu đề mục',+ 'journey.dayImport.groupPin': 'Vị trí trên bản đồ',+ 'journey.dayImport.noPin': 'Không có vị trí trên bản đồ',+ 'journey.dayImport.join': 'Gộp thành một mục',+ 'journey.dayImport.split': 'Giữ riêng',+ 'journey.dayImport.choose': 'Nhập {name}',+ 'journey.dayImport.name': 'Tên của {name}',+ 'journey.dayImport.unconfirmed': 'Chưa xác nhận',+ 'journey.dayImport.noPlace': 'Không có vị trí',+ 'journey.dayImport.noPlaceHint':+ 'Dawarich không ghi vị trí cho điểm dừng này, nên mục của nó không hiện trên bản đồ.',+ 'journey.dayImport.statusHere': 'Trong {title}',+ 'journey.dayImport.statusHereUntitled': 'Trong nhật ký',+ 'journey.dayImport.statusElsewhere': 'Đã nhập',+ 'journey.dayImport.statusElsewhereHint': 'Đã được nhập thành địa điểm, điều ước hoặc vào nhật ký khác.',+ 'journey.dayImport.statusSkipped': 'Đã bỏ qua',+ 'journey.dayImport.keepRoute': 'Lưu cả lộ trình trong ngày',+ 'journey.dayImport.keepRouteHint': 'Đã ghi {distance}. Mọi người trong chuyến đi đều thấy nó trên bản đồ.',+ 'journey.dayImport.routeNone': 'Dawarich không ghi lộ trình nào trong ngày này.',+ 'journey.dayImport.routeKept': 'Đã lưu lộ trình',+ 'journey.dayImport.routeDiffers':+ 'Dawarich hiện có phiên bản khác của lộ trình. Hãy thay bằng nút lộ trình của ngày.',+ 'journey.dayImport.existing': 'Đã có trong ngày này',+ 'journey.dayImport.untitled': 'Mục không tiêu đề',+ 'journey.dayImport.draft': 'Bản nháp',+ 'journey.dayImport.audience':+ 'Bản nháp không hiện trên liên kết chia sẻ. {count} người khác trong chuyến đi này thấy chúng.',+ 'journey.dayImport.draftsNote':+ 'Bản nháp không hiện trên liên kết chia sẻ cho đến khi bạn đăng. Thêm ảnh và nội dung sau.',+ 'journey.dayImport.submit': 'Nhập {count} bản nháp',+ 'journey.dayImport.skipped': 'Bỏ qua {count}',+ 'journey.dayImport.skipHint':+ 'Các điểm dừng bạn bỏ qua sẽ không còn chờ trong ngày này. Bạn có thể khôi phục chúng trong danh sách điểm dừng Dawarich.',+ 'journey.dayImport.problem.nothing': 'Chọn ít nhất một điểm dừng.',+ 'journey.dayImport.problem.name': 'Mỗi điểm dừng đã chọn cần có tên.',+ 'journey.dayImport.problem.title': 'Mỗi mục đã gộp và báo cáo ngày cần có tiêu đề.',+ 'journey.dayImport.done': 'Đã nhập {count} bản nháp',+ 'journey.dayImport.alreadyTaken': '{count} điểm dừng đã có trong nhật ký. Không có gì bị ghi hai lần.',+ 'journey.dayImport.failed':+ 'Chưa nhập được gì: {reason} Danh sách cho thấy nhật ký hiện có gì; thử lại sẽ không ghi trùng.',+ 'journey.dayImport.routeFailed': 'Bản nháp đã được tạo, nhưng lộ trình chưa được lưu: {reason}',+ 'journey.dayImport.routeRetry': 'Lưu lại lộ trình',+ 'journey.dayImport.stale':+ 'Dawarich không phản hồi: {reason} Đang hiển thị các điểm dừng của lần đồng bộ cuối lúc {date}.',+ 'journey.dayImport.staleNever': 'Dawarich không phản hồi: {reason} Đang hiển thị các điểm dừng TREK đã biết.',+ 'journey.dayImport.truncated': 'Dawarich chỉ gửi một phần của ngày này. Có thể thiếu điểm dừng.',+ 'journey.dayImport.empty': 'Dawarich không tìm thấy điểm dừng nào trong ngày này.',};export default journey;diff --git a/shared/src/i18n/zh-TW/journey.ts b/shared/src/i18n/zh-TW/journey.tsindex 11fff08f4..d8b2dd691 100644--- a/shared/src/i18n/zh-TW/journey.ts+++ b/shared/src/i18n/zh-TW/journey.ts@@ -729,5 +729,58 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': '船','journey.recording.mode.stationary': '靜止','journey.recording.mode.unknown': '未知方式',+ 'journey.dayImport.open': '匯入當天',+ 'journey.dayImport.openHint': '連同停留點匯入這一天',+ 'journey.dayImport.openOn': '連同停留點匯入 {date}',+ 'journey.dayImport.pending': '{count} 個停留點待查看',+ 'journey.dayImport.sub': '你在 Dawarich 中這一天的停留點。選擇、改名並合併它們,它們會成為草稿。',+ 'journey.dayImport.loading': '正在從 Dawarich 讀取當天的停留點…',+ 'journey.dayImport.map': '地圖上的這一天',+ 'journey.dayImport.stays': '停留點',+ 'journey.dayImport.modeEntries': '項目',+ 'journey.dayImport.modeReport': '當日記述',+ 'journey.dayImport.reportDefault': '{date} 這一天',+ 'journey.dayImport.reportHint': '所有選取的停留點會成為一個項目,依時間列出。每個地點都會保留在地圖上。',+ 'journey.dayImport.reportNeedsTwo': '當日記述需要選取兩個或更多停留點。',+ 'journey.dayImport.groupTitle': '項目標題',+ 'journey.dayImport.groupPin': '地圖位置',+ 'journey.dayImport.noPin': '無地圖位置',+ 'journey.dayImport.join': '合併為一個項目',+ 'journey.dayImport.split': '保持分開',+ 'journey.dayImport.choose': '匯入 {name}',+ 'journey.dayImport.name': '{name} 的名稱',+ 'journey.dayImport.unconfirmed': '未確認',+ 'journey.dayImport.noPlace': '無位置',+ 'journey.dayImport.noPlaceHint': 'Dawarich 沒有記錄這個停留點的位置,所以它的項目不會出現在地圖上。',+ 'journey.dayImport.statusHere': '在 {title} 中',+ 'journey.dayImport.statusHereUntitled': '在日誌中',+ 'journey.dayImport.statusElsewhere': '已匯入',+ 'journey.dayImport.statusElsewhereHint': '已作為地點、願望或匯入到其他日誌中。',+ 'journey.dayImport.statusSkipped': '已略過',+ 'journey.dayImport.keepRoute': '同時儲存當天的路線',+ 'journey.dayImport.keepRouteHint': '已記錄 {distance}。旅程中的每個人都能在地圖上看到。',+ 'journey.dayImport.routeNone': 'Dawarich 這一天沒有記錄路線。',+ 'journey.dayImport.routeKept': '路線已儲存',+ 'journey.dayImport.routeDiffers': 'Dawarich 現在有另一版本的路線。請用當天的路線按鈕取代。',+ 'journey.dayImport.existing': '這一天已有',+ 'journey.dayImport.untitled': '無標題項目',+ 'journey.dayImport.draft': '草稿',+ 'journey.dayImport.audience': '草稿不會出現在分享連結中。這次旅程的另外 {count} 人可以看到。',+ 'journey.dayImport.draftsNote': '草稿在你發布之前不會出現在分享連結中。之後再加入照片和文字。',+ 'journey.dayImport.submit': '匯入 {count} 篇草稿',+ 'journey.dayImport.skipped': '已略過 {count} 個',+ 'journey.dayImport.skipHint': '略過的停留點不再在這一天等待處理。你可以在 Dawarich 停留點清單中還原它們。',+ 'journey.dayImport.problem.nothing': '請至少選取一個停留點。',+ 'journey.dayImport.problem.name': '每個選取的停留點都需要名稱。',+ 'journey.dayImport.problem.title': '每個合併的項目和當日記述都需要標題。',+ 'journey.dayImport.done': '已匯入 {count} 篇草稿',+ 'journey.dayImport.alreadyTaken': '{count} 個停留點已在日誌中,沒有重複寫入。',+ 'journey.dayImport.failed': '沒有匯入任何內容:{reason} 清單顯示日誌現在的內容;再試一次不會重複寫入。',+ 'journey.dayImport.routeFailed': '草稿已建立,但路線未儲存:{reason}',+ 'journey.dayImport.routeRetry': '再次儲存路線',+ 'journey.dayImport.stale': 'Dawarich 沒有回應:{reason} 顯示的是 {date} 上次同步的停留點。',+ 'journey.dayImport.staleNever': 'Dawarich 沒有回應:{reason} 顯示的是 TREK 已知的停留點。',+ 'journey.dayImport.truncated': 'Dawarich 只傳送了這一天的一部分,可能缺少停留點。',+ 'journey.dayImport.empty': 'Dawarich 在這一天沒有找到停留點。',};export default journey;diff --git a/shared/src/i18n/zh/journey.ts b/shared/src/i18n/zh/journey.tsindex e5d7bbb49..388e3c54d 100644--- a/shared/src/i18n/zh/journey.ts+++ b/shared/src/i18n/zh/journey.ts@@ -729,5 +729,58 @@ const journey: TranslationStrings = {'journey.recording.mode.boat': '船','journey.recording.mode.stationary': '静止','journey.recording.mode.unknown': '未知方式',+ 'journey.dayImport.open': '导入当天',+ 'journey.dayImport.openHint': '连同停留点导入这一天',+ 'journey.dayImport.openOn': '连同停留点导入 {date}',+ 'journey.dayImport.pending': '{count} 个停留点待查看',+ 'journey.dayImport.sub': '你在 Dawarich 中这一天的停留点。选择、改名并合并它们,它们会成为草稿。',+ 'journey.dayImport.loading': '正在从 Dawarich 读取当天的停留点…',+ 'journey.dayImport.map': '地图上的这一天',+ 'journey.dayImport.stays': '停留点',+ 'journey.dayImport.modeEntries': '条目',+ 'journey.dayImport.modeReport': '当日记述',+ 'journey.dayImport.reportDefault': '{date} 这一天',+ 'journey.dayImport.reportHint': '所有选中的停留点会成为一个条目,按时间列出。每个地点都会保留在地图上。',+ 'journey.dayImport.reportNeedsTwo': '当日记述需要选择两个或更多停留点。',+ 'journey.dayImport.groupTitle': '条目标题',+ 'journey.dayImport.groupPin': '地图位置',+ 'journey.dayImport.noPin': '无地图位置',+ 'journey.dayImport.join': '合并为一个条目',+ 'journey.dayImport.split': '保持分开',+ 'journey.dayImport.choose': '导入 {name}',+ 'journey.dayImport.name': '{name} 的名称',+ 'journey.dayImport.unconfirmed': '未确认',+ 'journey.dayImport.noPlace': '无位置',+ 'journey.dayImport.noPlaceHint': 'Dawarich 没有记录这个停留点的位置,所以它的条目不会出现在地图上。',+ 'journey.dayImport.statusHere': '在 {title} 中',+ 'journey.dayImport.statusHereUntitled': '在日志中',+ 'journey.dayImport.statusElsewhere': '已导入',+ 'journey.dayImport.statusElsewhereHint': '已作为地点、心愿或导入到其他日志中。',+ 'journey.dayImport.statusSkipped': '已略过',+ 'journey.dayImport.keepRoute': '同时保存当天的路线',+ 'journey.dayImport.keepRouteHint': '已记录 {distance}。旅程中的每个人都能在地图上看到。',+ 'journey.dayImport.routeNone': 'Dawarich 这一天没有记录路线。',+ 'journey.dayImport.routeKept': '路线已保存',+ 'journey.dayImport.routeDiffers': 'Dawarich 现在有另一版本的路线。请用当天的路线按钮替换。',+ 'journey.dayImport.existing': '这一天已有',+ 'journey.dayImport.untitled': '无标题条目',+ 'journey.dayImport.draft': '草稿',+ 'journey.dayImport.audience': '草稿不会出现在分享链接中。这次旅程的另外 {count} 人可以看到。',+ 'journey.dayImport.draftsNote': '草稿在你发布之前不会出现在分享链接中。之后再添加照片和文字。',+ 'journey.dayImport.submit': '导入 {count} 篇草稿',+ 'journey.dayImport.skipped': '已略过 {count} 个',+ 'journey.dayImport.skipHint': '略过的停留点不再在这一天等待处理。你可以在 Dawarich 停留点列表中恢复它们。',+ 'journey.dayImport.problem.nothing': '请至少选择一个停留点。',+ 'journey.dayImport.problem.name': '每个选中的停留点都需要名称。',+ 'journey.dayImport.problem.title': '每个合并的条目和当日记述都需要标题。',+ 'journey.dayImport.done': '已导入 {count} 篇草稿',+ 'journey.dayImport.alreadyTaken': '{count} 个停留点已在日志中,没有重复写入。',+ 'journey.dayImport.failed': '没有导入任何内容:{reason} 列表显示日志现在的内容;再试一次不会重复写入。',+ 'journey.dayImport.routeFailed': '草稿已创建,但路线未保存:{reason}',+ 'journey.dayImport.routeRetry': '再次保存路线',+ 'journey.dayImport.stale': 'Dawarich 没有响应:{reason} 显示的是 {date} 上次同步的停留点。',+ 'journey.dayImport.staleNever': 'Dawarich 没有响应:{reason} 显示的是 TREK 已知的停留点。',+ 'journey.dayImport.truncated': 'Dawarich 只发送了这一天的一部分,可能缺少停留点。',+ 'journey.dayImport.empty': 'Dawarich 在这一天没有找到停留点。',};export default journey;diff --git a/shared/src/index.ts b/shared/src/index.tsindex 7e532c2c1..1a40f3d2a 100644--- a/shared/src/index.ts+++ b/shared/src/index.ts@@ -101,6 +101,7 @@ export * from './collab/collab.schema';export * from './file/file.schema';export * from './journey/journey.schema';export * from './journey/journey-recordings.schema';+export * from './journey/journey-day-import.schema';export * from './journey/trip-journal-link.schema';export * from './book/book.schema';export * from './book/journey-stats.schema';diff --git a/shared/src/journey/journey-day-import.schema.spec.ts b/shared/src/journey/journey-day-import.schema.spec.tsnew file mode 100644index 000000000..0e5f4f34c--- /dev/null+++ b/shared/src/journey/journey-day-import.schema.spec.ts@@ -0,0 +1,75 @@+import { journeyDayImportProblem, journeyDayImportRequestSchema } from './journey-day-import.schema';++import { describe, expect, it } from 'vitest';++const single = (suggestionId: number, name?: string) => ({+ kind: 'single' as const,+ stays: [name ? { suggestionId, name } : { suggestionId }],+});++describe('journeyDayImportRequestSchema', () => {+ it('JRNDAY-SCHEMA-001: single stays, a merged pair and a report with a chosen or no position', () => {+ const parsed = journeyDayImportRequestSchema.safeParse({+ groups: [+ single(1, ' Markusplatz '),+ { kind: 'merged', stays: [{ suggestionId: 2 }, { suggestionId: 3 }], title: 'Rialto', anchorSuggestionId: 3 },+ {+ kind: 'report',+ stays: [{ suggestionId: 4 }, { suggestionId: 5 }],+ title: 'Giudecca',+ anchorSuggestionId: null,+ },+ ],+ skipSuggestionIds: [6],+ });+ expect(parsed.success).toBe(true);+ expect(parsed.data?.groups[0]?.stays[0]?.name).toBe('Markusplatz');+ });++ it('JRNDAY-SCHEMA-002: refuses an empty take-over, a blank name and an unknown kind', () => {+ expect(journeyDayImportRequestSchema.safeParse({ groups: [] }).success).toBe(false);+ expect(journeyDayImportRequestSchema.safeParse({ groups: [single(1, ' ')] }).success).toBe(false);+ expect(+ journeyDayImportRequestSchema.safeParse({ groups: [{ kind: 'all', stays: [{ suggestionId: 1 }] }] }).success,+ ).toBe(false);+ });++ it('JRNDAY-SCHEMA-003: carries the structural refusal as its message', () => {+ const parsed = journeyDayImportRequestSchema.safeParse({ groups: [single(1), single(1)] });+ expect(parsed.success).toBe(false);+ expect(parsed.error?.issues[0]?.message).toBe('stay_twice');+ });+});++describe('journeyDayImportProblem', () => {+ it('JRNDAY-SCHEMA-004: a single holds one stay, a merged or report entry two and a title', () => {+ expect(+ journeyDayImportProblem({ groups: [{ kind: 'single', stays: [{ suggestionId: 1 }, { suggestionId: 2 }] }] }),+ ).toBe('single_takes_one_stay');+ expect(journeyDayImportProblem({ groups: [{ kind: 'merged', stays: [{ suggestionId: 1 }], title: 'A' }] })).toBe(+ 'group_needs_two_stays',+ );+ expect(+ journeyDayImportProblem({ groups: [{ kind: 'report', stays: [{ suggestionId: 1 }, { suggestionId: 2 }] }] }),+ ).toBe('group_needs_title');+ });++ it('JRNDAY-SCHEMA-005: the position is a stay of the group, and only a report may go without one', () => {+ const stays = [{ suggestionId: 1 }, { suggestionId: 2 }];+ expect(journeyDayImportProblem({ groups: [{ kind: 'merged', stays, title: 'A', anchorSuggestionId: 9 }] })).toBe(+ 'anchor_not_in_group',+ );+ expect(journeyDayImportProblem({ groups: [{ kind: 'merged', stays, title: 'A', anchorSuggestionId: null }] })).toBe(+ 'position_required',+ );+ expect(+ journeyDayImportProblem({ groups: [{ kind: 'report', stays, title: 'A', anchorSuggestionId: null }] }),+ ).toBeNull();+ });++ it('JRNDAY-SCHEMA-006: a stay goes into one group or the skipped list, never two places', () => {+ expect(journeyDayImportProblem({ groups: [single(1)], skipSuggestionIds: [1] })).toBe('stay_twice');+ expect(journeyDayImportProblem({ groups: [single(1)], skipSuggestionIds: [2, 2] })).toBe('stay_twice');+ expect(journeyDayImportProblem({ groups: [single(1), single(2)], skipSuggestionIds: [3] })).toBeNull();+ });+});diff --git a/shared/src/journey/journey-day-import.schema.ts b/shared/src/journey/journey-day-import.schema.tsnew file mode 100644index 000000000..105c0c4b1--- /dev/null+++ b/shared/src/journey/journey-day-import.schema.ts@@ -0,0 +1,148 @@+import { idSchema } from '../common/primitives.schema';+import { dawarichVisitStatusSchema } from '../dawarich/dawarich.schema';++import { z } from 'zod';++/**+ * JRN-02: one recorded day reviewed with the stays Dawarich found on it and+ * taken into the journal as drafts, in a few decisions.+ *+ * A stay is the caller's own: the review reads their Dawarich connection, and+ * only they can take one of their stays over. Several stays may become one+ * entry (the same square twice) or one day report; the stays behind an entry+ * stay on record with their own places and times, so a report has one map+ * position without losing the others, and taking the day over again finds+ * what is in the journal already instead of writing it twice.+ */++/**+ * Where a stay of the day stands for this journey.+ * `open`: not decided yet. `skipped`: left out before, can still be taken.+ * `here`: an entry of this journey holds it. `elsewhere`: taken over as a+ * place, a wish or into another journey, so it is not offered again.+ */+export const JOURNEY_DAY_STAY_STATUSES = ['open', 'skipped', 'here', 'elsewhere'] as const;++export const journeyDayStaySchema = z.object({+ /** The Dawarich suggestion the stay is. */+ suggestionId: idSchema,+ name: z.string(),+ lat: z.number().nullable(),+ lng: z.number().nullable(),+ /** ISO-8601 with the offset Dawarich recorded, as the stay list shows them. */+ startedAt: z.string(),+ endedAt: z.string(),+ durationMinutes: z.number(),+ /** `suggested` is Dawarich's own guess, not confirmed there. */+ sourceStatus: dawarichVisitStatusSchema,+ confidenceBand: z.string().nullable(),+ status: z.enum(JOURNEY_DAY_STAY_STATUSES),+ /** The entry of this journey that holds the stay, while `status` is `here`. */+ entry: z.object({ id: idSchema, title: z.string().nullable() }).nullable(),+});+export type JourneyDayStay = z.infer<typeof journeyDayStaySchema>;++/** An entry the journey has on the day already, so the review shows what is there. */+export const journeyDayEntrySchema = z.object({+ id: idSchema,+ title: z.string().nullable(),+ locationName: z.string().nullable(),+ entryTime: z.string().nullable(),+ isDraft: z.boolean(),+});+export type JourneyDayEntry = z.infer<typeof journeyDayEntrySchema>;++export const journeyDayStaysSchema = z.object({+ journey: z.object({ id: idSchema, title: z.string() }),+ date: z.string(),+ /** In the order they were lived. */+ stays: z.array(journeyDayStaySchema),+ entries: z.array(journeyDayEntrySchema),+ /** The stays were read from Dawarich just now; false when it did not answer and the last sync is shown. */+ fresh: z.boolean(),+ /** Why Dawarich did not answer, as its error code, while `fresh` is false. */+ error: z.string().nullable(),+ /** When the stays shown were last read from Dawarich by a sync, while `fresh` is false. */+ syncedAt: z.string().nullable(),+ /** Dawarich hit its page cap: the day may hold stays not listed. */+ truncated: z.boolean(),+ /** How many other people can open the journey and see its drafts. */+ audience: z.number(),+});+export type JourneyDayStays = z.infer<typeof journeyDayStaysSchema>;++/**+ * `single`: one stay, one entry. `merged`: stays of one place, one entry at+ * the chosen stay. `report`: stays of the day in one report, its time line+ * written out, at the chosen stay or without a map position.+ */+export const JOURNEY_DAY_GROUP_KINDS = ['single', 'merged', 'report'] as const;++export const JOURNEY_DAY_IMPORT_MAX_STAYS = 100;++const groupStaySchema = z.object({+ suggestionId: idSchema,+ /** The stay's name as corrected in the review; its own name when left out. */+ name: z.string().trim().min(1).max(255).optional(),+});++export const journeyDayImportGroupSchema = z.object({+ kind: z.enum(JOURNEY_DAY_GROUP_KINDS),+ stays: z.array(groupStaySchema).min(1).max(JOURNEY_DAY_IMPORT_MAX_STAYS),+ /** The entry's title. A single stay falls back to its name; a merged or report entry needs one. */+ title: z.string().trim().min(1).max(255).optional(),+ /** The stay whose place the entry is pinned to; null keeps a report off the map. */+ anchorSuggestionId: idSchema.nullable().optional(),+});+export type JourneyDayImportGroup = z.infer<typeof journeyDayImportGroupSchema>;++/**+ * What is wrong with a take-over before anything is looked up, or null. The+ * request schema refines with it, and the service asks it again for callers+ * that spread the schema's shape, like the MCP tool.+ */+export function journeyDayImportProblem(request: {+ groups: JourneyDayImportGroup[];+ skipSuggestionIds?: number[];+}): string | null {+ const seen = new Set<number>();+ const claim = (id: number): boolean => {+ if (seen.has(id)) return false;+ seen.add(id);+ return true;+ };+ for (const group of request.groups) {+ if (group.kind === 'single' && group.stays.length !== 1) return 'single_takes_one_stay';+ if (group.kind !== 'single' && group.stays.length < 2) return 'group_needs_two_stays';+ if (group.kind !== 'single' && !group.title) return 'group_needs_title';+ const anchor = group.anchorSuggestionId;+ if (anchor !== undefined && anchor !== null && !group.stays.some((stay) => stay.suggestionId === anchor)) {+ return 'anchor_not_in_group';+ }+ if (anchor === null && group.kind !== 'report') return 'position_required';+ for (const stay of group.stays) if (!claim(stay.suggestionId)) return 'stay_twice';+ }+ for (const id of request.skipSuggestionIds ?? []) if (!claim(id)) return 'stay_twice';+ return null;+}++export const journeyDayImportRequestSchema = z+ .object({+ groups: z.array(journeyDayImportGroupSchema).min(1).max(JOURNEY_DAY_IMPORT_MAX_STAYS),+ /** Open stays of the day left out on purpose; they are dismissed and can be restored. */+ skipSuggestionIds: z.array(idSchema).max(JOURNEY_DAY_IMPORT_MAX_STAYS).optional(),+ })+ .superRefine((request, ctx) => {+ const problem = journeyDayImportProblem(request);+ if (problem) ctx.addIssue({ code: 'custom', message: problem });+ });+export type JourneyDayImportRequest = z.infer<typeof journeyDayImportRequestSchema>;++export const journeyDayImportResultSchema = z.object({+ /** The drafts written, in the order of the groups that produced them. */+ entries: z.array(z.object({ id: idSchema, title: z.string().nullable(), stayCount: z.number() })),+ /** Stays the journey or another target held already: nothing was written for them. */+ alreadyTaken: z.array(idSchema),+ skipped: z.array(idSchema),+});+export type JourneyDayImportResult = z.infer<typeof journeyDayImportResultSchema>;diff --git a/wiki/Dawarich.md b/wiki/Dawarich.mdindex 7a5bbf506..5b0fb43e8 100644--- a/wiki/Dawarich.md+++ b/wiki/Dawarich.md@@ -178,6 +178,8 @@ With the [MCP](MCP-Overview) addon on as well, an assistant can review your stay| `get_dawarich_trip_track` | Summarises a trip's recorded route per day: segments, times, travel mode and distance. The line itself stays on the map. | `journey:read` || `preview_journey_recorded_day` | Reads one day of your recording and says what a journal would keep, without keeping it. Needs the Journey addon too. | `journey:read` || `save_journey_recorded_day` | Keeps that day in a journal after you confirmed the preview, or replaces a different version when asked. Needs the Journey addon too. | `journey:write` |+| `review_journey_day_stays` | Reads the stays of one day from your Dawarich and says which a journal holds already. Needs the Journey addon too. | `journey:read` |+| `take_over_journey_day_stays` | Takes the stays you chose into a journal as drafts: one by one, joined per place or as one day report. Needs the Journey addon too. | `journey:write` |The same rules apply as in the browser: nothing is added until a tool is called, and the permissions for adding a place are checked the same way. See [MCP-Addon-Tools](MCP-Addon-Tools) and [MCP-Scopes](MCP-Scopes).diff --git a/wiki/Journey-Journal.md b/wiki/Journey-Journal.mdindex 270e4d6b1..2a106b9aa 100644--- a/wiki/Journey-Journal.md+++ b/wiki/Journey-Journal.md@@ -123,6 +123,26 @@ What you should know:- **Everyone on the journey sees the route**, also when an editor kept their own recording; the dialog says how many people that is. Shared links do not show recorded days.- **Remove route** in the dialog takes the day off the journey again, also without a Dawarich connection. Dawarich keeps its own recording either way.+### Taking over a day with its stays++The stays [Dawarich](Dawarich) detected on a day (the café, the square, the museum) can become journal entries in one go, instead of one by one.++1. In the timeline, the header of each day carries a list button beside the route; it shows how many stays of the day are still waiting. The row with the day's stays has a **Take over day** button too. On a phone: **More options**, then **Take over** the day of the card you are on.+2. The dialog reads the day from your Dawarich again and shows its route and its stays on one map, numbered in the order you lived them, and lists them with their times and how long you stayed. A stay Dawarich only guessed, or is unsure about, says so; one without a position says it will not be on the map.+3. Choose the stays you want and correct their names. Two stays of the same place in a row (you left the square for a coffee and came back) start joined as one entry; **Keep apart** separates them, **Join into one entry** joins any two neighbours. A joined entry gets a title and the stay it sits at on the map.+4. **Day report** turns all chosen stays into one entry that lists them with their times, with a title and one map position (or none). Every stay stays on record with its own place, so a report does not cost you the places it covers.+5. **Keep the day's route too** keeps the route as well, when the journey does not keep it yet.+6. **Take over** writes the entries as drafts. Add photos and text afterwards, then publish them as usual.++What you should know:++- **Nothing is written before the button.** Cancelling leaves the journal and your stays as they were.+- **Nothing is written twice.** Stays the journal holds already are marked with the entry they are in and cannot be chosen again; taking the same day over again, or retrying after an error, writes no second entry.+- **What the journal holds stays as it is.** Existing entries, texts, photos and places are never changed; the dialog lists the day's entries so you see what is there.+- **Stays you leave out** are no longer pending on that day; you can restore them in the Dawarich stay list.+- **Drafts never appear on shared links.** Everyone on the journey sees them; the dialog says how many people that is.+- **When Dawarich does not answer**, the dialog says why and shows the stays of the last sync instead, so you can still take them over.+**Geotagged photos are drawn too.** A photo of the journey that knows where it was taken appears on the map as a thumbnail, and photos taken close together collapse into one thumbnail with a count. Click one to open those photos in the viewer.**Place entries from their photos**, a switch under **Photos** in **Journey Settings**, goes one step further: an entry without a place takes the spot where its first photo with GPS was taken. Places you set yourself are never moved. It is off by default.diff --git a/wiki/MCP-Addon-Tools.md b/wiki/MCP-Addon-Tools.mdindex 22225b454..ab0dcce31 100644--- a/wiki/MCP-Addon-Tools.md+++ b/wiki/MCP-Addon-Tools.md@@ -224,6 +224,8 @@ Each tool asks for the scope of what it writes, so the scopes differ per tool. T| `get_dawarich_trip_track` | Summary of a trip's recorded route per local day: segments, times, travel mode, distance and point counts, without the geometry. Read live from Dawarich, nothing stored | `journey:read` || `preview_journey_recorded_day` | Read one local day of the caller's recording and show what a journey would keep, without keeping it: the window the day runs in, distance, pieces, gaps, modes, whether the journey keeps the day already and how many other people would see it, and the `contentHash` the save needs. Needs the Journey addon too and edit access to the journey | `journey:read` || `save_journey_recorded_day` | Keep that day in the journey after the traveller confirmed the preview. Send its `utcOffsetMinutes` and `contentHash` as `expectedHash`; a recording that changed since is not kept. A different version is replaced only with `replace: true`; entries and texts are never touched. Needs the Journey addon too | `journey:write` |+| `review_journey_day_stays` | The caller's stays of one local day, read from Dawarich again, as a journey would take them over: name, place, arrival and departure, whether Dawarich only guessed it, and whether the journey holds it already, left it out before or it went elsewhere, plus the entries the journey has on that day. When Dawarich does not answer, the stays of the last sync with the reason. Needs the Journey addon too and edit access to the journey | `journey:read` |+| `take_over_journey_day_stays` | Take chosen stays of that day into the journey as draft entries: one per stay, several stays of one place as one entry, or a day report listing them with their times, at a chosen stay or without a map position. Corrected names, stays left out on purpose (dismissed, restorable), every stay kept with its own place and times on its entry; stays the journey holds already are reported, never written twice. Needs the Journey addon too | `journey:write` |### Document sync _(Documents addon required)_