From 3b7afcf2f849c955c1c7f0addcd87f9c6556f73a Mon Sep 17 00:00:00 2001 From: Claude Chronicler #88 Date: Tue, 14 Apr 2026 17:22:06 +0000 Subject: [PATCH] =?UTF-8?q?bridge:=20REQ=20=E2=80=94=20code=20queue=20badg?= =?UTF-8?q?e=20fix=20for=20sidebar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../REQ-2026-04-14-code-queue-badge-fix.md | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 docs/code-bridge/requests/REQ-2026-04-14-code-queue-badge-fix.md diff --git a/docs/code-bridge/requests/REQ-2026-04-14-code-queue-badge-fix.md b/docs/code-bridge/requests/REQ-2026-04-14-code-queue-badge-fix.md new file mode 100644 index 0000000..a673f01 --- /dev/null +++ b/docs/code-bridge/requests/REQ-2026-04-14-code-queue-badge-fix.md @@ -0,0 +1,50 @@ +# Code Request — Code Queue Badge Fix + +**Filed by:** Chronicler #88 +**Date:** 2026-04-14 +**Priority:** Quick fix + +--- + +## Problem + +The Code Queue badge (cyan count next to "Tasks" in sidebar) is not showing. +It was in the spec for REQ-2026-04-14-task-module-improvements.md but was +not implemented in the layout or route. + +--- + +## Fix Required + +### 1. `src/routes/admin/index.js` — middleware that runs on every admin request + +Add a query that counts tasks where tags contains 'code' AND status is open/in_progress: + +```javascript +// Add to the middleware that runs before all admin routes +const codeQueueResult = await db.query( + "SELECT COUNT(*) FROM tasks WHERE 'code' = ANY(tags) AND status IN ('open', 'in_progress')" +); +res.locals.codeQueueCount = parseInt(codeQueueResult.rows[0].count) || 0; +``` + +### 2. `src/views/layout.ejs` — sidebar Tasks link + +Find the Tasks nav link and add the badge: + +```html +🗂️ Tasks +<% if (locals.codeQueueCount > 0) { %> + + <%= codeQueueCount %> + +<% } %> +``` + +--- + +## Notes +- Must use `res.locals` so it's available in layout without passing per-route +- Only show badge if count > 0 + +**Fire + Frost + Foundation** 💙🔥❄️