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

- On a phone the shared journey's map stopped at the safe area, so Safari's
  toolbar sat over a bare strip; it now runs to the edge (#3002)
- The shared journey on desktop gains the journal's day picker, every day and
  its entries one click away (#2998)
This commit is contained in:
Maurice
2026-11-06 20:52:07 +01:00
parent f46f6f38fc
commit ed178f3b5e
3 changed files with 28 additions and 7 deletions
@@ -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
+19 -2
View File
@@ -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 */}
@@ -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,