Skip to content

feat: Add Nearby Places Locator#305

Open
tankerkiller125 wants to merge 5 commits intomauriceboe:devfrom
tankerkiller125:find-nearby
Open

feat: Add Nearby Places Locator#305
tankerkiller125 wants to merge 5 commits intomauriceboe:devfrom
tankerkiller125:find-nearby

Conversation

@tankerkiller125
Copy link
Copy Markdown

This pull request introduces a new "Find Nearby" feature that allows users to search for and add places of interest near a selected location. The implementation includes a new modal for browsing nearby places, API integration, UI enhancements, and localization support. Additionally, admin settings are added to configure the categories and search parameters for this feature.

Nearby Places Feature Implementation:

  • Added a new NearbyPlacesModal component that allows users to search for and add nearby places by category, with support for loading states, error handling, and multi-language labels.
  • Integrated the modal into the PlaceInspector component, including a new "Find Nearby" action button (with a radar icon) that appears when latitude and longitude are available. [1] [2] [3]
  • Extended the mapsApi with a new nearby method to fetch nearby places from the backend.

Localization and UI Texts:

  • Added English and German translations for all "Nearby Places" feature UI texts, including category names, button labels, and error messages. [1] [2] [3] [4]
  • Updated icon imports to include the new radar icon for the "Find Nearby" button.

Admin Configuration:

  • Introduced admin settings to configure enabled categories, default search radius, and maximum results for the "Nearby Places" feature, including UI state management for these settings. [1] [2]

These changes collectively add a user-friendly way to discover and add nearby places, with customizable settings and full localization support.

@tankerkiller125 tankerkiller125 changed the title Add Nearby Places Locator feat: Add Nearby Places Locator Apr 2, 2026
Copy link
Copy Markdown
Collaborator

@jubnl jubnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Front-end calls a new route /api/maps/nearby but this route does not currently exists, and the PR doesn't include the new backend route

Comment thread client/src/api/client.ts
@tankerkiller125 tankerkiller125 requested a review from jubnl April 2, 2026 20:19
@jubnl jubnl changed the base branch from main to dev April 3, 2026 02:22
@jubnl
Copy link
Copy Markdown
Collaborator

jubnl commented Apr 3, 2026

I've changed the target to dev as we are changing the backend architecture. Can you please seek the conflict and resolve them ? I'd be happy to review your pr afterwards

@mauriceboe mauriceboe added the waiting for response Blocked, needs input from author or user label Apr 3, 2026
@mauriceboe mauriceboe removed the waiting for response Blocked, needs input from author or user label Apr 4, 2026
Copy link
Copy Markdown
Collaborator

@jubnl jubnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, I just checked the entire PR. In addition to the comments I made, can you please add translations for all supported languages instead of just German and English ?

const [savingFileTypes, setSavingFileTypes] = useState<boolean>(false)

// Nearby places settings
const ALL_NEARBY_CATEGORIES = ['food', 'attractions', 'shopping', 'nightlife', 'outdoors', 'transport', 'services', 'accommodation']
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ALL_NEARBY_CATEGORIES defined inside AdminPage function body means that this is recreated on every render. Should be a module-level constant

accommodation: { keywords: ['accommodation', 'hotel', 'hostel', 'lodging', 'unterkunft'], icon: 'BedDouble', color: '#0ea5e9', name: 'Accommodation' },
};

function resolveNearbyCategoryId(type: string): number | null {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolveNearbyCategoryId runs a DB query on every nearby search, should be cached or moved outside

Comment thread client/src/api/client.ts
reverse: (lat: number, lng: number, lang?: string) => apiClient.get('/maps/reverse', { params: { lat, lng, lang } }).then(r => r.data),
resolveUrl: (url: string) => apiClient.post('/maps/resolve-url', { url }).then(r => r.data),
nearby: (lat: number, lng: number, type: string, radius?: number, lang?: string) =>
apiClient.post(`/maps/nearby?lang=${lang || 'en'}`, { lat, lng, type, radius }).then(r => r.data),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lang passed as query param despite being a POST, Should be in the request body or use params option like other API calls

@jubnl jubnl added the waiting for response Blocked, needs input from author or user label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting for response Blocked, needs input from author or user

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants