[object Object]

← back to Resume Queue Viewer

Expand sort options: Status, Priority, Title A→Z

bab11349736f5b5e2ee672dd942a0b826dcda325 · 2026-05-19 21:20:45 -0700 · SteveStudio2

Adds Status (open parking → resumable recaps → done), Priority (win ★
rank desc), and Title A→Z to the queue viewer's sort dropdown. All
existing options preserved. Selection still persists via localStorage
rq.sort and hydrates before the first render.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit bab11349736f5b5e2ee672dd942a0b826dcda325
Author: SteveStudio2 <steve@designerwallcoverings.com>
Date:   Tue May 19 21:20:45 2026 -0700

    Expand sort options: Status, Priority, Title A→Z
    
    Adds Status (open parking → resumable recaps → done), Priority (win ★
    rank desc), and Title A→Z to the queue viewer's sort dropdown. All
    existing options preserved. Selection still persists via localStorage
    rq.sort and hydrates before the first render.
    
    Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---
 server.js | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/server.js b/server.js
index 23b0834..64dc2a6 100644
--- a/server.js
+++ b/server.js
@@ -236,6 +236,9 @@ const PAGE = `<!doctype html>
   <select id="sort">
     <option value="new">Newest</option>
     <option value="old">Oldest</option>
+    <option value="status">Status (open first)</option>
+    <option value="priority">Priority (★)</option>
+    <option value="title">Title A→Z</option>
     <option value="type">Type</option>
   </select>
   <label>Density</label>
@@ -266,8 +269,15 @@ function render() {
     el.textContent = ' ' + (counts[el.dataset.ct] || 0); });
 
   let items = filter === 'all' ? all : all.filter(i => i.type === filter);
+  // Status rank: open parking items > resumable recaps > everything done.
+  const statusRank = i => (i.type==='parking' && !i.discussed) ? 0
+                        : (i.type==='recap') ? 1
+                        : (i.type==='parking' && i.discussed) ? 2 : 3;
   if (sort === 'new') items.sort((a,b)=>b.ts-a.ts);
   else if (sort === 'old') items.sort((a,b)=>a.ts-b.ts);
+  else if (sort === 'status') items.sort((a,b)=>statusRank(a)-statusRank(b) || b.ts-a.ts);
+  else if (sort === 'priority') items.sort((a,b)=>(b.rank||0)-(a.rank||0) || b.ts-a.ts);
+  else if (sort === 'title') items.sort((a,b)=>(a.title||'').localeCompare(b.title||''));
   else items.sort((a,b)=>a.type.localeCompare(b.type) || b.ts-a.ts);
 
   const g = document.getElementById('grid');

← 65467ca Add 404 guard for snapshot/backup URL paths  ·  back to Resume Queue Viewer  ·  Add per-site favicon (kills /favicon.ico 404) 79fdfe0 →