Adds a "Your stats" section to the Profile settings tab, built entirely
from local history in studio.db. No telemetry, nothing uploaded.
Backend
- storage/profile_stats_db.py folds every metric in one streaming pass
over chat_messages, memoised against a (count, max created_at)
fingerprint so reopening the tab is free until history changes.
- routes/profile_stats.py serves GET /api/profile/stats from a worker
thread, so a cold pass cannot stall token streaming.
Frontend
- Headline tiles, a token activity grid with daily/weekly/cumulative
modes, activity insights, most used models, hour and weekday rhythms,
and training run totals.
- The stats panel is lazy loaded so recharts stays out of the main
bundle.
- Personalization panel now puts a larger avatar beside the two name
fields, with picture options moved into an edit popover.
- "Sloth in greeting" moves to Chat defaults, next to the other chat
toggles.
Tests: 9 backend tests including a regression test that the endpoint
does not block the event loop, plus formatting unit tests.