feat(pairs): group destinations by source and show count summary#321
Open
shinzoxD wants to merge 4 commits into
Open
feat(pairs): group destinations by source and show count summary#321shinzoxD wants to merge 4 commits into
shinzoxD wants to merge 4 commits into
Conversation
Issue StableRoute-Org#286 -- the pairs list rendered a flat ul of 'source -> destination' rows with no summary count and no grouping, so operators with many destinations per source cannot see structure at a glance. This change groups destinations under each source asset (sorted alphabetically by source) and shows a count summary line ('N sources, M pairs total'). The grouping is computed with a useMemo from the already-filtered list so it inherits the existing search behaviour. Empty state and error state are unchanged. The 4 pre-existing failures in src/app/pairs/page.test.tsx (expecting 'No pairs registered yet' text that the current code no longer emits) are not introduced by this PR and are out of scope for StableRoute-Org#286. Closes StableRoute-Org#286
…discriminated-union State<T> + refetch type caused TS2339 errors\nin pairs/Client.tsx and stats/Client.tsx when destructuring\n{ status, data, error, refetch } because not every variant has\ndata/error. Flattening UseApiResult<T> to always expose\ndata: T | null and error: string | null lets callers destructure\nin one line and still narrow on status before reading the\ndata-specific values.\n\nAlso adds && data / && status.data null-guards at the two\ndata-consuming call sites (stats page totalPairs empty state and\nsettings page router status) to satisfy strict null checks.
Author
|
@mikewheeleer — friendly ping on this fork PR (feat(pairs): group destinations by source and show count summary).\n\nCI is currently failing on pre-existing main-branch test flakes ( |
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
Groups the pairs list by source asset and adds a count summary line. Sources are sorted alphabetically; destinations within a group preserve their original order from the API. The grouping is computed via useMemo from the already-filtered list, so it inherits the existing search behaviour.
Why
Operators with many destinations per source couldn't see structure at a glance. A flat ul of source -> destination rows makes it hard to count, compare, or scan for missing routes.
Changes
Test Plan
Linked issue
Closes #286
Payout wallet (Stellar): GBVHELLD2JE235Y2NGTDT3MWI3T65ON6SY4N6FBHYVDAQ5FZC2CP5QXH
GrantFox OSS campaign -- smart escrow payout on merge.