feat: add user insights dashboard section#4
Merged
jordangarrison merged 16 commits intomainfrom Feb 24, 2026
Merged
Conversation
Add Greenlight.TimeHelpers module that converts ISO 8601 timestamp strings to human-readable relative time strings (e.g. "5m ago", "2h ago", "2d ago"). This will be used by the dashboard template to display when PRs were updated and when commits were authored.
# Conflicts: # lib/greenlight_web/live/dashboard_live.ex
…screenshot Add `nix build .#dockerImage` to the `mix precommit` alias so docker image builds are verified locally before finishing feature work. Also add a dashboard screenshot to the README.
… links - Add UserInsightsServer GenServer that polls GitHub every 5 min and caches user profile, PRs, and commits via ETS - Dashboard reads from cache on mount for instant render and subscribes via PubSub for live updates - Fix PR and commit links to navigate to Greenlight routes instead of GitHub URLs - Add ETS-backed Cache module to application supervision tree
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.
Summary
UserInsightsServerGenServer/repos/:owner/:repo/pull/:number,/repos/:owner/:repo/commit/:sha) instead of GitHubnix build .#dockerImagetomix precommitaliasChanges
Feature
lib/greenlight/github/user_insights_server.ex— New GenServer: polls user profile + activity, caches in ETS, broadcasts via PubSublib/greenlight/cache.ex— ETS-backed cache module with idempotent initlib/greenlight/github/client.ex— Addedget_authenticated_user/0,search_user_prs/1,search_user_commits/1lib/greenlight/time_helpers.ex— Relative time formattinglib/greenlight_web/live/dashboard_live.ex— Reads cache on mount, subscribes for PubSub updates, internal Greenlight navigation linkslib/greenlight/application.ex— ETS cache init + UserInsightsServer in supervision treeVerification & Docs
mix.exs— Addednix build .#dockerImageto precommit aliasnix/package.nix— Updated stale npmDepsHash for @xyflow/svelte 1.5.1README.md— Added dashboard screenshotdocs/assets/greenlight-dashboard.png— Dashboard screenshotTests
test/— Full coverage including PubSub update test (57 tests)Test plan
get_authenticated_user/0returns user profile from/userendpointsearch_user_prs/1returns PRs from GitHub Search APIsearch_user_commits/1returns commits with message truncationrelative_time/1formats timestamps correctly/repos/:owner/:repo/pull/:number/repos/:owner/:repo/commit/:shamix test