mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-04-25 17:14:57 +02:00
fix(cmd-k): resolve spr/lng keyword collisions so Atlas panel wins
Reviewer found that the original PR wiring let CMD+K "spr" and "lng" route to the wrong panel because matchCommands() (SearchModal.ts:273) ranks by exact/prefix/substring then keeps array-insertion order on ties. Storage-atlas was declared AFTER the colliding entries. Collisions: - "spr": panel:oil-inventories (line 105) had exact 'spr' → tied with the new storage-facility-map (line 108) → insertion order kept oil-inventories winning. - "lng": panel:hormuz-tracker (line 135) has exact 'lng' → storage-facility-map only had substring 'lng terminals' (score 1) → hormuz won outright. Fix: - Remove 'spr' from oil-inventories keywords. The SPR as a *site list* semantically belongs to Strategic Storage Atlas. Stock-level queries still route to oil-inventories via 'strategic petroleum' (the word 'spr' is not a substring of 'strategic petroleum', so no fallback score leaks). - Add exact 'lng' to storage-facility-map. Both it and hormuz-tracker now score 3 on 'lng'; stable sort preserves declaration order, so storage (line 108) outranks hormuz (line 135). Hormuz still matches via 'hormuz', 'strait of hormuz', 'tanker', 'shipping'.
This commit is contained in:
@@ -102,10 +102,10 @@ export const COMMANDS: Command[] = [
|
||||
{ id: 'panel:asia', keywords: ['asia news', 'asia-pacific news'], label: 'Panel: Asia-Pacific', icon: '\u{1F30F}', category: 'panels' },
|
||||
{ id: 'panel:energy', keywords: ['energy', 'resources', 'oil news'], label: 'Panel: Energy & Resources', icon: '\u26A1', category: 'panels' },
|
||||
{ id: 'panel:energy-complex', keywords: ['energy complex', 'oil markets', 'gas markets', 'energy prices'], label: 'Panel: Energy Complex', icon: '\u{1F6E2}\uFE0F', category: 'panels' },
|
||||
{ id: 'panel:oil-inventories', keywords: ['oil inventories', 'crude stocks', 'spr', 'strategic petroleum', 'eia inventories', 'iea stocks', 'days of cover', 'oil reserves', 'gas storage'], label: 'Panel: Oil Inventories', icon: '\u{1F6E2}\uFE0F', category: 'panels' },
|
||||
{ id: 'panel:oil-inventories', keywords: ['oil inventories', 'crude stocks', 'strategic petroleum', 'eia inventories', 'iea stocks', 'days of cover', 'oil reserves', 'gas storage'], label: 'Panel: Oil Inventories', icon: '\u{1F6E2}\uFE0F', category: 'panels' },
|
||||
{ id: 'panel:energy-crisis', keywords: ['energy crisis', 'iea policy', 'crisis response', 'hormuz policy', 'fuel rationing', 'conservation measures'], label: 'Panel: Energy Crisis Policies', icon: '\u{26A1}', category: 'panels' },
|
||||
{ id: 'panel:pipeline-status', keywords: ['pipelines', 'pipeline status', 'oil pipelines', 'gas pipelines', 'nord stream', 'druzhba', 'sabotage', 'pipeline registry'], label: 'Panel: Oil & Gas Pipeline Status', icon: '\u{1F6E2}️', category: 'panels' },
|
||||
{ id: 'panel:storage-facility-map', keywords: ['storage', 'storage facilities', 'strategic storage', 'spr', 'lng terminals', 'ugs', 'tank farms', 'storage atlas'], label: 'Panel: Strategic Storage Atlas', icon: '\u{1F6E2}️', category: 'panels' },
|
||||
{ id: 'panel:storage-facility-map', keywords: ['storage', 'storage facilities', 'strategic storage', 'spr', 'lng', 'lng terminals', 'ugs', 'tank farms', 'storage atlas'], label: 'Panel: Strategic Storage Atlas', icon: '\u{1F6E2}️', category: 'panels' },
|
||||
{ id: 'panel:fuel-shortages', keywords: ['fuel shortages', 'shortage', 'petrol shortage', 'diesel shortage', 'jet fuel shortage', 'rationing', 'stations closed'], label: 'Panel: Global Fuel Shortage Registry', icon: '⛽', category: 'panels' },
|
||||
{ id: 'panel:gov', keywords: ['government', 'gov'], label: 'Panel: Government', icon: '\u{1F3DB}\uFE0F', category: 'panels' },
|
||||
{ id: 'panel:policy', keywords: ['policy', 'ai policy', 'regulation', 'tech policy'], label: 'Panel: AI Policy & Regulation', icon: '\u{1F4DC}', category: 'panels' },
|
||||
|
||||
Reference in New Issue
Block a user