← back to Wallco Ai
/api/designs/search (the /designs grid filter) now color-aware too — same colorTokensForHex match as the global search. Was a separate code path still title/category-only (blue 0→271), so grid-filtering by color was a dead-end while global search worked. Now consistent
274ef88aeb2ae25e6fb9a22be9da3a9b0e2212e0 · 2026-06-03 16:25:07 -0700 · Steve Abrams
Files touched
Diff
commit 274ef88aeb2ae25e6fb9a22be9da3a9b0e2212e0
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Wed Jun 3 16:25:07 2026 -0700
/api/designs/search (the /designs grid filter) now color-aware too — same colorTokensForHex match as the global search. Was a separate code path still title/category-only (blue 0→271), so grid-filtering by color was a dead-end while global search worked. Now consistent
---
server.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/server.js b/server.js
index bf409a0..4ac27e2 100644
--- a/server.js
+++ b/server.js
@@ -660,6 +660,7 @@ app.get('/api/designs/search', (req, res) => {
const category = (d.category || '').toLowerCase();
const handle = (d.handle || '').toLowerCase();
const motifs = (d.motifs || []).map(m => m.toLowerCase());
+ const ctoks = colorTokensForHex(d.dominant_hex); // color WORDS (blue/navy/cream…)
let score = 0;
for (const t of terms) {
if (motifs.some(m => m === t)) score += 5; // exact motif match — strongest
@@ -668,6 +669,7 @@ app.get('/api/designs/search', (req, res) => {
if (category === t) score += 2;
else if (category.includes(t)) score += 1;
if (handle.includes(t)) score += 1;
+ if (ctoks.includes(t)) score += 2; // color-name match — same as global search
}
if (score > 0) {
// match on the raw title above; display the hex-consistent name (matches
← a340a82 YOLO ledger: T3 deploy-durability (rooms survive deploys, DT
·
back to Wallco Ai
·
YOLO ledger: T4 grid-search color-aware 1e91a5a →