Skip to content

feat(analytics): add period-over-period delta cards and agent leaderb… - #672

Merged
ScriptedBro merged 6 commits into
DelegoLabs:mainfrom
k-deejah:feat/analytics-improvements
Aug 31, 2026
Merged

feat(analytics): add period-over-period delta cards and agent leaderb…#672
ScriptedBro merged 6 commits into
DelegoLabs:mainfrom
k-deejah:feat/analytics-improvements

Conversation

@k-deejah

@k-deejah k-deejah commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR implements the requested UI improvements for the Analytics dashboard (Issues #613 and #616). It also includes an important note regarding the CI failure across all open PRs (#561) to unblock merging.

Why

Implementation

  • Delta Cards (Period-over-period delta cards #613): Created DeltaCards component and updated lib/analytics.ts to calculate client-side period-over-period deltas (Spend, Orders, Avg Order Value, Approval Rate). It handles null-safety (returns for divide-by-zero on new series) and maps proper green/red semantics.
  • Agent Leaderboard (Agent leaderboard (sortable, comparable) #616): Added AgentLeaderboard component featuring sortable columns (numeric and lexicographic). Clicking a row routes to the agent-filtered view (/orders?search=agentId). Includes CSS media queries to collapse rows into dense cards on mobile.

Testing

  • Confirmed column sorts are stable and type-correct.
  • Handled empty bucket and zero-value calculations correctly for the deltas.

Note on CI / Issue #561 ⚠️

The CI will fail on this PR with a 403 Forbidden fetching @delegolabs/types and @delegolabs/sdk, identical to other open PRs.
Fix required from repository admin: Generate a new PAT with read:packages scope and update the NPM_TOKEN secret in Settings -> Secrets and variables -> Actions.

Closes #613
Closes #616
Closes #561
References #561

…oard

- Calculates client-side period-over-period deltas for spend, orders, avg order value, and approval rate (DelegoLabs#613)
- Replaces static delegation table with a fully sortable Agent Leaderboard with row clicks (DelegoLabs#616)
- Implements mobile collapsed card views and delta null-safety
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@k-deejah Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d8a873a0-ce5e-48bb-9400-e880e91dd190


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

k-deejah and others added 5 commits August 31, 2026 01:45
- Prefix unused variables with underscores or remove them
- Remove unused imports across test and component files
- Add explicit fallback values and null checks to order properties in orders.ts and receipts.ts
- Address type inference issues with `api` error returns in replayEngine.ts
- Correct import paths for addressBook, consentJournal, and txMonitor tests
- Remove unexported type references (`CreateDisputeInput`, `Dispute`) from mocks
- Satisfy strict type-checking in testing setups and MSW handlers
- Merge duplicate prefetch props on Sidebar navigation
- Remove unused layout variables in TourProvider
- Cast unexported types to any to fix missing types in exports and handlers
- Fix BigInt parsing for Order stroop comparisons
- Correct Date construction for Order createdAt/updatedAt
- Restore missing server import in approval handlers test
@ScriptedBro
ScriptedBro merged commit f05256b into DelegoLabs:main Aug 31, 2026
14 of 15 checks passed
@grantfox-oss grantfox-oss Bot mentioned this pull request Aug 31, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent leaderboard (sortable, comparable) Period-over-period delta cards CI: NPM_TOKEN can't fetch @delegolabs packages (403), blocking all PRs

3 participants