Skip to content

armgit / TREK

Public Imported from GitHub
0

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.

fix(journey): the shared journey map reaches the screen edge, and desktop readers get the day picker

Mauriceed178f3b5e83
diff --git a/client/src/components/Journey/MobileMapTimeline.tsx b/client/src/components/Journey/MobileMapTimeline.tsx
index 6a0ca4c44..b675a2053 100644
--- a/client/src/components/Journey/MobileMapTimeline.tsx
+++ b/client/src/components/Journey/MobileMapTimeline.tsx
@@ -108,8 +108,8 @@ export default function MobileMapTimeline({
if (entries.length === 0) {
return (
<div
- className="fixed inset-x-0 z-10"
- style={{ top: 'var(--nav-h, 0px)', bottom: 'env(safe-area-inset-bottom, 0px)' }}
+ className="fixed inset-x-0 bottom-0 z-10"
+ style={{ top: 'var(--nav-h, 0px)' }}
>
<JourneyLayeredMap
ref={mapRef}
@@ -147,8 +147,10 @@ export default function MobileMapTimeline({
return (
<div
- className="fixed inset-x-0 z-10"
- style={{ top: 'var(--nav-h, 0px)', bottom: 'env(safe-area-inset-bottom, 0px)' }}
+ // Down to the very edge: Safari draws its toolbar over the page, and a map
+ // that stopped at the safe area left a bare strip under it (#3002).
+ className="fixed inset-x-0 bottom-0 z-10"
+ style={{ top: 'var(--nav-h, 0px)' }}
>
{/* Full-screen map */}
<JourneyLayeredMap
diff --git a/client/src/pages/JourneyPublicPage.tsx b/client/src/pages/JourneyPublicPage.tsx
index d3e8cf367..c2c63e998 100644
--- a/client/src/pages/JourneyPublicPage.tsx
+++ b/client/src/pages/JourneyPublicPage.tsx
@@ -20,6 +20,7 @@ import {
ThumbsUp,
} from 'lucide-react';
import { DAY_COLORS } from '../components/Journey/dayColors';
+import JourneyDayJump from '../components/Journey/JourneyDayJump';
import JournalBody from '../components/Journey/JournalBody';
import JourneyLayeredMap from '../components/Journey/JourneyLayeredMap';
import MobileEntryView from '../components/Journey/MobileEntryView';
@@ -120,6 +121,7 @@ export default function JourneyPublicPage() {
showLangPicker,
setShowLangPicker,
mapRef,
+ feedRef,
activeEntryId,
setActiveEntryId,
viewingEntry,
@@ -227,7 +229,7 @@ export default function JourneyPublicPage() {
const dayIdx = sortedDates.indexOf(date);
const dayColor = DAY_COLORS[dayIdx % DAY_COLORS.length];
return (
- <div key={date}>
+ <div key={date} data-day={date}>
{/* Day header */}
<div className="mb-4 flex items-center gap-3">
<div
@@ -624,9 +626,24 @@ export default function JourneyPublicPage() {
// ── Desktop two-column: scrollable timeline feed + sticky map ──────────
<div className="mx-auto flex max-w-[1440px]" style={{ alignItems: 'flex-start' }}>
{/* Left: feed */}
- <div className="min-w-0 flex-1 px-8 py-6 xl:max-w-[50%]">
+ <div ref={feedRef} className="min-w-0 flex-1 px-8 py-6 xl:max-w-[50%]">
{view === 'timeline' && perms.share_timeline && renderTimeline()}
{view === 'gallery' && perms.share_gallery && renderGallery()}
+ {/* Every day and its entries one click away, as in the journal itself (#2998). */}
+ {view === 'timeline' && perms.share_timeline && sortedDates.length > 1 && (
+ <div className="pointer-events-none sticky bottom-0 z-20 h-0">
+ <div className="pointer-events-auto absolute inset-x-0 bottom-6 mx-auto w-fit">
+ <JourneyDayJump
+ feedRef={feedRef}
+ days={sortedDates.map((date, i) => ({
+ date,
+ color: DAY_COLORS[i % DAY_COLORS.length],
+ entries: (groupedEntries.get(date) ?? []).map(e => ({ id: e.id, title: e.title || e.location_name || t('journey.detail.newEntry') })),
+ }))}
+ />
+ </div>
+ </div>
+ )}
</div>
{/* Right: sticky map — matches auth page aside proportions */}
diff --git a/client/src/pages/journeyPublic/useJourneyPublic.ts b/client/src/pages/journeyPublic/useJourneyPublic.ts
index 24241a0d9..8bcfc799f 100644
--- a/client/src/pages/journeyPublic/useJourneyPublic.ts
+++ b/client/src/pages/journeyPublic/useJourneyPublic.ts
@@ -32,6 +32,8 @@ export function useJourneyPublic() {
const [showLangPicker, setShowLangPicker] = useState(false)
const locale = useSettingsStore(s => s.settings.language) || 'en'
const mapRef = useRef<JourneyMapHandle>(null)
+ // The desktop feed, for the day picker to scroll (#2998).
+ const feedRef = useRef<HTMLDivElement>(null)
const [activeEntryId, setActiveEntryId] = useState<string | null>(null)
const [viewingEntry, setViewingEntry] = useState<PublicEntry | null>(null)
@@ -170,7 +172,7 @@ export function useJourneyPublic() {
return {
token, data, loading, error, isMobile, locale,
view, setView, lightbox, setLightbox, showLangPicker, setShowLangPicker,
- mapRef, activeEntryId, setActiveEntryId, viewingEntry, setViewingEntry, handleMarkerClick,
+ mapRef, feedRef, activeEntryId, setActiveEntryId, viewingEntry, setViewingEntry, handleMarkerClick,
perms, journey, stats,
timelineEntries, groupedEntries, sortedDates, displayDates, sidebarMapItems, allPhotos, stopNumberById, mapPhotos,
mapLayers, entryTitleOf,