From a73a801a1df24fe7d02ada5b7cc44897825d6d13 Mon Sep 17 00:00:00 2001
From: Ruslan Bakiev <572431+veikab@users.noreply.github.com>
Date: Sat, 7 Feb 2026 13:56:36 +0700
Subject: [PATCH] Make pins explicit and selection open info
---
app/components/catalog/InfoPanel.vue | 37 ++++++++++++++++-------
app/components/catalog/SelectionPanel.vue | 15 +++++----
app/composables/useCatalogSearch.ts | 13 ++++++--
app/pages/catalog/index.vue | 32 +++++++++++++++++---
4 files changed, 72 insertions(+), 25 deletions(-)
diff --git a/app/components/catalog/InfoPanel.vue b/app/components/catalog/InfoPanel.vue
index 42c12e0..386c1bc 100644
--- a/app/components/catalog/InfoPanel.vue
+++ b/app/components/catalog/InfoPanel.vue
@@ -12,9 +12,20 @@
{{ entityName }}
-
+
+
+
+
@@ -123,11 +134,12 @@
@select="onProductSelect(product)"
/>
@@ -197,11 +209,12 @@
@select="onSupplierSelect(supplier)"
/>
@@ -242,11 +255,12 @@
@select="onHubSelect(hub)"
/>
@@ -274,11 +288,12 @@
@select="onHubSelect(hub)"
/>
diff --git a/app/components/catalog/SelectionPanel.vue b/app/components/catalog/SelectionPanel.vue
index eb855dd..651931d 100644
--- a/app/components/catalog/SelectionPanel.vue
+++ b/app/components/catalog/SelectionPanel.vue
@@ -38,11 +38,12 @@
@select="onSelect(item)"
/>
@@ -62,11 +63,12 @@
@select="onSelect(item)"
/>
@@ -86,11 +88,12 @@
@select="onSelect(item)"
/>
diff --git a/app/composables/useCatalogSearch.ts b/app/composables/useCatalogSearch.ts
index b9ceedc..327167e 100644
--- a/app/composables/useCatalogSearch.ts
+++ b/app/composables/useCatalogSearch.ts
@@ -94,7 +94,8 @@ export function useCatalogSearch() {
})
// Filter by bounds checkbox state from URL
- const filterByBounds = computed(() => route.query.bounds !== undefined)
+ // Use explicit flag so bounds don't auto-enable filtering.
+ const filterByBounds = computed(() => route.query.boundsFilter === '1')
// Get label for a filter (from cache or fallback to ID)
const getLabel = (type: string, id: string | undefined): string | null => {
@@ -261,7 +262,7 @@ export function useCatalogSearch() {
const setBoundsInUrl = (bounds: { west: number; south: number; east: number; north: number } | null) => {
if (bounds) {
const boundsStr = `${bounds.west.toFixed(4)},${bounds.south.toFixed(4)},${bounds.east.toFixed(4)},${bounds.north.toFixed(4)}`
- updateQuery({ bounds: boundsStr })
+ updateQuery({ bounds: boundsStr, boundsFilter: '1' })
} else {
updateQuery({ bounds: null })
}
@@ -269,7 +270,12 @@ export function useCatalogSearch() {
// Clear bounds from URL
const clearBoundsFromUrl = () => {
- updateQuery({ bounds: null })
+ updateQuery({ bounds: null, boundsFilter: null })
+ }
+
+ // Explicitly enable/disable bounds filter flag in URL
+ const setBoundsFilterEnabled = (enabled: boolean) => {
+ updateQuery({ boundsFilter: enabled ? '1' : null })
}
const openInfo = (type: InfoEntityType, uuid: string) => {
@@ -427,6 +433,7 @@ export function useCatalogSearch() {
setQuantity,
setBoundsInUrl,
clearBoundsFromUrl,
+ setBoundsFilterEnabled,
openInfo,
closeInfo,
setInfoTab,
diff --git a/app/pages/catalog/index.vue b/app/pages/catalog/index.vue
index 2cd346c..8366f67 100644
--- a/app/pages/catalog/index.vue
+++ b/app/pages/catalog/index.vue
@@ -25,7 +25,7 @@
:cluster-supplier-uuid="clusterSupplierUuid"
@select="onMapSelect"
@bounds-change="onBoundsChange"
- @update:filter-by-bounds="$event ? setBoundsInUrl(currentMapBounds) : clearBoundsFromUrl()"
+ @update:filter-by-bounds="onToggleBoundsFilter"
>
@@ -175,7 +175,8 @@ const {
urlBounds,
filterByBounds,
setBoundsInUrl,
- clearBoundsFromUrl
+ clearBoundsFromUrl,
+ setBoundsFilterEnabled
} = useCatalogSearch()
// Info panel composable
@@ -255,7 +256,20 @@ const getSelectionBounds = () => {
return { west: bounds.west, south: bounds.south, east: bounds.east, north: bounds.north }
}
+const onToggleBoundsFilter = (enabled: boolean) => {
+ if (enabled) {
+ setBoundsFilterEnabled(true)
+ const bounds = getSelectionBounds()
+ if (bounds) {
+ setBoundsInUrl(bounds)
+ }
+ } else {
+ clearBoundsFromUrl()
+ }
+}
+
const applySelectionBounds = () => {
+ if (!filterByBounds.value) return
if (!selectionBoundsBackup.value) {
selectionBoundsBackup.value = {
hadBounds: !!urlBounds.value,
@@ -651,10 +665,18 @@ const onMapSelect = async (item: MapSelectItem) => {
setLabel(infoType, itemId, itemName)
}
-// Handle selection from SelectionPanel - add to filter (show badge in search)
+// Handle selection from SelectionPanel - open info card (pin only via pin button)
const onSelectItem = (type: string, item: { uuid?: string | null; name?: string | null }) => {
- if (item.uuid && item.name) {
- selectItem(type, item.uuid, item.name)
+ if (!item.uuid) return
+ if (type === 'hub' || type === 'supplier') {
+ if (item.name) {
+ setLabel(type, item.uuid, item.name)
+ }
+ openInfo(type, item.uuid)
+ return
+ }
+ if (type === 'product') {
+ router.push(localePath(`/catalog/products/${item.uuid}`))
}
}