Skip to content

Commit 8d7c827

Browse files
karpikplCopilot
andauthored
feat(ui): color Agent Activity KPI numbers and add user selection hint (#352)
* feat(ui): color Agent Activity KPI numbers and add user selection hint - AgentActivityViewer: apply Vuetify semantic colors to KPI values - Lines of code changed: text-primary (blue) - Agent contribution %: text-success (green) - Avg lines deleted: text-warning (orange) Matches the color pattern used in SeatsAnalysisViewer and MetricsViewer. - UserMetricsViewer: add info alert in User Insights section when no user is selected, prompting users to click a row in the table above to drill down into individual usage details. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(teams): replace broken team link with deselect button, add loading overlay - Comparison cards: replace 'mdi-open-in-new' link (pointing to removed /enterprises/:ent/teams/:slug route) with an [x] close button that removes the team from the selection - Single-team header: replace 'View Team' external link with a red 'Deselect' button that clears the team selection - Add v-overlay with spinner that locks the UI during data fetching (updateChartData now sets isLoading=true/false with try/finally) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore: bump version to 3.4.1 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c495537 commit 8d7c827

4 files changed

Lines changed: 50 additions & 11 deletions

File tree

app/components/AgentActivityViewer.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<v-card-item>
3636
<div class="text-caption text-medium-emphasis">Lines of code changed with AI</div>
3737
<div class="text-caption text-medium-emphasis mb-2">{{ dateRangeDescription }}</div>
38-
<div class="kpi-value">{{ formatCompact(totalLocChanged) }}</div>
38+
<div class="kpi-value text-primary">{{ formatCompact(totalLocChanged) }}</div>
3939
</v-card-item>
4040
</v-card>
4141
</v-col>
@@ -44,7 +44,7 @@
4444
<v-card-item>
4545
<div class="text-caption text-medium-emphasis">Agent contribution</div>
4646
<div class="text-caption text-medium-emphasis mb-2">% of all AI code changes</div>
47-
<div class="kpi-value">{{ agentContributionPct.toFixed(0) }}%</div>
47+
<div class="kpi-value text-success">{{ agentContributionPct.toFixed(0) }}%</div>
4848
<div class="text-caption text-medium-emphasis mt-1">
4949
{{ formatCompact(agentLocChanged) }} of {{ formatCompact(totalLocChanged) }} lines
5050
</div>
@@ -56,7 +56,7 @@
5656
<v-card-item>
5757
<div class="text-caption text-medium-emphasis">Avg lines deleted by agent per user</div>
5858
<div class="text-caption text-medium-emphasis mb-2">{{ dateRangeDescription }}</div>
59-
<div class="kpi-value">{{ avgAgentLinesDeleted.toLocaleString() }}</div>
59+
<div class="kpi-value text-warning">{{ avgAgentLinesDeleted.toLocaleString() }}</div>
6060
</v-card-item>
6161
</v-card>
6262
</v-col>

app/components/TeamsComponent.vue

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
<template>
2-
<div>
2+
<div style="position: relative;">
3+
<!-- Loading overlay while fetching team metrics -->
4+
<v-overlay
5+
:model-value="isLoading"
6+
contained
7+
persistent
8+
class="align-center justify-center"
9+
>
10+
<v-progress-circular indeterminate color="primary" size="48" />
11+
</v-overlay>
12+
313
<!-- Description card (matches org style) -->
414
<v-card variant="outlined" class="mx-4 mt-3 mb-1 pa-3" density="compact">
515
<div class="d-flex flex-wrap align-start gap-2 text-body-2">
@@ -78,12 +88,12 @@
7888
<div class="text-medium-emphasis">{{ dateRangeDesc }}</div>
7989
</div>
8090
<v-btn
81-
:href="getTeamDetailUrl(selectedTeams[0]!)"
82-
target="_blank"
8391
variant="outlined"
8492
size="small"
85-
append-icon="mdi-open-in-new"
86-
>View Team</v-btn>
93+
color="error"
94+
prepend-icon="mdi-close"
95+
@click="selectedTeams = []"
96+
>Deselect</v-btn>
8797
</div>
8898
</v-card>
8999

@@ -279,8 +289,14 @@
279289
<v-icon size="18" :color="card.color.border">mdi-account-group</v-icon>
280290
<span class="text-subtitle-2 font-weight-medium">{{ card.teamName }}</span>
281291
<v-spacer />
282-
<v-btn :href="getTeamDetailUrl(card.slug)" target="_blank" variant="text" size="x-small" icon>
283-
<v-icon size="14">mdi-open-in-new</v-icon>
292+
<v-btn
293+
variant="text"
294+
size="x-small"
295+
icon
296+
:title="`Remove ${card.teamName}`"
297+
@click="selectedTeams = selectedTeams.filter(s => s !== card.slug)"
298+
>
299+
<v-icon size="14">mdi-close</v-icon>
284300
</v-btn>
285301
</div>
286302
<div class="d-flex justify-space-between text-caption text-medium-emphasis">
@@ -821,6 +837,9 @@ export default defineComponent({
821837
}
822838
})
823839
840+
// ── Loading state ─────────────────────────────────────────────────────────
841+
const isLoading = ref(false)
842+
824843
// ── User Metrics ──────────────────────────────────────────────────────────
825844
const singleTeamUserMetrics = ref<UserTotals[]>([])
826845
const userMetricsError = ref<string | null>(null)
@@ -953,9 +972,12 @@ export default defineComponent({
953972
editorBarChartData.value = { labels: [], datasets: [] }
954973
singleTeamUserMetrics.value = []
955974
userMetricsError.value = null
975+
isLoading.value = false
956976
return
957977
}
958978
979+
isLoading.value = true
980+
try {
959981
const loaded = await Promise.all(selectedTeams.value.map(slug => loadMetricsForTeam(slug)))
960982
perTeamData.value = loaded
961983
@@ -1039,6 +1061,9 @@ export default defineComponent({
10391061
singleTeamUserMetrics.value = []
10401062
userMetricsError.value = null
10411063
}
1064+
} finally {
1065+
isLoading.value = false
1066+
}
10421067
}
10431068
10441069
onMounted(async () => { await loadTeams() })
@@ -1051,6 +1076,7 @@ export default defineComponent({
10511076
// state
10521077
availableTeams,
10531078
selectedTeams,
1079+
isLoading,
10541080
chartColumns,
10551081
perTeamData,
10561082
// modes

app/components/UserMetricsViewer.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,19 @@
311311
</div>
312312

313313
<v-row>
314+
<!-- Empty state when no user selected -->
315+
<v-col v-if="!selectedUser" cols="12">
316+
<v-alert
317+
type="info"
318+
variant="tonal"
319+
density="compact"
320+
icon="mdi-cursor-pointer"
321+
class="mb-2"
322+
>
323+
<strong>Select a user</strong> from the table above to see their individual usage details, language breakdown, model preferences, and activity history.
324+
</v-alert>
325+
</v-col>
326+
314327
<!-- 1. Language Distribution -->
315328
<v-col cols="12" :md="chartColumns === '2' ? 6 : 12">
316329
<v-card variant="outlined" class="pa-4">

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "copilot-metrics-viewer",
3-
"version": "3.3.1",
3+
"version": "3.4.1",
44
"private": true,
55
"type": "module",
66
"scripts": {

0 commit comments

Comments
 (0)