feat(helpdesk): add trend delta indicator per agent in team dashboard
Shows a small arrow next to the ticket count in each agent card header: ↑3 (orange) = received 3 more than resolved → backlog growing ↓2 (green) = resolved 2 more than received → backlog shrinking Hidden when delta is 0 (stable). Delta is computed from received_in_period (tickets created in the selected period assigned to this agent) minus resolved_in_period. No snapshot storage needed — derived from existing ticket data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -220,6 +220,22 @@
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
/* Team workload — trend delta indicator */
|
||||
.helpdesk-team-trend-up,
|
||||
.helpdesk-team-trend-down {
|
||||
font-size: var(--text-xs, 0.75rem);
|
||||
font-weight: 600;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.helpdesk-team-trend-up {
|
||||
color: var(--app-warning, #f59e0b);
|
||||
}
|
||||
|
||||
.helpdesk-team-trend-down {
|
||||
color: var(--app-success, #198754);
|
||||
}
|
||||
|
||||
/* Team workload — inline avatar for section titles */
|
||||
.helpdesk-team-avatar-inline {
|
||||
display: inline-flex;
|
||||
|
||||
@@ -110,6 +110,15 @@ if (container) {
|
||||
title.appendChild(document.createTextNode(name));
|
||||
|
||||
title.appendChild(h('span', 'helpdesk-team-title-count', count));
|
||||
|
||||
// Trend delta: ↑3 (growing) or ↓2 (shrinking)
|
||||
const delta = m.trend_delta ?? 0;
|
||||
if (delta !== 0) {
|
||||
const arrow = delta > 0 ? '↑' : '↓';
|
||||
const cls = delta > 0 ? 'helpdesk-team-trend-up' : 'helpdesk-team-trend-down';
|
||||
title.appendChild(h('span', cls, arrow + Math.abs(delta)));
|
||||
}
|
||||
|
||||
section.appendChild(title);
|
||||
|
||||
// Ticket table
|
||||
|
||||
Reference in New Issue
Block a user