[object Object]

← back to Rentv

chore: lint (py with-context), refactor (Invalid-Date guard, magic-number doc), v0.16.0 (session close)

871a02b4a94eaa0684904e4d6182fd16065cde7f · 2026-08-01 11:10:13 -0700 · Steve Abrams

- scripts/pull-vimeo-library.py: bare open() → with-context manager (lint)
- public/deals.html: guard new Date(fetched_at) against Invalid Date (refactor)
- public/metros.html: document the Math.max(5,...) bar-visibility floor (refactor)
- watchlist.html chip-toggle esc/raw mismatch FLAGGED for human (low-prob; CRE strings never contain &<>") — not auto-fixed
Bump 0.15.1 → 0.16.0 (session shipped backward-compatible sort+density + href-drill features).

Files touched

Diff

commit 871a02b4a94eaa0684904e4d6182fd16065cde7f
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Sat Aug 1 11:10:13 2026 -0700

    chore: lint (py with-context), refactor (Invalid-Date guard, magic-number doc), v0.16.0 (session close)
    
    - scripts/pull-vimeo-library.py: bare open() → with-context manager (lint)
    - public/deals.html: guard new Date(fetched_at) against Invalid Date (refactor)
    - public/metros.html: document the Math.max(5,...) bar-visibility floor (refactor)
    - watchlist.html chip-toggle esc/raw mismatch FLAGGED for human (low-prob; CRE strings never contain &<>") — not auto-fixed
    Bump 0.15.1 → 0.16.0 (session shipped backward-compatible sort+density + href-drill features).
---
 package-lock.json             | 4 ++--
 package.json                  | 2 +-
 public/deals.html             | 3 ++-
 public/metros.html            | 2 +-
 scripts/pull-vimeo-library.py | 3 ++-
 5 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index ce1a59d8..7fd8300b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
 {
   "name": "rentv",
-  "version": "0.12.0",
+  "version": "0.16.0",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
       "name": "rentv",
-      "version": "0.12.0",
+      "version": "0.16.0",
       "dependencies": {
         "express": "^4.21.2",
         "pg": "^8.22.0"
diff --git a/package.json b/package.json
index 2e7c1279..21019489 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "rentv",
-  "version": "0.15.1",
+  "version": "0.16.0",
   "private": true,
   "main": "server.js",
   "scripts": {
diff --git a/public/deals.html b/public/deals.html
index 9d326287..c90fd45b 100644
--- a/public/deals.html
+++ b/public/deals.html
@@ -156,7 +156,8 @@ function render(){
   try{
     const d=await (await fetch('/api/deals')).json();
     ALL=d.deals||[];
-    $('#fresh').textContent=d.fetched_at?('Deal flow as of '+new Date(d.fetched_at).toLocaleString()+' · source: RENTV.com'):'';
+    const ts=d.fetched_at&&new Date(d.fetched_at);
+    $('#fresh').textContent=(ts&&!isNaN(ts))?('Deal flow as of '+ts.toLocaleString()+' · source: RENTV.com'):'';
   }catch(e){ $('#fresh').textContent='Could not load deal listings — reload to retry.'; }
   const pickTxn=v=>{fTxn=v;pills($('#txns'),TXNS,fTxn,pickTxn);render();};
   const pickType=v=>{fType=v;pills($('#types'),TYPES,fType,pickType);render();};
diff --git a/public/metros.html b/public/metros.html
index ec418582..90b166a3 100644
--- a/public/metros.html
+++ b/public/metros.html
@@ -143,7 +143,7 @@ function render(){
         <div class="main">
           <div class="nm">${esc(g.name)}</div>
           <div class="sub">${g.top?`<span class="sec">${esc(g.top[0])} led</span>`:''}<span>${g.count} deal${g.count===1?'':'s'}</span>${g.vol?`<span>· avg ${esc(usd(g.vol/g.deals.filter(d=>d.amount).length))}</span>`:''}</div>
-          <div class="track"><div class="fill" style="width:${Math.max(5,Math.round((sort==='vol'?g.vol:g.count)/max*100))}%"></div></div>
+          <div class="track"><div class="fill" style="width:${Math.max(5,Math.round((sort==='vol'?g.vol:g.count)/max*100))}%"></div></div><!-- min 5% so bar stays visible at low values -->
         </div>
         <div class="r"><div class="vol">${g.vol?esc(usd(g.vol)):'—'}</div><div class="ct">${g.count} deal${g.count===1?'':'s'}</div><div class="chev">▾ deals</div></div>
       </div>
diff --git a/scripts/pull-vimeo-library.py b/scripts/pull-vimeo-library.py
index 2acff269..a122ab60 100644
--- a/scripts/pull-vimeo-library.py
+++ b/scripts/pull-vimeo-library.py
@@ -78,7 +78,8 @@ def main():
             continue
         try:
             req = urllib.request.Request(v["thumb"], headers={"User-Agent": UA})
-            open(dest, "wb").write(urllib.request.urlopen(req, timeout=20).read())
+            with open(dest, "wb") as fh:
+                fh.write(urllib.request.urlopen(req, timeout=20).read())
             v["thumb_local"] = f'/img/vimeo/{v["id"]}.jpg'
             new += 1
         except Exception:

← c06e94ce fix(metros): metro deal items drill to the specific deal (/n  ·  back to Rentv  ·  feat(social): add Instagram + featured RENTV Review video to cf61759d →