[object Object]

← back to All Designerwallcoverings

all.dw: vendor facet sorts alphabetically by name on load (was by count)

ce9854cde47b28ad7e7924c1a6e192f1ad7b7ef6 · 2026-07-14 11:19:49 -0700 · Steve

Files touched

Diff

commit ce9854cde47b28ad7e7924c1a6e192f1ad7b7ef6
Author: Steve <steve@designerwallcoverings.com>
Date:   Tue Jul 14 11:19:49 2026 -0700

    all.dw: vendor facet sorts alphabetically by name on load (was by count)
---
 public/index.html | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/public/index.html b/public/index.html
index cb3750a..9eb4af7 100644
--- a/public/index.html
+++ b/public/index.html
@@ -574,7 +574,9 @@ function facetList(rowId, counts, set, opts = {}) {
   let entries = Object.entries(counts || {});
   entries = opts.order
     ? entries.sort((a, b) => opts.order.indexOf(a[0]) - opts.order.indexOf(b[0]))
-    : entries.sort((a, b) => b[1] - a[1]);
+    : opts.byName
+      ? entries.sort((a, b) => a[0].localeCompare(b[0], undefined, { sensitivity: 'base' }))
+      : entries.sort((a, b) => b[1] - a[1]);
   if (ui.find) entries = entries.filter(([v]) => v.toLowerCase().includes(ui.find.toLowerCase()));
   const CAP = opts.cap || 8;
   let shown = entries, hidden = 0;
@@ -603,7 +605,7 @@ function facetList(rowId, counts, set, opts = {}) {
 let LAST_FACETS = {};
 function renderFacets(f) {
   LAST_FACETS = f;
-  facetList('vendorRow', f.vendor, state.vendors, { cap: 10 });
+  facetList('vendorRow', f.vendor, state.vendors, { cap: 10, byName: true });
   facetList('typeRow', f.type, state.types, { cap: 10 });
   facetList('seriesRow', f.series, state.series, { cap: 12 });
   facetList('colorRow', f.color, state.colors, { order: f.family_order, cap: 12 });

← 7e64421 Contrarian fixes: scope crawler cred to internal hosts only;  ·  back to All Designerwallcoverings  ·  chore: v1.4.1 (session close) — vendor facet alpha-sort 2a6cffc →