Skip to content

Sort vendor analytics by share#41

Merged
andrewzolotukhin merged 1 commit into
mainfrom
fix/vendor-share-sorting
Jun 12, 2026
Merged

Sort vendor analytics by share#41
andrewzolotukhin merged 1 commit into
mainfrom
fix/vendor-share-sorting

Conversation

@andrewzolotukhin

@andrewzolotukhin andrewzolotukhin commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Original request

Use pr-workflow to sort vendors on the Vendors page by descending share, matching how the Dashboard page presents share-based rows.

What changed

  • Updated the Vendors analytics panel to keep the existing Income and Expenses sections, then sort rows within each section by the displayed share percentage descending.
  • Added deterministic tie-breakers by absolute total descending, then vendor name ascending.
  • Added a focused React rendering test that feeds vendors out of order and verifies the rendered Income/Expenses row order follows share descending.

Reasoning

The Vendors page already computes and displays each vendor's share relative to the relevant income or expense total. Sorting in VendorGroup keeps the change scoped to the page behavior requested, preserves the existing grouped layout, and avoids changing the broader dashboard API contract or topVendors semantics for other callers.

Screenshots / preview evidence

  • Preview URL: https://xpenser-pr-041.cleverbrush.com/vendors?period=month&date=2026-06-01
  • Preview QA confirmed the Vendors month view keeps Income above Expenses and sorts each section by displayed share descending.
  • Observed Income order: 81.8%, 16.6%, 1.1%, 0.2%, 0.2%.
  • Observed Expenses order: 63.4%, 10.9%, 7.8%, 4.5%, 3%, 2.5%, 2.2%, 1.7%, 1.4%, 0.8%, 0.6%, 0.6%, 0.3%, 0.1%, 0.1%.
  • Screenshot captured locally during QA: /tmp/xpenser-pr-041-vendors-month.png. The current GitHub connector does not expose binary attachment upload.

Validation

  • npm test -- apps/web/components/vendor-analytics-panel.test.tsx passed locally.
  • npm run lint passed locally.
  • npm run typecheck passed locally.
  • npm test passed locally: 65 files, 356 tests.
  • GitHub Lint and test passed.
  • GitHub Deploy PR environment passed.
  • GitHub Playwright e2e passed.
  • Preview QA passed on https://xpenser-pr-041.cleverbrush.com/vendors?period=month&date=2026-06-01.
  • SigNoz traces: recent xpenser-web-pr-41 traces present for preview activity, no error traces returned; recent xpenser-api-pr-41 error traces returned no rows.
  • SigNoz logs: recent error/fatal logs for xpenser-web-pr-41 and xpenser-api-pr-41 returned no rows.
  • SigNoz metrics: xpenser-api-pr-41 http.server.duration.count reported 107 requests in the queried window. xpenser-web-pr-41 did not expose metric service.name values in SigNoz during the checked window; web traces/logs were present and clean.

@andrewzolotukhin andrewzolotukhin temporarily deployed to pr-41 June 12, 2026 06:34 — with GitHub Actions Inactive
@andrewzolotukhin andrewzolotukhin merged commit 6676a9c into main Jun 12, 2026
4 checks passed
@andrewzolotukhin andrewzolotukhin deleted the fix/vendor-share-sorting branch June 12, 2026 17:50
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.

1 participant