[object Object]

← back to Sublease Leaderboard

pin unattributed bucket last; add search, sort+density, type chips, CSV export, a11y

178f481ce383457170c3405c74ffb7cde5d4e508 · 2026-07-23 18:15:04 -0700 · Steve

Files touched

Diff

commit 178f481ce383457170c3405c74ffb7cde5d4e508
Author: Steve <steve@designerwallcoverings.com>
Date:   Thu Jul 23 18:15:04 2026 -0700

    pin unattributed bucket last; add search, sort+density, type chips, CSV export, a11y
---
 index.html | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/index.html b/index.html
index d6f7fb6..3b62c84 100644
--- a/index.html
+++ b/index.html
@@ -351,13 +351,20 @@ let activeSource=null, cityFilter=null, typeFilter=null;
 let listSort = localStorage.getItem('sub_listsort') || 'sf-desc';
 let searchQ = '';
 
-/* ---- render leaderboard table ---- */
-function renderTable(){
-  const rows=[...SOURCES].sort((a,b)=>{
+/* sort sources but always pin the un-sourced bucket to the bottom —
+   it's not a broker, so it shouldn't compete for rank #1 */
+function sortedSources(){
+  return [...SOURCES].sort((a,b)=>{
+    if(!a.dom !== !b.dom) return a.dom ? -1 : 1;
     const av=a[sortKey], bv=b[sortKey];
     if(typeof av==='string') return sortDir*av.localeCompare(bv);
     return sortDir*(av-bv);
   });
+}
+
+/* ---- render leaderboard table ---- */
+function renderTable(){
+  const rows=sortedSources();
   const maxCount=Math.max(...rows.map(r=>r.count),1);
   const body=document.getElementById('lbBody');
   body.innerHTML='';
@@ -553,11 +560,7 @@ searchBox.oninput=()=>{ searchQ=searchBox.value.trim(); renderListings(); };
 
 /* ---- CSV export of leaderboard ---- */
 document.getElementById('csvBtn').onclick=()=>{
-  const rows=[...SOURCES].sort((a,b)=>{
-    const av=a[sortKey], bv=b[sortKey];
-    if(typeof av==='string') return sortDir*av.localeCompare(bv);
-    return sortDir*(av-bv);
-  });
+  const rows=sortedSources();
   const head=['Rank','Source','Domain','Listings','Total SF','Avg SF','Markets'];
   const lines=[head.join(',')];
   rows.forEach((r,i)=>{

← 78c8011 initial scaffold: sublease.com broker/source leaderboard  ·  back to Sublease Leaderboard  ·  (newest)