Skip to content

Admin dashboard improvements & expanded event tracking coverage#955

Draft
ryokun6 wants to merge 2 commits intomainfrom
cursor/admin-dashboard-and-events-2b13
Draft

Admin dashboard improvements & expanded event tracking coverage#955
ryokun6 wants to merge 2 commits intomainfrom
cursor/admin-dashboard-and-events-2b13

Conversation

@ryokun6
Copy link
Copy Markdown
Owner

@ryokun6 ryokun6 commented Mar 14, 2026

Admin Dashboard Improvements

KPI Cards Show Range Totals

  • KPI cards (Visitors, API Calls, AI Requests, Error Rate) now display range totals instead of just today's numbers
  • When switching between 1d/7d/14d/30d, the prominent numbers update immediately
  • Labels dynamically show the selected range (e.g., "Visitors (7d)", "API Calls (today)")
  • "vs yesterday" trend indicators still compare today vs yesterday within the range

1d (Today) Option

  • Added 1d button to the date range selector for a quick "today only" view
  • When 1d is selected, labels read "Visitors (today)" etc.
  • Trend indicators are hidden for 1d since there's no yesterday data in the response

Local Time Dates

  • Chart date labels now display in the user's local timezone instead of UTC
  • Fixed formatDateLabel to parse YYYY-MM-DD as local midnight, avoiding off-by-one date display for users in negative UTC offsets

Context Strip

  • Multi-day ranges show today's breakdown below KPI cards: calls, visitors, AI, error rate
  • 1d range shows total errors and avg latency instead

Event Tracking Coverage

New Analytics Constants

Added event tracking constants for 12 additional apps in src/utils/analytics.ts:

  • Finder: file_open, file_rename, file_delete, folder_create, trash_empty
  • TextEdit: file_new, file_save, file_open
  • Settings: theme_change, wallpaper_change
  • Photo Booth: capture, export
  • Minesweeper: game_start, game_win, game_lose
  • Paint: file_save, file_export
  • Videos: video_play
  • Stickies: note_create, note_delete
  • Calendar: event_create, event_delete
  • Contacts: contact_create, contact_delete
  • Soundboard: sound_play
  • Karaoke/Synth/Winamp: constants defined (not yet wired — karaoke/winamp share iPod store tracking)

Wired Tracking (13 files)

All new constants are wired into their respective hook/component files using the existing track() from @vercel/analytics.

Testing

  • bun run build passes
  • bun run test:unit — 89 tests pass, 0 failures
Open in Web Open in Cursor 

… option

- KPI cards now show range totals instead of just today's numbers,
  so they update when switching between 1d/7d/14d/30d
- Added 1d (today) date range option
- Dates display in local timezone instead of UTC
- Context strip shows today's numbers when viewing multi-day ranges
- Top Endpoints header shows 'today' label for 1d range
- Trend indicators hidden for 1d range (no yesterday data)

feat(analytics): add event tracking for 12 additional apps

Added analytics constants and wired tracking for:
- Finder: file open/rename/delete, folder create, trash empty
- TextEdit: file save, file open
- Control Panels: theme change, wallpaper change
- Photo Booth: capture, export
- Minesweeper: game start/win/lose
- Paint: file save, file export
- Videos: video play
- Stickies: note create/delete
- Calendar: event create/delete
- Contacts: contact create/delete
- Soundboard: sound play

Also added constants (not yet wired) for:
- Karaoke: session start, track add
- Synth: preset save/load
- Winamp: track play

Co-authored-by: Ryo Lu <me@ryo.lu>
@ryos-deploy
Copy link
Copy Markdown

ryos-deploy bot commented Mar 14, 2026

The preview deployment for ryos-dev is ready. 🟢

Open Preview | Open Build Logs | Open Application Logs

Last updated at: 2026-03-14 16:33:15 CET

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants