Current /analytics/ shows basic bar charts (prompt usage, conversation usage, optional company usage for managers, admin response times). Needs a real product overhaul.
Heatmap: Discussed previously (weekday × hour prompt-frequency grid, Cursor-style). No dedicated ticket existed. Partial WIP was started toward Account settings (PromptHeatmapCard + GET /analytics/user_prompt_heatmap/) but was not shipped / not in repo. This ticket owns placing that heatmap on the Analytics page (preferred home), not buried only in Account.
Related old ticket (different chart): #2 scatter plot — out of scope unless we explicitly fold it in.
Companion BE work may be needed for heatmap + any new aggregates (create BE follow-ups if APIs missing).
Goal
Make Analytics useful for individual users and business/company managers, with clear separation of what each audience sees.
Individual user (all entitled users)
Show the user’s own usage patterns:
Prompt activity heatmap — Y = day of week (Mon–Sun), X = hour bins (0–23), cell intensity = count of user-entered prompts in local timezone. Footer: most active day/hour, peak cell, total.
Volume over time — prompts and/or conversations per day/week (keep/improve existing charts; clearer labels, date range if feasible).
Optional later: token/prompt quota context (link to Account plan/usage rather than duplicating billing UI).
Do not show other users’ identifiable activity to a normal member.
Business / company manager
In addition to (or clearly sectioned from) personal view:
Company usage overview — seat / account usage trends (evolve current company usage card).
Team activity (aggregated) — e.g. active users over time, total prompts/conversations for the company — no private message content.
Optional heatmap modes — personal heatmap always; company-level heatmap only if we can aggregate safely (company-wide prompt timing), never per-user heatmap that exposes individuals unless product explicitly wants anonymized rollups.
Keep admin-only response-time / ops charts gated (current hard-coded admin email should become a proper role check when touched).
UX notes
One composition / clear sections: e.g. “Your activity” vs “Company” (tabs or stacked sections).
Heatmap is a primary visual for personal activity — not an afterthought.
Mobile-friendly; match existing glass card / theme patterns.
Acceptance
Analytics page redesigned with clear You vs Company (company section only for managers / business)
Weekday × hour prompt heatmap shipped for the signed-in user (local TZ)
Existing useful charts retained or replaced with better equivalents (not a regression to empty page)
No cross-user PII leakage in member view
Admin/ops charts remain restricted
FE tests for role-based section visibility + heatmap empty/loading states
Out of scope (unless pulled in)
Tianji product analytics / marketing funnel
Replacing Account “Plan & usage” billing card
## Context
Current `/analytics/` shows basic bar charts (prompt usage, conversation usage, optional company usage for managers, admin response times). Needs a real product overhaul.
**Heatmap:** Discussed previously (weekday × hour prompt-frequency grid, Cursor-style). **No dedicated ticket existed.** Partial WIP was started toward Account settings (`PromptHeatmapCard` + `GET /analytics/user_prompt_heatmap/`) but was **not shipped / not in repo**. This ticket owns placing that heatmap on the **Analytics** page (preferred home), not buried only in Account.
Related old ticket (different chart): [#2](https://git.aimloperations.com/ai_ml_operations/chat_web_app/issues/2) scatter plot — out of scope unless we explicitly fold it in.
Companion BE work may be needed for heatmap + any new aggregates (create BE follow-ups if APIs missing).
## Goal
Make Analytics useful for **individual users** and **business/company managers**, with clear separation of what each audience sees.
---
## Individual user (all entitled users)
Show the user’s own usage patterns:
1. **Prompt activity heatmap** — Y = day of week (Mon–Sun), X = hour bins (0–23), cell intensity = count of **user-entered** prompts in local timezone. Footer: most active day/hour, peak cell, total.
2. **Volume over time** — prompts and/or conversations per day/week (keep/improve existing charts; clearer labels, date range if feasible).
3. **Optional later:** token/prompt quota context (link to Account plan/usage rather than duplicating billing UI).
Do **not** show other users’ identifiable activity to a normal member.
---
## Business / company manager
In addition to (or clearly sectioned from) personal view:
1. **Company usage overview** — seat / account usage trends (evolve current company usage card).
2. **Team activity (aggregated)** — e.g. active users over time, total prompts/conversations for the company — **no** private message content.
3. **Optional heatmap modes** — personal heatmap always; company-level heatmap only if we can aggregate safely (company-wide prompt timing), never per-user heatmap that exposes individuals unless product explicitly wants anonymized rollups.
4. Keep admin-only response-time / ops charts gated (current hard-coded admin email should become a proper role check when touched).
---
## UX notes
- One composition / clear sections: e.g. “Your activity” vs “Company” (tabs or stacked sections).
- Heatmap is a primary visual for personal activity — not an afterthought.
- Mobile-friendly; match existing glass card / theme patterns.
## Acceptance
- [ ] Analytics page redesigned with clear **You** vs **Company** (company section only for managers / business)
- [ ] Weekday × hour prompt heatmap shipped for the signed-in user (local TZ)
- [ ] Existing useful charts retained or replaced with better equivalents (not a regression to empty page)
- [ ] No cross-user PII leakage in member view
- [ ] Admin/ops charts remain restricted
- [ ] FE tests for role-based section visibility + heatmap empty/loading states
## Out of scope (unless pulled in)
- Tianji product analytics / marketing funnel
- Replacing Account “Plan & usage” billing card
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Context
Current
/analytics/shows basic bar charts (prompt usage, conversation usage, optional company usage for managers, admin response times). Needs a real product overhaul.Heatmap: Discussed previously (weekday × hour prompt-frequency grid, Cursor-style). No dedicated ticket existed. Partial WIP was started toward Account settings (
PromptHeatmapCard+GET /analytics/user_prompt_heatmap/) but was not shipped / not in repo. This ticket owns placing that heatmap on the Analytics page (preferred home), not buried only in Account.Related old ticket (different chart): #2 scatter plot — out of scope unless we explicitly fold it in.
Companion BE work may be needed for heatmap + any new aggregates (create BE follow-ups if APIs missing).
Goal
Make Analytics useful for individual users and business/company managers, with clear separation of what each audience sees.
Individual user (all entitled users)
Show the user’s own usage patterns:
Do not show other users’ identifiable activity to a normal member.
Business / company manager
In addition to (or clearly sectioned from) personal view:
UX notes
Acceptance
Out of scope (unless pulled in)