From f2a2d910a098bff5d7f0b6b2af84be88eee6e382 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Fri, 20 Mar 2026 15:40:03 +0400 Subject: [PATCH] WIP Search places by category --- app/components/app-header.gjs | 25 +++++- app/components/category-chips.gjs | 52 ++++++++++++ app/components/map.gjs | 1 + app/components/search-box.gjs | 11 ++- app/controllers/search.js | 3 +- app/routes/search.js | 32 +++++++- app/services/map-ui.js | 5 ++ app/services/osm.js | 43 ++++++++++ app/styles/app.css | 129 ++++++++++++++++++++++++++++-- app/utils/poi-categories.js | 60 ++++++++++++++ 10 files changed, 350 insertions(+), 11 deletions(-) create mode 100644 app/components/category-chips.gjs create mode 100644 app/utils/poi-categories.js diff --git a/app/components/app-header.gjs b/app/components/app-header.gjs index 7c38228..4cfcfb1 100644 --- a/app/components/app-header.gjs +++ b/app/components/app-header.gjs @@ -6,10 +6,12 @@ import { on } from '@ember/modifier'; import Icon from '#components/icon'; import UserMenu from '#components/user-menu'; import SearchBox from '#components/search-box'; +import CategoryChips from '#components/category-chips'; export default class AppHeaderComponent extends Component { @service storage; @tracked isUserMenuOpen = false; + @tracked hasQuery = false; @action toggleUserMenu() { @@ -21,10 +23,31 @@ export default class AppHeaderComponent extends Component { this.isUserMenuOpen = false; } + @action + handleQueryChange(query) { + this.hasQuery = !!query; + } + + @action + handleChipSelect() { + // When a chip is selected, we might want to ensure the search box is cleared visually, + // although the route transition will happen. + // The SearchBox component manages its own state, so we rely on the route transition. + // However, if we want to clear the search box input from here, we'd need to control it. + // For now, let's just let the route change happen. + } +