Repository navigation
fix: performance API docs, trend is null when the previous period is 0 - #151
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
cms#510 (merge 2bfb463, tag v3.16.114, live per p470) changes the period trend: growth from a previous value of 0 has no percentage (
null, was100), and each trend object now carriesprevious.Changes
api-reference/performance.mdx: trend object table (trendnumber or null, newprevious), the zero-previous rule, rounding-to-stable rule, example JSON (values consistent: clicks 60 vs 52 → 15.4 up; previous-0 metrics → null up),last_updated.Sources
affiliate-cms v3.16.114:src/utils/trend.tsperiodTrend: previous 0 →percentage: current === 0 ? 0 : null, direction by sign; otherwise change rounded to 0.1 first, direction from the rounded change.v3.16.114:src/api/affiliate-tracking/controllers/affiliate-tracking.ts:817-821:calculateTrendreturns{ trend: percentage, trendDirection: direction, previous }for all 7 trends (route/tracking/performance/:programId, routes file line 30).trendDirection(grep content + public).Checks
Build + check-agent-surface + check-docs-host + check-docs-host-http pass locally. No media.
🤖 Generated with Claude Code