feat(dashboard): daily activity for the last 14 days, linking into the activity log - #1625
Open
rstrzelecki-inne-projekty wants to merge 3 commits into
Open
rstrzelecki-inne-projekty wants to merge 3 commits into
rstrzelecki-inne-projekty wants to merge 3 commits into
Conversation
Adds an admin-only "Activity log" (Admin → Community → Activity log) that records what users do, with filters and a TSV export: - activity_log table (created on start-up), async write queue - the base queue accepts several handlers, so the event queue now feeds both the badge rules and the log - events: question/answer/comment create, update, delete, vote (with direction and cancel), accept, flag, react, comment replies - hooks where no event exists: every login (method, IP, UA), badge awards, review queue (queued / approved / rejected), every reputation change (with the object and activity that caused it), role changes, suspend / unsuspend / delete - page views sent by the UI on route change (deduplicated), kept for ACTIVITY_LOG_PAGEVIEW_DAYS days (default 90, cleaned by cron) - admin API: paged list with date range / user / action / free-text filters, action counts, TSV export (UTF-8 BOM, streamed, 100k cap) - admin UI page with date presets, user suggestions, multi-select action filter, search, export; all filters live in the URL 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0181uZ2px83HmPo3HKSEzWQR Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0181uZ2px83HmPo3HKSEzWQR
rstrzelecki-inne-projekty
pushed a commit
to rstrzelecki-inne-projekty/answer
that referenced
this pull request
Sep 16, 2026
Text columns of the export (titles, excerpts, reasons, user names) are user-influenced; a value starting with =, +, -, @, | or % would be evaluated as a formula by Excel / LibreOffice. Such cells now get a leading apostrophe; the numeric reputation delta is left as is.
…e activity log Adds a card to the admin dashboard with one row per day (today first) and the number of questions, answers, comments, review-queue items, badge awards and page views. Every number opens the activity log in a new tab, already filtered to that day and those actions; the date opens the whole day. Days are bucketed in the admin's time zone (tz_offset). Backed by GET /answer/admin/api/activity-log/daily?days=&tz_offset= (aggregated in Go from created_at + action of the activity_log rows). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0181uZ2px83HmPo3HKSEzWQR Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0181uZ2px83HmPo3HKSEzWQR
rstrzelecki-inne-projekty
force-pushed
the
feat/dashboard-daily-activity
branch
from
September 16, 2026 15:51
2381f06 to
f2ffc80
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Adds a card "Activity in the last 14 days" to the admin dashboard, under the existing cards: one row per day (today first) with the number of questions, answers, comments (incl. replies), review-queue items, badge awards and page views. Every number is a link that opens the activity log in a new tab, already filtered to that day and those actions (e.g.
/admin/activity-log?range=custom&from=2026-09-16&to=2026-09-16&action=question.create); the date link opens the whole day.GET /answer/admin/api/activity-log/daily?days=14&tz_offset=<minutes>— counts per local day; days are bucketed in the admin's time zone (the UI sends-Date.getTimezoneOffset()), not in UTC, so "today" means the admin's today. Aggregated in Go fromcreated_at+actionof the log rows since the start of the range (one cheapSELECTof two columns).Admin/Dashboard/components/DailyActivity(react-bootstrapTablein aCard), i18nadmin.dashboard.daily_activity.*.Why: the dashboard's site statistics are lifetime totals; admins wanted to see at a glance whether anything happened today / this week and jump straight to the details.
Verified on our production instance (2.0.2 + #1624 + this): counts match the activity log filters they link to.
🤖 Generated with Claude Code
https://claude.ai/code/session_0181uZ2px83HmPo3HKSEzWQR