Show previous-period percentage changes in summary cards#42
Merged
Conversation
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.
Original request
Add previous-period percentage changes for the Income, Expenses, and Net totals at the top of the dashboard, vendors, and reports pages, using appropriate colors so the current period can be compared quickly with the previous period.
What changed
comparison.previousPeriodtotals for income, expenses, and net.Reasoning
The dashboard endpoint already fetched previous-period rows for category comparisons, so exposing summary-level comparison totals avoids adding another query. The reports page already had richer comparison lines, so the implementation preserves that context and adds the requested percentage next to the existing previous-period delta. Expense percentages use the existing category convention: higher expenses are red, lower expenses are green.
Screenshots / preview evidence
Preview URL: https://xpenser-pr-042.cleverbrush.com
Manual QA was performed with the seeded preview account. Screenshots were captured locally by
agent-browser:/tmp/xpenser-pr42-dashboard.png/tmp/xpenser-pr42-vendors.png/tmp/xpenser-pr42-reports.pngObserved behavior:
Validation
Local validation:
npm run lintpassednpm run typecheckpassednpm testpassedGitHub checks:
Lint and testpassedDeploy PR environmentpassedPlaywright e2epassedPreview QA:
https://xpenser-pr-042.cleverbrush.comwith the seeded preview account./dashboard,/vendors, and/statsrender the requested percentage changes.SigNoz:
xpenser-web-pr-42andxpenser-api-pr-42both had0ERROR logs in the last hour.xpenser-web-pr-42andxpenser-api-pr-42both had0error traces in the last hour.xpenser-web-pr-42showed 888 calls andxpenser-api-pr-42showed 455 calls in the last hour, both with0errors.errorCount: 0.xpenser-api-pr-42, buthttp.server.duration.countreturned no recent rows for the PR services, and no webservice.namemetric value was present. Logs, traces, and service telemetry were clean.