# 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** 💙🔥❄️