Repository navigation
feat(audit): primary-domain score trend + category breakdown on the hub - #264
Merged
Merged
Conversation
On the Site Audit hub, show the active brand's primary-domain score over time (area chart, default 30-day range with 7d/30d/90d/All presets) plus a delta (how much it rose/fell) and a category-breakdown grid for the latest audit in range. Adds GET /api/audits/trend (completed primary-domain audits with score + category_scores), a getAuditTrend action, and a Recharts chart.
The score-over-time area + line now take their color from the same score bands used across Site Audit — green (>=70), amber (40-69), red (<40) — driven by the overall (latest-in-range) score, instead of a fixed indigo.
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
On first visit to the Site Audit hub, show how the active brand's primary domain score has moved over time, alongside a category breakdown — so users see their trajectory before running anything.
How
GET /api/audits/trend?brandId=returns completed audits whose URL host matches the brand's primary domain (frombrand_domains), withtotal_score+category_scores+created_at. Registered before/:id.getAuditTrendaction; range filtering + delta computed client-side; chart inaudit/_charts.tsx(Recharts, ResizeObserver width pattern like insights).Notes
/trendroute. No schema changes.