Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/components/map/map-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ interface MapPanelProps {
onResetFilters: () => void;
resultsToggle?: { label: string; onClick: () => void } | null;
onSelectPlace: (place: Place) => void;
focusId?: string | null;

onLocated: (loc: LatLng) => void;
onShare: () => void;
Expand Down Expand Up @@ -82,6 +83,7 @@ export function MapPanel({
onResetFilters,
resultsToggle,
onSelectPlace,
focusId,
onLocated,
onShare,
myPlaces,
Expand Down Expand Up @@ -201,6 +203,7 @@ export function MapPanel({
onSuggest: () => setSuggestOpen(true),
}}
onSelect={onSelectPlace}
focusId={focusId}
toggle={resultsToggle}
/>

Expand Down
1 change: 1 addition & 0 deletions src/components/map/places-map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ export function PlacesMap({ places }: PlacesMapProps) {
onResetFilters: () => setFilters({ types: [], city: null, query: "" }),
resultsToggle,
onSelectPlace: selectPlace,
focusId,
onLocated,
onShare: share,
myPlaces: user
Expand Down
9 changes: 8 additions & 1 deletion src/components/map/results-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ interface ResultsListProps {
onSuggest: () => void;
};
onSelect: (place: Place) => void;
focusId?: string | null;
/** Optional expand/collapse control (e.g. "Show all" for the nearest list). */
toggle?: { label: string; onClick: () => void } | null;
}
Expand All @@ -34,6 +35,7 @@ export function ResultsList({
rows,
emptyState,
onSelect,
focusId,
toggle,
}: ResultsListProps) {
return (
Expand Down Expand Up @@ -83,7 +85,11 @@ export function ResultsList({
<ul className="min-h-0 space-y-1 overflow-y-auto">
{rows.map(({ place, distanceKm }) => (
<li key={place.id}>
<div className="group flex items-center gap-2.5 rounded-md px-2 py-2 hover:bg-muted">
<div
className={`group flex items-center gap-2.5 rounded-md px-2 py-2 ${
focusId === place.id ? "bg-muted ring-1 ring-border" : "hover:bg-muted"
}`}
>
<span
aria-hidden
className="size-3 shrink-0 rounded-full"
Expand All @@ -92,6 +98,7 @@ export function ResultsList({
<button
type="button"
onClick={() => onSelect(place)}
aria-current={focusId === place.id ? "true" : undefined}
className="min-w-0 flex-1 text-left"
title={`${place.name} (${PLACE_TYPE_LABELS[place.type]})`}
>
Expand Down
Loading