From 2fd9bfc0aa91e6849c1b60627d2dd8762cad0290 Mon Sep 17 00:00:00 2001 From: Hunter Martin <175766562+huntermar3@users.noreply.github.com> Date: Mon, 15 Dec 2025 18:09:17 -0500 Subject: [PATCH 1/2] fix duplicate location names being visable in search --- frontend/src/pages/ExplorePage.jsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/ExplorePage.jsx b/frontend/src/pages/ExplorePage.jsx index 71a1dda..4cbc283 100644 --- a/frontend/src/pages/ExplorePage.jsx +++ b/frontend/src/pages/ExplorePage.jsx @@ -140,11 +140,20 @@ export default function ExplorePage() { const suggestions = useMemo(() => { const q = (query || "").trim().toLowerCase(); if (!q) return []; - return locations + + // hashmaps are o(1) lookup to track unique locations + const seen = new Map(); + locations .map((r) => r.trip_location) .filter(Boolean) .filter((loc) => loc.toLowerCase().includes(q)) - .slice(0, 8); + .forEach((loc) => { + const key = loc.toLowerCase().trim(); + if (!seen.has(key)) { + seen.set(key, loc); + } + }); + return Array.from(seen.values()).slice(0, 8); }, [locations, query]); // click-outside to close suggestions From bc00449d2c645d447f3e55c020c50994caca9295 Mon Sep 17 00:00:00 2001 From: Hunter Martin <175766562+huntermar3@users.noreply.github.com> Date: Mon, 15 Dec 2025 18:26:01 -0500 Subject: [PATCH 2/2] hopefully fix a safari bug for autocomplete --- frontend/src/css/ExplorePage.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/css/ExplorePage.css b/frontend/src/css/ExplorePage.css index ac8444e..e25ef7c 100644 --- a/frontend/src/css/ExplorePage.css +++ b/frontend/src/css/ExplorePage.css @@ -82,6 +82,7 @@ html[data-theme="dark"] .pill.active { background: var(--accent); color: var(--b align-self: center; margin-top: 12px; margin-bottom: 12px; + z-index: 100; } .explore-search.closer { margin-top: 12px; @@ -97,6 +98,8 @@ html[data-theme="dark"] .pill.active { background: var(--accent); color: var(--b border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow-1); + position: relative; + z-index: 1; } .search-input-wrap input { flex: 1; @@ -113,7 +116,7 @@ html[data-theme="dark"] .pill.active { background: var(--accent); color: var(--b top: calc(100% + 4px); left: 0; right: 0; - z-index: 20; + z-index: 101; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);