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
fix(journey): give the public map one numbering instead of two
Mauricee80980857231
diff --git a/client/src/pages/JourneyPublicPage.test.tsx b/client/src/pages/JourneyPublicPage.test.tsxindex 62f3373c8..e1d1adbad 100644--- a/client/src/pages/JourneyPublicPage.test.tsx+++ b/client/src/pages/JourneyPublicPage.test.tsx@@ -536,4 +536,26 @@ describe('JourneyPublicPage', () => {expect(images.length).toBeGreaterThan(0);});});++ // #1962 — the marker number used to be the stop's position within its day while+ // the day heading showed the day number, so the same digit appeared repeatedly in+ // different colours with no key. Both now count stops across the whole journey.+ it('FE-PAGE-PUBLICJOURNEY-021: numbers each stop once, and the timeline carries the same number', async () => {+ setupSuccess();+ render(<JourneyPublicPage />);++ await waitFor(() => expect(screen.getByText('Shibuya Crossing')).toBeInTheDocument());++ // Two geocoded entries on two different days: stops 1 and 2, not 1 and 1.+ const shibuya = document.querySelector('[data-entry-id="10"]') as HTMLElement;+ const sensoji = document.querySelector('[data-entry-id="11"]') as HTMLElement;+ expect(shibuya).toBeTruthy();+ expect(sensoji).toBeTruthy();++ const badge = (el: HTMLElement) =>+ Array.from(el.querySelectorAll('span')).find(s => /^\d+$/.test(s.textContent || ''))?.textContent;++ expect(badge(shibuya)).toBe('1');+ expect(badge(sensoji)).toBe('2');+ });});diff --git a/client/src/pages/JourneyPublicPage.tsx b/client/src/pages/JourneyPublicPage.tsxindex e6c8b55f9..381d8ff79 100644--- a/client/src/pages/JourneyPublicPage.tsx+++ b/client/src/pages/JourneyPublicPage.tsx@@ -112,6 +112,7 @@ export default function JourneyPublicPage() {sortedDates,sidebarMapItems,allPhotos,+ stopNumberById,desktopTwoColumn,} = useJourneyPublic();@@ -304,6 +305,22 @@ export default function JourneyPublicPage() {</h3>)}+ {/* The number the map marker carries, so the timeline is the key+ to the map rather than a second, unrelated numbering (#1962).+ Outside the photo-count gate below: a single-photo entry puts+ its title and location in the image overlay, but the stop+ number has to be readable either way. */}+ {stopNumberById.has(String(entry.id)) && (+ <div className="mb-2">+ <span+ className="inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full px-1.5 text-[10px] font-bold text-white"+ style={{ background: dayColor }}+ >+ {stopNumberById.get(String(entry.id))}+ </span>+ </div>+ )}+{/* Location + time badges */}{(entry.location_name || entry.entry_time) && photos.length !== 1 && (<div className="mb-2 flex flex-wrap items-center gap-2">diff --git a/client/src/pages/JourneyPublicPage.wiring.test.tsx b/client/src/pages/JourneyPublicPage.wiring.test.tsxindex 9f9c3a250..dec7adb13 100644--- a/client/src/pages/JourneyPublicPage.wiring.test.tsx+++ b/client/src/pages/JourneyPublicPage.wiring.test.tsx@@ -82,6 +82,7 @@ function buildHook(over: Record<string, unknown> = {}): Record<string, unknown>groupedEntries: grouped,sortedDates: [...grouped.keys()].sort(),sidebarMapItems: [],+ stopNumberById: new Map<string, number>(),allPhotos: [] as PublicGalleryPhoto[],desktopTwoColumn: true,...over,diff --git a/client/src/pages/journeyPublic/useJourneyPublic.ts b/client/src/pages/journeyPublic/useJourneyPublic.tsindex 71f71ee31..5d38bb9f0 100644--- a/client/src/pages/journeyPublic/useJourneyPublic.ts+++ b/client/src/pages/journeyPublic/useJourneyPublic.ts@@ -63,12 +63,16 @@ export function useJourneyPublic() {// Map entries with day color/label for colored markers.// dayIdx is derived from sortedDates (ALL timeline dates) so marker colors// stay in sync with the timeline day headers even when some days have no locations.+ // The marker number used to be the stop's position *within* its day, while the+ // timeline heading showed the day number — two different numbers in the same+ // colour, and on mobile the heading is not rendered at all, so the key was+ // missing entirely (#1962). It is now the stop's place in the whole journey, so+ // every number appears exactly once and the colour still groups the day.const sidebarMapItems = useMemo(() => {- const counters = new Map<string, number>()+ let stop = 0return mapEntries.map(e => {const dayIdx = sortedDates.indexOf(e.entry_date)- const dayLabel = (counters.get(e.entry_date) ?? 0) + 1- counters.set(e.entry_date, dayLabel)+ const dayLabel = ++stopreturn {id: String(e.id),lat: e.location_lat!,@@ -83,6 +87,14 @@ export function useJourneyPublic() {})}, [mapEntries, sortedDates])+ // The same number the marker carries, so the timeline is the key to the map+ // rather than a second, unrelated numbering.+ const stopNumberById = useMemo(() => {+ const m = new Map<string, number>()+ sidebarMapItems.forEach(i => m.set(i.id, i.dayLabel))+ return m+ }, [sidebarMapItems])+// Two-column desktop layout: timeline feed left + sticky map rightconst desktopTwoColumn = !isMobile && perms.share_timeline && perms.share_map@@ -102,7 +114,7 @@ export function useJourneyPublic() {view, setView, lightbox, setLightbox, showLangPicker, setShowLangPicker,mapRef, activeEntryId, setActiveEntryId, viewingEntry, setViewingEntry, handleMarkerClick,perms, journey, stats,- timelineEntries, groupedEntries, sortedDates, sidebarMapItems, allPhotos,+ timelineEntries, groupedEntries, sortedDates, sidebarMapItems, allPhotos, stopNumberById,desktopTwoColumn,}}