Skip to content

Commit c2edd82

Browse files
committed
fix: add reactive dep to showBubbles computed
1 parent aeb4e18 commit c2edd82

File tree

5 files changed

+31
-27
lines changed

5 files changed

+31
-27
lines changed

app/components/CountryBubbles.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ const showBubbles = computed(() => {
9797
if (isFlying.value)
9898
return false
9999
100+
// Touch reactive deps to trigger re-evaluation when map moves
101+
// eslint-disable-next-line no-unused-expressions
102+
viewCenter.value
103+
100104
// Only show bubbles when outside ALL country bounds
101105
// When inside any country, don't show edge bubbles pointing to other countries
102106
return isViewportOutsideAllCountries()

app/components/LocationDrawer.vue

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ function handleClose() {
7979
}"
8080
@click="handleClose"
8181
/>
82-
<DrawerContent flex="~ col" shadow="[0_-4px_24px_rgba(0,0,0,0.1)]" max-h="[calc(100dvh-env(safe-area-inset-top))]" outline-none rounded-t-10 bg-neutral-0 h-full w-full inset-x-0 bottom-0 fixed z-80>
83-
<!-- Header with handle and close button -->
84-
<div flex="~ items-center justify-center" pb-0 pt-8 relative>
85-
<DrawerHandle bg-neutral-400 h-6 w-40 />
86-
<button bg="neutral-500 hocus:neutral-600" stack rounded-full shrink-0 size-24 transition-colors right-16 absolute @click.stop="handleClose">
82+
<DrawerContent flex="~ col" shadow="[0_-4px_24px_rgba(0,0,0,0.1)]" max-h="[calc(100dvh-env(safe-area-inset-top))]" outline-none rounded-t-12 bg-neutral-0 h-full w-full inset-x-0 bottom-0 fixed z-80>
83+
<!-- Handle and close button - absolutely positioned, overlay content -->
84+
<div flex="~ items-center justify-center" top-0 left-0 right-0 pt-8 z-10 absolute pointer-events-none>
85+
<DrawerHandle bg-neutral-400 rounded-full h-6 w-40 pointer-events-auto />
86+
<button bg="neutral-500 hocus:neutral-600" stack rounded-full shrink-0 size-24 transition-colors top-12 right-12 pointer-events-auto absolute @click.stop="handleClose">
8787
<Icon name="i-nimiq:cross-bold" text-neutral-0 size-10 />
8888
</button>
8989
</div>
@@ -101,3 +101,11 @@ function handleClose() {
101101
</DrawerPortal>
102102
</DrawerRoot>
103103
</template>
104+
105+
<style>
106+
/* Override vaul's handle hitarea margins so it stays centered */
107+
[data-vaul-handle-hitarea] {
108+
margin: 0 !important;
109+
padding: 8px 16px !important;
110+
}
111+
</style>

app/components/LocationDrawerContent.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ const { addressRef, showCopiedTooltip } = useAddressCopy()
9595
<template>
9696
<div h-full w-full relative of-hidden flex="~ col">
9797
<!-- Scrollable content -->
98-
<div bg-neutral-0 flex-1 of-x-hidden of-y-auto :class="isCompact ? 'max-h-[calc(450px-32px)]' : ''">
99-
<header pt-16 bg-neutral-0 relative f-px-md>
98+
<div bg-neutral-0 flex-1 rounded-t-20 of-x-hidden of-y-auto :class="isCompact ? 'max-h-450px' : ''">
99+
<header pt-20 bg-neutral-0 relative f-px-md>
100100
<!-- Title -->
101101
<h2 leading-tight font-bold my-0 pr-40 line-clamp-2 text="f-xl neutral">
102102
{{ location.name }}
@@ -144,9 +144,9 @@ const { addressRef, showCopiedTooltip } = useAddressCopy()
144144
<!-- Weekly Hours -->
145145
<div v-if="rotatedHours" w-full space-y-8>
146146
<div v-for="(hours, idx) in rotatedHours.hours" :key="idx" flex="~ items-center gap-8" text-14>
147-
<span :class="hours ? 'text-neutral-700' : 'text-neutral-900'">{{ t(`days.${dayKeys[(new Date().getDay() + idx + 6) % 7]}`) }}</span>
147+
<span :class="hours ? (idx === 0 ? 'text-neutral-900' : 'text-neutral-700') : 'text-red'">{{ t(`days.${dayKeys[(new Date().getDay() + idx + 6) % 7]}`) }}</span>
148148
<svg text-neutral-500 flex-1 h-2 preserveAspectRatio="none"><line x1="0" y1="50%" x2="100%" y2="50%" stroke="currentColor" stroke-width="1" /></svg>
149-
<span :class="hours ? 'text-neutral-700' : 'text-red font-semibold'">
149+
<span :class="hours ? (idx === 0 ? 'text-neutral-900' : 'text-neutral-700') : 'text-red font-semibold'">
150150
{{ hours || t('hours.closed') }}
151151
</span>
152152
</div>

app/components/MapControls.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ function handleLocateMe() {
5454
cursor-pointer
5555
shadow
5656
transition-colors
57-
disabled:op-50
5857
bg="neutral-0 hocus:neutral-50"
5958
:disabled="isLocating"
6059
@click="handleLocateMe"

app/pages/index.vue

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const { width: windowWidth, height: windowHeight } = useWindowSize()
1717
1818
// Inline composable for map interaction handlers
1919
function useMapInteractions(options: {
20-
onMarkerClick: (uuid: string) => void
20+
onMarkerClick: (uuid: string, coordinates: [number, number]) => void
2121
onBackgroundClick: () => void
2222
}) {
2323
const logger = consola.withTag('map')
@@ -48,9 +48,12 @@ function useMapInteractions(options: {
4848
4949
function handleLocationClick(map: Map, e: MapMouseEvent & { features?: GeoJSON.Feature[] }) {
5050
e.preventDefault()
51-
const uuid = e.features?.[0]?.properties?.uuid
52-
if (uuid)
53-
options.onMarkerClick(uuid)
51+
const feature = e.features?.[0]
52+
const uuid = feature?.properties?.uuid
53+
if (uuid && feature?.geometry?.type === 'Point') {
54+
const coords = feature.geometry.coordinates as [number, number]
55+
options.onMarkerClick(uuid, coords)
56+
}
5457
}
5558
5659
function setupCursorHandlers(map: Map, layerId: string) {
@@ -168,24 +171,14 @@ function handleNavigate(uuid: string | undefined, latitude: number, longitude: n
168171
}
169172
}
170173
171-
function handleMarkerClick(uuid: string) {
174+
function handleMarkerClick(uuid: string, coordinates: [number, number]) {
172175
logger.info('Marker clicked:', uuid)
173176
selectedLocationUuid.value = uuid
174177
isDrawerOpen.value = true
175178
if (mapInstance.value) {
176179
setSelectedLocation(mapInstance.value as any, uuid)
177-
178-
// If marker is in bottom half, pan up so it's visible above drawer
179-
const features = mapInstance.value.querySourceFeatures('locations', { filter: ['==', ['get', 'uuid'], uuid] })
180-
const feature = features[0]
181-
if (feature?.geometry?.type === 'Point') {
182-
const coords = feature.geometry.coordinates as [number, number]
183-
const point = mapInstance.value.project(coords)
184-
const containerHeight = mapInstance.value.getContainer().clientHeight
185-
if (point.y > containerHeight / 2) {
186-
flyTo({ lat: coords[1], lng: coords[0] }, { zoom: mapInstance.value.getZoom(), padding: { bottom: 450 } })
187-
}
188-
}
180+
// Pan to marker position with padding for drawer, maintaining current zoom
181+
flyTo({ lat: coordinates[1], lng: coordinates[0] }, { zoom: mapInstance.value.getZoom(), padding: { bottom: 450 } })
189182
}
190183
}
191184

0 commit comments

Comments
 (0)