-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
378 lines (333 loc) · 21.3 KB
/
index.html
File metadata and controls
378 lines (333 loc) · 21.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Linear Analytics Dashboard</title>
<meta name="description"
content="Universal sprint analytics dashboard for Linear — velocity, lead time, WIP, burn-down, risk assessment and AI-powered recommendations." />
<!-- Styles -->
<link rel="stylesheet" href="styles/main.css" />
<!-- External Libraries -->
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.2/dist/chart.umd.min.js"></script>
<script src="js/marked.min.js"></script>
</head>
<body>
<!-- ── Loading Overlay ─────────────────────────────────────────── -->
<div id="loading-overlay" class="loading-overlay hidden">
<div class="loader"></div>
</div>
<!-- ── Error Banner ───────────────────────────────────────────── -->
<div id="error-banner" class="error-banner hidden"></div>
<!-- ── Settings Panel ─────────────────────────────────────────── -->
<div id="settings-panel" class="settings-panel" role="dialog" aria-label="Settings">
<div class="settings-header">
<span class="settings-title">⚙️ Settings</span>
<button class="btn btn-sm" id="settings-close" aria-label="Close settings">✕</button>
</div>
<div class="settings-group">
<span class="settings-label">Estimation Mode</span>
<div class="toggle-wrap">
<span>Count</span>
<label class="toggle-switch">
<input type="checkbox" id="estimation-toggle" role="switch" />
<span class="toggle-slider"></span>
</label>
<span>Story Points</span>
</div>
</div>
<div class="settings-group">
<label class="settings-label" for="stale-input">Stale Threshold (hours)</label>
<input type="number" id="stale-input" class="number-input" min="1" max="720" value="72" />
</div>
<div class="settings-group">
<span class="settings-label">Priority Filter</span>
<div class="btn-group">
<button class="btn btn-sm active" data-priority="all">All</button>
<button class="btn btn-sm" data-priority="high">High+</button>
<button class="btn btn-sm" data-priority="urgent">Urgent only</button>
</div>
</div>
<div class="settings-group">
<span class="settings-label">API Token</span>
<button class="btn btn-sm" id="change-token-btn">🔑 Change Token</button>
</div>
<hr style="margin: 16px 0; border: none; border-top: 1px solid var(--border);" />
<div class="settings-group" style="flex-direction: column; align-items: flex-start; gap: 8px;">
<span class="settings-label">🤖 AI Analysis (Hydra AI)</span>
<input type="password" id="hydra-token-input" class="token-input" placeholder="Hydra API Key"
style="width: 100%; padding: 4px 8px;" autocomplete="off" spellcheck="false" />
<select id="hydra-model-select" class="number-input" style="width: 100%; padding: 4px 8px;">
<option value="gemini-3.0-flash" selected>Gemini Flash 3.0</option>
<option value="gemini-3.0-pro">Gemini Pro 3.0</option>
</select>
<span class="settings-hint" style="font-size: 11px; color: var(--text-3);">Used for 'Issue Analyzer' deep
semantic checks</span>
</div>
</div>
<!-- ── App ────────────────────────────────────────────────────── -->
<div id="app">
<!-- ── Setup Screen ─────────────────────────────────────────── -->
<div id="setup-screen">
<div class="setup-logo">📊</div>
<h1 class="setup-title">Linear Analytics Dashboard</h1>
<p class="setup-sub">Connect your Linear workspace to get real-time sprint analytics, velocity tracking, and
AI-powered recommendations.</p>
<form class="setup-form" id="token-form">
<input type="password" id="token-input" class="token-input"
placeholder="lin_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" autocomplete="off" spellcheck="false"
required />
<button type="submit" class="btn btn-primary">
🚀 Connect to Linear
</button>
</form>
<p class="setup-hint" style="margin-top:16px">
Generate a Personal Access Token in
<a href="https://linear.app/settings/api" target="_blank" rel="noopener">Linear Settings → API</a>
</p>
</div>
<!-- ── Main Dashboard ──────────────────────────────────────── -->
<div id="main-dashboard" class="hidden">
<!-- Header -->
<header>
<div>
<div class="logo">
<div class="logo-icon">📊</div>
<span>Linear Dashboard</span>
</div>
<div id="cycle-header" style="margin-top:6px"></div>
</div>
<div class="header-search"
style="margin: 0 20px; flex-grow: 1; max-width: 400px; display: flex; align-items: center;">
<div style="position: relative; width: 100%;">
<span
style="position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3);">🔍</span>
<input type="text" id="global-issue-search" placeholder="Analyse issue: ENG-123..."
class="search-input"
style="width: 100%; padding: 6px 10px 6px 30px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text-1);" />
</div>
</div>
<div class="header-right">
<button class="btn btn-sm hidden" id="clear-filter-btn" aria-label="Clear active filter"
style="background: rgba(248, 113, 113, 0.15); color: var(--rose); border: 1px solid rgba(248, 113, 113, 0.3);">
❌ Clear Filter
</button>
<button class="btn btn-sm hidden" id="open-cycle-report-btn"
style="background: rgba(34, 197, 94, 0.15); color: var(--emerald); border: 1px solid rgba(34, 197, 94, 0.3);">
🏁 Cycle Report
</button>
<select id="team-select" title="Select team" aria-label="Select team" style="display:none"></select>
<select id="cycle-select" title="Select cycle" aria-label="Select cycle"></select>
<button class="btn btn-sm" id="refresh-btn" title="Refresh data" aria-label="Refresh">
🔄 Refresh
</button>
<button class="btn btn-sm" id="settings-btn" aria-label="Open settings">
⚙️ Settings
</button>
<span id="last-updated"></span>
</div>
</header>
<!-- ── Block A: Executive Summary ─────────────────────────── -->
<section class="card full-width" aria-label="Executive Summary">
<div class="card-title"><span class="icon">📈</span> Executive Summary</div>
<!-- Progress -->
<div class="progress-section">
<div class="progress-row"
data-tooltip="Sprint progress: comparison of closed tasks (top) with elapsed time (bottom). 📈 Good: Task progress is ahead of elapsed time. 📉 Bad: Task progress lags behind elapsed time (risk of not finishing in time).">
<span>Sprint Progress</span>
<span id="progress-label">—</span>
</div>
<div class="progress-track">
<div id="progress-bar-fill" class="progress-fill indigo" style="width:0%"></div>
</div>
<div class="progress-row" style="margin-top:10px">
<span style="font-size:11px;color:var(--text-3)">Time elapsed</span>
<span style="font-size:11px;color:var(--text-3)"></span>
</div>
<div class="progress-track thin">
<div id="time-progress-bar-fill" class="progress-fill indigo" style="width:0%"></div>
</div>
</div>
<!-- Prediction -->
<div class="prediction-box" id="prediction-text"
data-tooltip="Sprint completion forecast based on your Velocity and remaining work. 📈 Good: On track to finish on time. 📉 Bad: Likely delay, consider reducing scope.">
<span class="pred-neutral">⏳ Loading prediction…</span>
</div>
<!-- Issue stat pills -->
<div class="stat-pills" id="issue-stats"></div>
<!-- KPI cards -->
<div class="kpi-grid" style="margin-top:20px">
<div class="kpi-card" id="kpi-velocity">
<div class="kpi-label"
data-tooltip="Velocity — how much work is completed per day. 📈 Good: Value is stable or growing. 📉 Bad: Drops sharply (blockers, idle time).">
⚡ Velocity</div>
<div class="kpi-value">—</div>
<div class="kpi-row">
<span class="kpi-sub" title="Historical average">hist: —</span>
<span class="kpi-trend"></span>
</div>
<div class="kpi-footer">items/day</div>
</div>
<div class="kpi-card" id="kpi-leadtime">
<div class="kpi-label"
data-tooltip="Lead Time — from start of work to its completion. 📈 Good: Time is decreasing (delivering faster). 📉 Bad: Increasing (stuck in QA or code review).">
⏱ Lead Time (avg)</div>
<div class="kpi-value">—</div>
<div class="kpi-row">
<span class="kpi-sub">median: —</span>
</div>
<div class="kpi-footer">start → done</div>
</div>
<div class="kpi-card" id="kpi-wip">
<div class="kpi-label"
data-tooltip="WIP (Work In Progress) — number of tasks currently in progress. 📈 Good: Focused work (1-2 per person). 📉 Bad: Too many tasks per person (loss of focus) or too few (idle time).">
🔄 WIP</div>
<div class="kpi-value">—</div>
<div class="kpi-row">
<span class="kpi-sub"></span>
</div>
<div class="kpi-footer">in progress now</div>
</div>
<div class="kpi-card" id="kpi-scope">
<div class="kpi-label"
data-tooltip="Scope Creep — new tasks added after sprint start. 📈 Good: 0 or very few (stable sprint). 📉 Bad: Constantly growing (poor planning or many bugs).">
📥 Scope Creep</div>
<div class="kpi-value">—</div>
<div class="kpi-row">
<span class="kpi-sub"></span>
</div>
<div class="kpi-footer">added after sprint start</div>
</div>
</div>
</section>
<div class="dashboard-grid">
<!-- ── Burn-down Chart ───────────────────────────────────── -->
<section class="card" aria-label="Burn-down chart">
<div class="card-title"
data-tooltip="Burn-down chart. Comparison of remaining work with the ideal line. 📈 Good: Your line is below or close to the ideal. 📉 Bad: Line is above ideal (falling behind) or spiking up (adding new tasks).">
<span class="icon">📉</span> Burn-down
</div>
<div class="chart-wrap">
<canvas id="burndown-chart"></canvas>
</div>
</section>
<!-- ── Block B: Risk Assessment ─────────────────────────── -->
<section class="card" aria-label="Risk Assessment">
<div class="card-title"
data-tooltip="Risk assessment based on stale tasks and blockers. 📈 Good: No risks or they are Low. 📉 Bad: Medium/High risks (threat to sprint goal).">
<span class="icon">⚠️</span> Risk Assessment
</div>
<div id="risk-container">
<div class="empty-state">Loading risks…</div>
</div>
</section>
<!-- ── Block C: Team Grid / Breakdown ────────────────────── -->
<section class="card full-width" aria-label="Team Performance">
<div class="section-header">
<div class="card-title"
data-tooltip="Team efficiency matrix. Shows the workload of each member and their results. 📈 Good: Even workload, green progress indicators. 📉 Bad: Overloaded members (red bars), many stale tasks.">
<span class="icon">👥</span> Performance Grid
</div>
<div class="btn-group" role="group" aria-label="Grouping mode">
<button class="btn btn-sm active" data-grouping="assignees">By Assignee</button>
<button class="btn btn-sm" data-grouping="projects">By Project</button>
<button class="btn btn-sm" data-grouping="labels">By Label</button>
</div>
</div>
<div id="team-grid-container">
<div class="empty-state">Loading data…</div>
</div>
</section>
<!-- ── Recommendations ───────────────────────────────────── -->
<section class="card full-width" aria-label="Recommendations">
<div class="card-title"
data-tooltip="Automated recommendations during the sprint. The system analyzes deviations in metrics and suggests solutions. Always pay attention to items with High priority.">
<span class="icon">💡</span> Recommendations
</div>
<div id="recommendations-container">
<div class="empty-state">Generating recommendations…</div>
</div>
</section>
</div>
</div>
</div>
<!-- ── Cycle Report Modal ─────────────────────────────────────── -->
<div id="cycle-report-modal" class="modal-backdrop hidden"
style="position: fixed; inset: 0; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(8px); z-index: 1000; display: flex; align-items: center; justify-content: center;">
<div class="card"
style="width: 90%; max-width: 800px; max-height: 90vh; overflow-y: auto; background: var(--bg-1); border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: var(--shadow-md);">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;">
<div class="card-title" style="margin: 0; color: var(--indigo); font-size: 1.25em;">
<span class="icon">🏁</span> Completed Cycle Report
</div>
<button id="close-cycle-report-btn" class="btn btn-sm" aria-label="Close report">✕</button>
</div>
<div class="kpi-grid">
<!-- Shared toggle: Tasks / Points -->
<div
style="grid-column: span 4; display: flex; justify-content: flex-end; gap: 8px; align-items: center; margin-bottom:-8px;">
<span style="font-size:12px;color:var(--text-3);">Show:</span>
<button id="cycle-report-count-btn" class="btn btn-sm active"
data-report-mode="count">Tasks</button>
<button id="cycle-report-points-btn" class="btn btn-sm" data-report-mode="points">Points</button>
</div>
<!-- Plan-Fact -->
<div class="kpi-card" style="grid-column: span 2;">
<div class="kpi-label">Plan / Fact</div>
<div style="display: flex; gap: 20px; align-items: center; margin-top: 10px;">
<div style="width: 100px; height: 100px; position: relative;">
<canvas id="plan-fact-chart"></canvas>
</div>
<div>
<div id="plan-fact-stats" style="font-size: 14px; line-height: 1.6; color: var(--text-2);">
</div>
</div>
</div>
</div>
<!-- Why not done -->
<div class="kpi-card" style="grid-column: span 2;">
<div class="kpi-label">Unfinished Work Analysis</div>
<div style="display: flex; gap: 20px; align-items: center; margin-top: 10px;">
<div style="width: 100px; height: 100px; position: relative;">
<canvas id="why-not-done-chart"></canvas>
</div>
<div style="flex: 1;">
<div id="why-not-done-stats"
style="font-size: 14px; line-height: 1.6; color: var(--text-2);"></div>
</div>
</div>
</div>
<!-- Features vs Bugs -->
<div class="kpi-card" style="grid-column: span 2;">
<div class="kpi-label">Features vs. Bugs (Completed)</div>
<div style="display: flex; gap: 20px; align-items: center; margin-top: 10px;">
<div style="width: 100px; height: 100px; position: relative;">
<canvas id="type-breakdown-chart"></canvas>
</div>
<div style="flex: 1;">
<div id="type-breakdown-stats"
style="font-size: 14px; line-height: 1.6; color: var(--text-2);"></div>
</div>
</div>
</div>
</div>
<div style="margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border);">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;">
<div class="kpi-label" style="margin: 0;">🤖 AI Cycle Conclusion</div>
<div style="display: flex; gap: 8px;">
<button id="cycle-copy-md-btn" class="btn btn-sm hidden">📋 Copy as Markdown</button>
<button id="run-cycle-ai-btn" class="btn btn-sm"
style="background: var(--indigo); color: white;">Generate AI Report</button>
</div>
</div>
<div id="cycle-ai-output"
style="background: var(--bg-2); padding: 16px; border-radius: 8px; border: 1px solid var(--border); font-size: 14px; line-height: 1.5; color: var(--text-2); display: none;">
<!-- AI output here -->
</div>
</div>
</div>
</div>
<!-- ── Dashboard JS (ES module) ───────────────────────────────── -->
<script type="module" src="js/dashboard.js"></script>
</body>
</html>