ehsan-dashboards/dashboards/seo/v3/index.html

784 lines
27 KiB
HTML
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🔍</text></svg>">
<title>ترمینال عملیاتی Apex Developer Cockpit سئو | Hamed Ecosystem</title>
<style>
@font-face {
font-family: 'Vazirmatn';
src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
font-weight: 400;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'Vazirmatn';
src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
font-weight: 700;
font-style: normal;
font-display: swap;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
body {
background-color: #F8FAFC;
color: #0F172A;
direction: rtl;
line-height: 1.6;
-webkit-font-smoothing: antialiased;
}
.tnum {
font-feature-settings: "tnum" 1;
font-variant-numeric: tabular-nums;
}
.container {
max-width: 1440px;
margin: 0 auto;
padding: 0 24px;
}
/* Top sticky header */
.top-header {
position: sticky;
top: 0;
z-index: 1000;
background: rgba(255, 255, 255, 0.94);
backdrop-filter: blur(12px);
border-bottom: 1px solid #E2E8F0;
padding: 14px 0;
box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.03);
}
.header-inner {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 16px;
}
.brand-group {
display: flex;
align-items: center;
gap: 14px;
}
.logo-badge {
background: #0F172A;
color: #FFFFFF;
font-weight: 800;
padding: 6px 12px;
border-radius: 8px;
font-size: 14px;
letter-spacing: 0.5px;
}
.brand-text h1 {
font-size: 18px;
font-weight: 800;
color: #0F172A;
line-height: 1.3;
}
.brand-text p {
font-size: 12px;
color: #64748B;
}
/* Navigation tier pills */
.nav-tiers {
display: flex;
align-items: center;
gap: 8px;
background: #F1F5F9;
padding: 4px;
border-radius: 10px;
border: 1px solid #E2E8F0;
}
.tier-link {
text-decoration: none;
font-size: 12px;
font-weight: 700;
padding: 6px 14px;
border-radius: 7px;
color: #475569;
transition: all 0.2s ease;
display: flex;
align-items: center;
gap: 6px;
}
.tier-link:hover {
color: #0F172A;
background: rgba(255, 255, 255, 0.6);
}
.tier-link.active {
background: #FFFFFF;
color: #0F172A;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
/* KPI telemetry bar */
.telemetry-band {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: 14px;
margin: 24px 0;
}
@media (max-width: 1200px) {
.telemetry-band { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
.telemetry-band { grid-template-columns: repeat(2, 1fr); }
}
.card-kpi {
background: #FFFFFF;
border: 1px solid #E2E8F0;
border-radius: 14px;
padding: 16px;
box-shadow: 0 1px 3px rgba(0,0,0,0.02);
transition: transform 0.2s, border-color 0.2s;
}
.card-kpi:hover {
transform: translateY(-2px);
border-color: #CBD5E1;
}
.card-kpi .label {
font-size: 11.5px;
font-weight: 600;
color: #64748B;
margin-bottom: 6px;
}
.card-kpi .value {
font-size: 22px;
font-weight: 800;
color: #0F172A;
line-height: 1.2;
}
.card-kpi .sub {
font-size: 11px;
font-weight: 600;
margin-top: 4px;
}
/* Badges */
.badge {
display: inline-flex;
align-items: center;
padding: 2px 8px;
border-radius: 6px;
font-size: 11px;
font-weight: 700;
}
.badge-p0 { background: #FFE4E6; color: #E11D48; border: 1px solid #FECDD3; }
.badge-p1 { background: #FEF3C7; color: #D97706; border: 1px solid #FDE68A; }
.badge-p2 { background: #EFF6FF; color: #2563EB; border: 1px solid #BFDBFE; }
.badge-p3 { background: #F3E8FF; color: #9333EA; border: 1px solid #E9D5FF; }
.badge-frontend { background: #EEF2FF; color: #4F46E5; }
.badge-backend { background: #ECFDF5; color: #059669; }
.badge-devops { background: #FFF7ED; color: #EA580C; }
.badge-taxonomy { background: #F0FDF4; color: #16A34A; }
/* Cards */
.card {
background: #FFFFFF;
border: 1px solid #E2E8F0;
border-radius: 16px;
padding: 20px;
margin-bottom: 20px;
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02), 0 6px 16px -4px rgba(15, 23, 42, 0.03);
}
.card-title {
font-size: 15px;
font-weight: 800;
color: #0F172A;
margin-bottom: 14px;
display: flex;
justify-content: space-between;
align-items: center;
}
/* Tables */
.table-wrap {
overflow-x: auto;
border-radius: 12px;
border: 1px solid #E2E8F0;
}
table {
width: 100%;
border-collapse: collapse;
text-align: right;
font-size: 13px;
}
thead th {
background: #F8FAFC;
color: #475569;
font-weight: 700;
padding: 12px 14px;
border-bottom: 1px solid #E2E8F0;
white-space: nowrap;
}
tbody tr {
border-bottom: 1px solid #F1F5F9;
transition: background 0.15s;
}
tbody tr:hover {
background: #F8FAFC;
cursor: pointer;
}
tbody td {
padding: 12px 14px;
color: #334155;
vertical-align: middle;
}
/* Sprint Gantt view */
.sprint-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 16px;
margin-bottom: 24px;
}
@media (max-width: 992px) {
.sprint-grid { grid-template-columns: 1fr; }
}
.sprint-box {
background: #FFFFFF;
border: 1px solid #E2E8F0;
border-radius: 12px;
padding: 16px;
}
.sprint-box.active-sprint {
border-color: #3B82F6;
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}
.sprint-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px;
}
.sprint-title {
font-size: 13px;
font-weight: 800;
color: #0F172A;
}
/* Code / Drawer */
.drawer-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(15, 23, 42, 0.5);
backdrop-filter: blur(3px);
z-index: 9998;
opacity: 0;
pointer-events: none;
transition: opacity 0.25s ease;
}
.drawer-overlay.open {
opacity: 1;
pointer-events: auto;
}
.drawer {
position: fixed;
top: 0;
left: 0;
width: 720px;
max-width: 92vw;
height: 100vh;
background: #FFFFFF;
z-index: 9999;
box-shadow: 4px 0 24px rgba(0,0,0,0.2);
transform: translateX(-100%);
transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
display: flex;
flex-direction: column;
overflow: hidden;
}
.drawer.open {
transform: translateX(0);
}
.drawer-header {
padding: 16px 20px;
border-bottom: 1px solid #E2E8F0;
display: flex;
justify-content: space-between;
align-items: center;
background: #F8FAFC;
}
.drawer-body {
flex: 1;
overflow-y: auto;
padding: 20px;
}
.code-block {
background: #0F172A;
color: #E2E8F0;
padding: 14px;
border-radius: 10px;
font-family: monospace;
font-size: 12px;
direction: ltr;
text-align: left;
overflow-x: auto;
white-space: pre-wrap;
position: relative;
}
.copy-btn {
position: absolute;
top: 8px;
right: 8px;
background: rgba(255,255,255,0.15);
color: #FFFFFF;
border: none;
padding: 4px 10px;
border-radius: 6px;
font-size: 11px;
cursor: pointer;
}
.copy-btn:hover {
background: rgba(255,255,255,0.3);
}
.btn-action {
background: #0F172A;
color: #FFFFFF;
border: none;
padding: 8px 16px;
border-radius: 8px;
font-weight: 700;
font-size: 12px;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 6px;
text-decoration: none;
}
.btn-action:hover {
background: #1E293B;
}
.btn-outline {
background: #FFFFFF;
color: #0F172A;
border: 1px solid #CBD5E1;
padding: 8px 16px;
border-radius: 8px;
font-weight: 700;
font-size: 12px;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 6px;
}
.btn-outline:hover {
background: #F8FAFC;
}
</style>
<script src="../data_bundle.js?v=20260915_22tasks"></script>
<script src="../vendor/plotly.min.js"></script>
<style>
.cockpit-layout {
display: grid;
grid-template-columns: 420px 1fr;
gap: 16px;
height: calc(100vh - 110px);
}
@media (max-width: 1024px) {
.cockpit-layout { grid-template-columns: 1fr; height: auto; }
}
.pane-card {
background: #FFFFFF;
border: 1px solid #E2E8F0;
border-radius: 12px;
display: flex;
flex-direction: column;
overflow: hidden;
}
.pane-header {
padding: 12px 16px;
background: #F8FAFC;
border-bottom: 1px solid #E2E8F0;
display: flex;
justify-content: space-between;
align-items: center;
}
.queue-list {
overflow-y: auto;
flex: 1;
padding: 8px;
}
.queue-item {
padding: 10px 12px;
border: 1px solid #E2E8F0;
border-radius: 8px;
margin-bottom: 6px;
cursor: pointer;
background: #FFFFFF;
transition: all 0.15s ease-in-out;
}
.queue-item:hover {
background: #F8FAFC;
border-color: #CBD5E1;
}
.queue-item.selected {
background: #EFF6FF;
border-color: #3B82F6;
box-shadow: 0 0 0 1px #3B82F6;
}
.detail-pane {
overflow-y: auto;
flex: 1;
padding: 18px;
}
.hotkey-tag {
background: #0F172A;
color: #F8FAFC;
font-size: 10.5px;
font-weight: 700;
padding: 2px 6px;
border-radius: 4px;
font-family: monospace;
}
.filter-pill {
background: #F1F5F9;
border: 1px solid #E2E8F0;
border-radius: 6px;
padding: 4px 10px;
font-size: 11px;
font-weight: 700;
cursor: pointer;
color: #475569;
transition: all 0.15s;
}
.filter-pill.active {
background: #0F172A;
color: #FFFFFF;
border-color: #0F172A;
}
</style>
</head>
<body>
<!-- Top Navigation Bar -->
<div class="top-header">
<div class="container header-inner">
<div class="brand-group">
<span class="logo-badge" style="background: #4F46E5;">APEX COCKPIT</span>
<div class="brand-text">
<h1>ترمینال فنی و کنسول عملیاتی دولوپرها (Apex Cockpit)</h1>
<p>کنترل سریع، دیف زنده سورس‌کد و کپی مستقیم اسکریپت‌های تست ۲۲ اقدام مهندسی</p>
</div>
</div>
<div class="nav-tiers">
<a href="../" class="tier-link">
<span>📌</span> نسخه ۱: عملیات
</a>
<a href="../v2/" class="tier-link">
<span>📊</span> نسخه ۲: Executive BI
</a>
<a href="../v3/" class="tier-link active">
<span>⚡</span> نسخه ۳: Apex Cockpit
</a>
<a href="../new/" class="tier-link">
<span>🚀</span> نسخه جدید: C-Level Staging
</a>
</div>
<div style="display: flex; gap: 8px; align-items: center;">
<span class="hotkey-tag">J / K</span> <span style="font-size: 11px; color: #64748B;">پیمایش</span>
<span class="hotkey-tag">Space</span> <span style="font-size: 11px; color: #64748B;">جزئیات</span>
<span class="hotkey-tag">/</span> <span style="font-size: 11px; color: #64748B;">جستجو</span>
</div>
</div>
</div>
<main class="container" style="padding-top: 14px; padding-bottom: 20px;">
<div class="cockpit-layout">
<!-- Right Pane: Tasks Queue -->
<div class="pane-card">
<div class="pane-header">
<div style="font-weight: 800; font-size: 13px; color: #0F172A;">
صف وظایف فنی (<span id="queue-count" class="tnum">۲۲</span>)
</div>
<button class="btn-action" style="padding: 4px 10px; font-size: 11px;" onclick="exportTasksToCSV()">
📥 CSV اکسل
</button>
</div>
<!-- Controls & Filters -->
<div style="padding: 10px; border-bottom: 1px solid #E2E8F0; background: #FFFFFF;">
<input type="text" id="cockpit-search" placeholder="فیلتر سریع (یا کلید /)..." style="width: 100%; padding: 6px 10px; border: 1px solid #CBD5E1; border-radius: 6px; font-size: 12px; margin-bottom: 8px;" oninput="filterQueue()" />
<div style="display: flex; flex-wrap: wrap; gap: 4px;">
<button class="filter-pill active" id="pill-crit" onclick="setCockpitFilter('crit')">🔥 فقط ۱۲ بحرانی</button>
<button class="filter-pill" id="pill-all" onclick="setCockpitFilter('all')">🌐 کل ۲۲ اقدام</button>
<button class="filter-pill" id="pill-frontend" onclick="setCockpitFilter('frontend')">فرانت‌اند</button>
<button class="filter-pill" id="pill-backend" onclick="setCockpitFilter('backend')">بک‌اند</button>
<button class="filter-pill" id="pill-taxonomy" onclick="setCockpitFilter('taxonomy')">تاکسونومی</button>
<button class="filter-pill" id="pill-devops" onclick="setCockpitFilter('devops')">دوآپس</button>
</div>
</div>
<div class="queue-list" id="queue-container">
<!-- Rendered by JS -->
</div>
</div>
<!-- Left Pane: Inspector & Code Diff -->
<div class="pane-card">
<div class="pane-header">
<div style="display: flex; align-items: center; gap: 8px;">
<span id="inspect-p-badge" class="badge"></span>
<span id="inspect-sprint-badge" class="badge" style="background:#F1F5F9; color:#475569;"></span>
<span id="inspect-id" class="tnum font-bold" style="color: #0F172A; font-size: 14px;"></span>
</div>
<button class="btn-action" style="padding: 5px 12px; font-size: 11.5px;" onclick="copyCode('inspect-test')">
⚡ کپی اسکریپت آزمون
</button>
</div>
<div class="detail-pane" id="detail-pane">
<h2 id="inspect-title" style="font-size: 17px; font-weight: 800; color: #0F172A; margin-bottom: 12px; line-height: 1.4;"></h2>
<div style="display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; background: #F8FAFC; border: 1px solid #E2E8F0; padding: 12px; border-radius: 8px; margin-bottom: 16px;">
<div>
<div style="font-size: 11px; color: #64748B;">مسیر فایل سورس:</div>
<div id="inspect-file" class="font-mono tnum" style="font-size: 12px; font-weight: 700; color: #2563EB;"></div>
</div>
<div>
<div style="font-size: 11px; color: #64748B;">زمان دولوپر:</div>
<div id="inspect-hours" class="tnum" style="font-size: 12.5px; font-weight: 700; color: #0F172A;"></div>
</div>
<div>
<div style="font-size: 11px; color: #64748B;">امتیاز RICE:</div>
<div id="inspect-rice" class="tnum" style="font-size: 13px; font-weight: 800; color: #059669;"></div>
</div>
<div>
<div style="font-size: 11px; color: #64748B;">ستون نظارتی:</div>
<div id="inspect-pillar" style="font-size: 12px; font-weight: 700; color: #4F46E5;"></div>
</div>
</div>
<div style="margin-bottom: 14px;">
<div style="font-size: 12px; font-weight: 700; color: #0F172A; margin-bottom: 4px;">🎯 اثر بیزینسی و رشد:</div>
<div id="inspect-impact" style="font-size: 12px; color: #334155; line-height: 1.6; background: #ECFDF5; border: 1px solid #A7F3D0; padding: 10px; border-radius: 8px;"></div>
</div>
<div style="margin-bottom: 14px;">
<div style="font-size: 12px; font-weight: 700; color: #0F172A; margin-bottom: 4px;">🔍 تحلیل ریشه‌ای باگ (Root-Cause):</div>
<div id="inspect-root-cause" style="font-size: 12px; color: #334155; line-height: 1.6; background: #FFFBEB; border: 1px solid #FDE68A; padding: 10px; border-radius: 8px;"></div>
</div>
<div style="margin-bottom: 14px;">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px;">
<span style="font-size: 12px; font-weight: 700; color: #DC2626;">❌ سورس باگ‌دار:</span>
<button class="btn-copy" onclick="copyCode('inspect-buggy')">کپی کد</button>
</div>
<pre class="code-block"><code id="inspect-buggy"></code></pre>
</div>
<div style="margin-bottom: 14px;">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px;">
<span style="font-size: 12px; font-weight: 700; color: #16A34A;">✅ سورس اصلاح‌شده:</span>
<button class="btn-copy" onclick="copyCode('inspect-fixed')">کپی کد</button>
</div>
<pre class="code-block"><code id="inspect-fixed"></code></pre>
</div>
<div>
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px;">
<span style="font-size: 12px; font-weight: 700; color: #0F172A;">⚡ دستور تست زنده:</span>
<button class="btn-copy" onclick="copyCode('inspect-test')">کپی دستور</button>
</div>
<pre class="code-block" style="background: #090D16;"><code id="inspect-test" style="color: #38BDF8;"></code></pre>
</div>
</div>
</div>
</div>
</main>
<script>
let activeTask = null;
function openTaskDrawer(taskId) {
const tasks = window.bundle?.tasks || [];
const task = tasks.find(t => t.id === taskId);
if (!task) return;
activeTask = task;
document.getElementById('drawer-id').innerText = task.id;
document.getElementById('drawer-title').innerText = task.title;
document.getElementById('drawer-file').innerText = `${task.file_path} (${task.lines})`;
document.getElementById('drawer-hours').innerText = `${task.hours} ساعت کاری`;
document.getElementById('drawer-rice').innerText = `${task.rice.score.toLocaleString('fa-IR')} (R:${task.rice.reach.toLocaleString('fa-IR')} | I:${task.rice.impact} | C:${task.rice.confidence} | E:${task.rice.effort})`;
document.getElementById('drawer-pillar').innerText = task.c_level_pillar || 'C-Suite Council';
document.getElementById('drawer-impact').innerText = task.business_impact;
document.getElementById('drawer-root-cause').innerText = task.root_cause_analysis || 'تحلیل فنی در ممیزی ۵ لایه تایید شده است.';
document.getElementById('drawer-buggy-code').innerText = task.buggy_code;
document.getElementById('drawer-fixed-code').innerText = task.fixed_code;
document.getElementById('drawer-test-command').innerText = task.test_command;
document.getElementById('drawer-badge-sprint').innerText = task.sprint;
const pBadge = document.getElementById('drawer-badge-p');
pBadge.className = `badge ${task.priority === 'P0' ? 'badge-p0' : (task.priority === 'P1' ? 'badge-p1' : 'badge-p2')}`;
pBadge.innerText = task.priority;
document.getElementById('task-drawer').classList.add('open');
document.getElementById('drawer-overlay').classList.add('open');
}
function closeTaskDrawer() {
document.getElementById('task-drawer').classList.remove('open');
document.getElementById('drawer-overlay').classList.remove('open');
}
function copyCode(elementId) {
const text = document.getElementById(elementId).innerText;
navigator.clipboard.writeText(text).then(() => {
alert('دستور / کد در حافظه کپی شد!');
});
}
function exportTasksToCSV() {
const tasks = window.bundle?.tasks || [];
if (!tasks.length) return;
let csv = '\\uFEFF';
csv += 'شناسه,وضعیت بحرانی,عنوان اقدام,لایه فنی,فاز اسپرینت,اولویت,زمان دولوپر (ساعت),Reach,Impact,Confidence,Effort,امتیاز RICE,ستون C-Level,مسیر فایل,خطوط,اثر بیزینسی,دستور تست\\n';
tasks.forEach(t => {
const isCrit = t.is_critical ? 'بحرانی P0/P1' : 'توسعه و استانداردسازی';
const cleanTitle = `"${(t.title || '').replace(/"/g, '""')}"`;
const cleanImpact = `"${(t.business_impact || '').replace(/"/g, '""')}"`;
const cleanTest = `"${(t.test_command || '').replace(/"/g, '""')}"`;
csv += `${t.id},${isCrit},${cleanTitle},${t.layer_title},${t.sprint},${t.priority},${t.hours},${t.rice.reach},${t.rice.impact},${t.rice.confidence},${t.rice.effort},${t.rice.score},${t.c_level_pillar || ''},${t.file_path},"${t.lines}",${cleanImpact},${cleanTest}\\n`;
});
const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' });
const url = URL.createObjectURL(blob);
const link = document.createElement('a');
link.setAttribute('href', url);
link.setAttribute('download', `ekeepa_seo_all_22_tasks_${new Date().toISOString().slice(0,10)}.csv`);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
let activeFilter = 'crit'; // Default to 12 critical tasks
let currentFiltered = [];
let selectedTaskId = 'SEO-01';
function setCockpitFilter(f) {
activeFilter = f;
document.querySelectorAll('.filter-pill').forEach(el => el.classList.remove('active'));
const activeBtn = document.getElementById(`pill-${f}`);
if (activeBtn) activeBtn.classList.add('active');
filterQueue();
}
function filterQueue() {
const q = document.getElementById('cockpit-search').value.toLowerCase();
const allTasks = window.bundle?.tasks || [];
currentFiltered = allTasks.filter(t => {
if (activeFilter === 'crit' && !t.is_critical) return false;
if (['frontend', 'backend', 'taxonomy', 'devops'].includes(activeFilter) && t.layer !== activeFilter) return false;
if (q) {
return t.title.toLowerCase().includes(q) || t.id.toLowerCase().includes(q) || t.file_path.toLowerCase().includes(q);
}
return true;
});
renderQueue();
if (currentFiltered.length && !currentFiltered.some(t => t.id === selectedTaskId)) {
selectTask(currentFiltered[0].id);
}
}
function renderQueue() {
const container = document.getElementById('queue-container');
document.getElementById('queue-count').innerText = currentFiltered.length.toLocaleString('fa-IR');
container.innerHTML = '';
currentFiltered.forEach(t => {
const div = document.createElement('div');
div.className = `queue-item ${t.id === selectedTaskId ? 'selected' : ''}`;
div.onclick = () => selectTask(t.id);
let pClass = t.priority === 'P0' ? 'badge-p0' : (t.priority === 'P1' ? 'badge-p1' : 'badge-p2');
const critPill = t.is_critical ? '<span style="font-size:10px; color:#DC2626; font-weight:800;">🔥</span>' : '';
div.innerHTML = `
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px;">
<div style="display: flex; align-items: center; gap: 6px;">
<span class="tnum font-bold" style="font-size: 13px; color: #0F172A;">${t.id}</span>
${critPill}
<span class="badge ${pClass}" style="padding: 1px 6px; font-size: 10px;">${t.priority}</span>
</div>
<span class="badge badge-${t.layer}" style="padding: 1px 6px; font-size: 10px;">${t.layer_title}</span>
</div>
<div style="font-size: 12px; font-weight: 700; color: #1E293B; margin-bottom: 4px; line-height: 1.4;">${t.title}</div>
<div class="font-mono tnum" style="font-size: 10.5px; color: #64748B;">${t.file_path}</div>
`;
container.appendChild(div);
});
}
function selectTask(id) {
selectedTaskId = id;
const tasks = window.bundle?.tasks || [];
const t = tasks.find(item => item.id === id);
if (!t) return;
document.querySelectorAll('.queue-item').forEach(el => el.classList.remove('selected'));
const idx = currentFiltered.findIndex(item => item.id === id);
const queueItems = document.getElementById('queue-container').children;
if (queueItems[idx]) queueItems[idx].classList.add('selected');
document.getElementById('inspect-id').innerText = `${t.id} (${t.priority})`;
document.getElementById('inspect-title').innerText = t.title;
document.getElementById('inspect-file').innerText = `${t.file_path} (${t.lines})`;
document.getElementById('inspect-hours').innerText = `${t.hours} ساعت کاری`;
document.getElementById('inspect-rice').innerText = `امتیاز RICE: ${t.rice.score.toLocaleString('fa-IR')}`;
document.getElementById('inspect-pillar').innerText = t.c_level_pillar || 'C-Suite Council';
document.getElementById('inspect-impact').innerText = t.business_impact;
document.getElementById('inspect-root-cause').innerText = t.root_cause_analysis || 'تحلیل ممیزی ۵ لایه';
document.getElementById('inspect-buggy').innerText = t.buggy_code;
document.getElementById('inspect-fixed').innerText = t.fixed_code;
document.getElementById('inspect-test').innerText = t.test_command;
document.getElementById('inspect-sprint-badge').innerText = t.sprint;
const pBadge = document.getElementById('inspect-p-badge');
pBadge.className = `badge ${t.priority === 'P0' ? 'badge-p0' : (t.priority === 'P1' ? 'badge-p1' : 'badge-p2')}`;
pBadge.innerText = t.priority;
}
// Keyboard Shortcuts (J/K navigation, / for search)
document.addEventListener('keydown', (e) => {
if (e.target.tagName === 'INPUT') return;
if (e.key === 'j' || e.key === 'ArrowDown') {
e.preventDefault();
const currIdx = currentFiltered.findIndex(t => t.id === selectedTaskId);
if (currIdx < currentFiltered.length - 1) {
selectTask(currentFiltered[currIdx + 1].id);
}
} else if (e.key === 'k' || e.key === 'ArrowUp') {
e.preventDefault();
const currIdx = currentFiltered.findIndex(t => t.id === selectedTaskId);
if (currIdx > 0) {
selectTask(currentFiltered[currIdx - 1].id);
}
} else if (e.key === '/') {
e.preventDefault();
document.getElementById('cockpit-search').focus();
}
});
document.addEventListener('DOMContentLoaded', () => {
filterQueue();
selectTask('SEO-01');
});
</script>
</body>
</html>