Description
Groups of collaborators (e.g., freelancer pools, DAOs, creative teams) sharing a group invoice want a motivating view of each member's payment completion relative to their share, fostering accountability. This issue adds a progress leaderboard to /groups/[id] that ranks all recipient members by their percentage of their owed share received, displays a progress bar per member, and updates in real time as payments come in. The leaderboard respects privacy settings: members can opt out of being ranked.
Technical Context
Extend app/groups/[id]/page.tsx with a LeaderboardPanel tab. Create components/groups/GroupLeaderboard.tsx consuming data from GET /api/groups/[id]/leaderboard which returns LeaderboardEntry[] = { memberId, displayName, owedAmount, receivedAmount, percentComplete, rank, optedOut }. Rank is computed server-side, ordering by percentComplete descending. Poll the endpoint every 15 seconds using useSWR with refreshInterval. Members who have opted out appear as "Anonymous Member" with a dashed progress bar. The opt-out toggle lives in a member's group settings section on /groups/[id]/settings. Animate rank changes (position swap) using Framer Motion layout animations keyed by memberId.
Acceptance Criteria
Description
Groups of collaborators (e.g., freelancer pools, DAOs, creative teams) sharing a group invoice want a motivating view of each member's payment completion relative to their share, fostering accountability. This issue adds a progress leaderboard to
/groups/[id]that ranks all recipient members by their percentage of their owed share received, displays a progress bar per member, and updates in real time as payments come in. The leaderboard respects privacy settings: members can opt out of being ranked.Technical Context
Extend
app/groups/[id]/page.tsxwith aLeaderboardPaneltab. Createcomponents/groups/GroupLeaderboard.tsxconsuming data fromGET /api/groups/[id]/leaderboardwhich returnsLeaderboardEntry[] = { memberId, displayName, owedAmount, receivedAmount, percentComplete, rank, optedOut }. Rank is computed server-side, ordering bypercentCompletedescending. Poll the endpoint every 15 seconds usinguseSWRwithrefreshInterval. Members who have opted out appear as "Anonymous Member" with a dashed progress bar. The opt-out toggle lives in a member's group settings section on/groups/[id]/settings. Animate rank changes (position swap) using Framer Motion layout animations keyed bymemberId.Acceptance Criteria
percentCompletedescending and updates rank positions within 15 seconds of a payment confirmation