Skip to content

Commit 72de730

Browse files
authored
Merge pull request #128 from RivianTrackr/claude/redesign-search-bar-6XsOg
Redesign search bar with explicit Search and AI buttons
2 parents 41f5ef6 + 46bd82e commit 72de730

7 files changed

Lines changed: 106 additions & 727 deletions

File tree

frontend/css/rivian-tires.css

Lines changed: 46 additions & 199 deletions
Original file line numberDiff line numberDiff line change
@@ -60,52 +60,80 @@
6060
}
6161
}
6262

63-
/* === AI Tire Advisor (inside filter panel) === */
64-
.rtg-ai-section {
63+
/* === Search Row (input + Search button + optional AI button) === */
64+
.rtg-search-section {
6565
margin-bottom: 20px;
6666
}
6767

68-
/* Flex row: [ search-container ] [ submit button ] */
69-
.rtg-ai-row {
68+
.rtg-search-row {
7069
display: flex !important;
7170
align-items: center !important;
7271
gap: 8px !important;
7372
}
7473

75-
/* The search-container fills remaining space; button sits outside */
76-
.rtg-ai-row .search-container {
74+
.rtg-search-row .search-container {
7775
flex: 1 !important;
7876
min-width: 0 !important;
7977
}
8078

81-
/* Accent-colored wand icon (uses standard .search-icon absolute positioning) */
82-
.rtg-ai-icon {
83-
color: var(--rtg-accent) !important;
79+
/* Search button */
80+
.rtg-search-btn {
81+
flex-shrink: 0 !important;
82+
display: flex !important;
83+
align-items: center !important;
84+
justify-content: center !important;
85+
gap: 6px !important;
86+
height: 44px !important;
87+
min-width: 44px !important;
88+
padding: 0 14px !important;
89+
margin: 0 !important;
90+
background: var(--rtg-bg-input) !important;
91+
color: var(--rtg-text-primary) !important;
92+
border: 2px solid transparent !important;
93+
border-radius: 8px !important;
94+
cursor: pointer !important;
95+
font-size: 14px !important;
96+
font-weight: 600 !important;
97+
line-height: 1 !important;
98+
white-space: nowrap !important;
99+
transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
100+
position: static !important;
101+
transform: none !important;
84102
}
85103

86-
/* Keep input border-radius rounded on focus */
87-
.rtg-ai-input:focus {
88-
border-radius: 8px !important;
104+
.rtg-search-btn i {
105+
font-size: 14px !important;
89106
}
90107

91-
/* Submit button outside the bar */
108+
.rtg-search-btn:hover {
109+
background: var(--rtg-accent) !important;
110+
color: #fff !important;
111+
}
112+
113+
.rtg-search-btn:active {
114+
transform: scale(0.93) !important;
115+
}
116+
117+
/* AI submit button */
92118
.rtg-ai-submit {
93119
flex-shrink: 0 !important;
94120
display: flex !important;
95121
align-items: center !important;
96122
justify-content: center !important;
97-
width: 44px !important;
123+
gap: 6px !important;
98124
height: 44px !important;
99125
min-width: 44px !important;
100-
padding: 0 !important;
126+
padding: 0 14px !important;
101127
margin: 0 !important;
102128
background: var(--rtg-accent) !important;
103129
color: #fff !important;
104130
border: none !important;
105131
border-radius: 8px !important;
106132
cursor: pointer !important;
107-
font-size: 16px !important;
133+
font-size: 14px !important;
134+
font-weight: 600 !important;
108135
line-height: 1 !important;
136+
white-space: nowrap !important;
109137
transition: background-color 0.2s ease, transform 0.1s ease;
110138
position: static !important;
111139
transform: none !important;
@@ -240,11 +268,6 @@
240268
}
241269
}
242270

243-
/* === Ask AI suggestion in search dropdown === */
244-
.search-suggestion-ai {
245-
border-top: 1px solid var(--rtg-border) !important;
246-
}
247-
248271
/* === Filter Section — Card style matching compare page === */
249272
.filter-wrapper {
250273
background: var(--rtg-bg-card);
@@ -278,18 +301,14 @@
278301
}
279302

280303
/* === Search === */
281-
.filter-search {
282-
margin-bottom: 20px;
283-
width: 100%;
284-
}
285304
.search-container {
286305
position: relative !important;
287306
width: 100%;
288307
z-index: 10;
289308
}
290309
.search-input {
291310
width: 100% !important;
292-
padding: 12px 16px 12px 40px !important;
311+
padding: 12px 16px !important;
293312
border-radius: 8px !important;
294313
border: 2px solid transparent !important;
295314
background-color: var(--rtg-bg-input) !important;
@@ -301,25 +320,12 @@
301320
.search-input::placeholder {
302321
color: #9ca3af !important;
303322
}
304-
.search-icon {
305-
position: absolute;
306-
top: 50%;
307-
left: 14px;
308-
transform: translateY(-50%);
309-
color: #9ca3af;
310-
font-size: 16px;
311-
pointer-events: none;
312-
transition: color .15s;
313-
}
314323
.search-input:focus {
315324
outline: none !important;
316325
background-color: #1f2937 !important;
317326
box-shadow: 0 0 0 2px var(--rtg-accent) !important;
318327
border-color: var(--rtg-accent) !important;
319-
border-radius: 8px 8px 0 0 !important;
320-
}
321-
.search-input:focus + .search-icon {
322-
color: var(--rtg-accent) !important;
328+
border-radius: 8px !important;
323329
}
324330

325331
/* === Filter Controls === */
@@ -1935,137 +1941,6 @@ a.rtg-review-card-title-link:hover {
19351941
}
19361942
}
19371943

1938-
/* === Smart Search Auto-Complete === */
1939-
.search-suggestions-dropdown {
1940-
position: absolute;
1941-
top: 100%;
1942-
left: 0;
1943-
right: 0;
1944-
background: var(--rtg-bg-primary);
1945-
border: 2px solid var(--rtg-accent);
1946-
border-radius: 0 0 8px 8px;
1947-
border-top: none;
1948-
max-height: 320px;
1949-
overflow-y: auto;
1950-
z-index: 1000;
1951-
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
1952-
animation: slideDown 0.2s ease;
1953-
backdrop-filter: blur(8px);
1954-
}
1955-
@keyframes slideDown {
1956-
from {
1957-
opacity: 0;
1958-
transform: translateY(-10px);
1959-
max-height: 0;
1960-
}
1961-
to {
1962-
opacity: 1;
1963-
transform: translateY(0);
1964-
max-height: 320px;
1965-
}
1966-
}
1967-
.search-suggestion-item {
1968-
padding: 14px 16px;
1969-
cursor: pointer;
1970-
display: flex;
1971-
align-items: center;
1972-
justify-content: space-between;
1973-
transition: all 0.15s;
1974-
border-bottom: 1px solid var(--rtg-border);
1975-
position: relative;
1976-
background: transparent;
1977-
color: var(--rtg-text-light);
1978-
}
1979-
.search-suggestion-item:last-child {
1980-
border-bottom: none;
1981-
border-radius: 0 0 6px 6px;
1982-
}
1983-
.search-suggestion-item:hover,
1984-
.search-suggestion-item.active {
1985-
background: linear-gradient(135deg, var(--rtg-accent), var(--rtg-accent-hover)) !important;
1986-
color: #1a1a1a !important;
1987-
transform: translateX(2px);
1988-
}
1989-
.search-suggestion-item:hover .suggestion-icon,
1990-
.search-suggestion-item.active .suggestion-icon {
1991-
color: #1a1a1a !important;
1992-
}
1993-
.search-suggestion-item:hover .suggestion-meta,
1994-
.search-suggestion-item.active .suggestion-meta {
1995-
color: #1a1a1a !important;
1996-
}
1997-
.search-suggestion-item:hover .suggestion-type-badge,
1998-
.search-suggestion-item.active .suggestion-type-badge {
1999-
background: rgba(26, 26, 26, 0.2) !important;
2000-
color: #1a1a1a !important;
2001-
}
2002-
.suggestion-content {
2003-
display: flex;
2004-
align-items: center;
2005-
gap: 12px;
2006-
flex: 1;
2007-
min-width: 0;
2008-
}
2009-
.suggestion-icon {
2010-
color: var(--rtg-text-muted);
2011-
font-size: 14px;
2012-
width: 18px;
2013-
text-align: center;
2014-
flex-shrink: 0;
2015-
transition: color 0.15s;
2016-
}
2017-
.suggestion-text {
2018-
color: var(--rtg-text-light);
2019-
font-weight: 500;
2020-
font-size: 14px;
2021-
white-space: nowrap;
2022-
overflow: hidden;
2023-
text-overflow: ellipsis;
2024-
flex: 1;
2025-
transition: color 0.15s;
2026-
}
2027-
.suggestion-meta {
2028-
display: flex;
2029-
align-items: center;
2030-
gap: 8px;
2031-
flex-shrink: 0;
2032-
transition: color 0.15s;
2033-
}
2034-
.suggestion-type-badge {
2035-
background: var(--rtg-bg-input);
2036-
color: #9ca3af;
2037-
font-size: 10px;
2038-
padding: 3px 6px;
2039-
border-radius: 4px;
2040-
text-transform: uppercase;
2041-
font-weight: 600;
2042-
letter-spacing: 0.5px;
2043-
transition: all 0.15s;
2044-
}
2045-
.suggestion-count {
2046-
color: #6b7280;
2047-
font-size: 11px;
2048-
font-weight: 500;
2049-
transition: color 0.15s;
2050-
}
2051-
.search-suggestions-dropdown::-webkit-scrollbar {
2052-
width: 6px;
2053-
}
2054-
.search-suggestions-dropdown::-webkit-scrollbar-track {
2055-
background: var(--rtg-border);
2056-
border-radius: 0 0 6px 0;
2057-
}
2058-
.search-suggestions-dropdown::-webkit-scrollbar-thumb {
2059-
background: var(--rtg-accent);
2060-
border-radius: 3px;
2061-
}
2062-
.search-suggestions-dropdown::-webkit-scrollbar-thumb:hover {
2063-
background: var(--rtg-accent-hover);
2064-
}
2065-
.suggestion-type-brand .suggestion-icon { color: #fbbf24; }
2066-
.suggestion-type-model .suggestion-icon { color: #60a5fa; }
2067-
.suggestion-type-category .suggestion-icon { color: #a78bfa; }
2068-
.suggestion-type-size .suggestion-icon { color: #34d399; }
20691944

20701945
/* === Animations === */
20711946
@keyframes fadeIn {
@@ -2137,25 +2012,6 @@ a.rtg-review-card-title-link:hover {
21372012
font-size: 15px;
21382013
line-height: 1.7;
21392014
}
2140-
.search-suggestions-dropdown {
2141-
max-height: 250px;
2142-
}
2143-
.search-suggestion-item {
2144-
padding: 12px 14px;
2145-
}
2146-
.suggestion-text {
2147-
font-size: 13px;
2148-
}
2149-
.suggestion-meta {
2150-
gap: 6px;
2151-
}
2152-
.suggestion-type-badge {
2153-
font-size: 9px;
2154-
padding: 2px 5px;
2155-
}
2156-
.suggestion-count {
2157-
font-size: 10px;
2158-
}
21592015
#compareBar {
21602016
flex-wrap: wrap;
21612017
justify-content: space-between;
@@ -2277,15 +2133,6 @@ a.rtg-review-card-title-link:hover {
22772133

22782134
/* === Reduced Motion === */
22792135
@media (prefers-reduced-motion: reduce) {
2280-
.search-suggestions-dropdown {
2281-
animation: none;
2282-
}
2283-
.search-suggestion-item {
2284-
transition: none;
2285-
}
2286-
.search-suggestion-item:hover {
2287-
transform: none;
2288-
}
22892136
.tire-card {
22902137
transition: none;
22912138
}

frontend/css/rivian-tires.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/js/modules/filters.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { VALIDATION_PATTERNS, NUMERIC_BOUNDS, ALLOWED_SORT_OPTIONS, sanitizeInpu
1010
import { RTG_ANALYTICS } from './analytics.js';
1111
import { renderCards, preloadNextPageImages } from './cards.js';
1212
import { loadTireRatings } from './ratings.js';
13-
import { isPreciseMatch, hideSearchSuggestions } from './search.js';
13+
import { isPreciseMatch } from './search.js';
1414
import { isServerSide, serverSideFilterAndRender } from './server.js';
1515

1616
export function buildFilterIndexes() {
@@ -523,7 +523,6 @@ export function resetFilters() {
523523
if (slider) updateSliderBackground(slider);
524524
});
525525

526-
hideSearchSuggestions();
527526
delete state.domCache["searchInput"];
528527
state.lastFilterState = null;
529528

0 commit comments

Comments
 (0)