Skip to content

Add bounty pool chart to watchlist#1169

Open
longbiaochen wants to merge 2 commits into
entrius:testfrom
longbiaochen:codex/watchlist-bounty-chart
Open

Add bounty pool chart to watchlist#1169
longbiaochen wants to merge 2 commits into
entrius:testfrom
longbiaochen:codex/watchlist-bounty-chart

Conversation

@longbiaochen
Copy link
Copy Markdown

@longbiaochen longbiaochen commented May 14, 2026

Summary

  • Add a Watchlist > Bounties Chart control in Options.
  • Render a Bounty Pool by Repository bar chart from the currently filtered watched bounties.
  • Add a focused aggregation utility and unit tests for totals, sorting, limits, and invalid amounts.

Related Issues

Fixes #1018

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Screenshots

Before screenshots are in #1018. After verification was completed in the in-app browser with real test API data: added 3 bounties to Watchlist > Bounties, opened Options > Chart, observed the toggle switch to Hide Chart, and confirmed a visible ECharts canvas was mounted. The local browser screenshot command timed out during capture, so I am leaving the verification details here rather than attaching a stale/generated image.

Verification

  • npm test -- --run src/tests/bountyPoolByRepository.test.ts
  • npm run lint
  • npm run format:check
  • npm run build
  • Tested against the test API via local CORS proxy to https://test-api.gittensor.io

Checklist

  • New components are modularized/separated where sensible
  • Uses predefined theme (e.g. no hardcoded colors)
  • Responsive/mobile checked via constrained chart container and existing Watchlist layout controls
  • Tested against the test API
  • npm run format and npm run lint:fix have been run where applicable by the commit hook; npm run format:check and npm run lint pass
  • npm run build passes
  • Screenshots included for any UI/visual changes — screenshot capture timed out; see verification notes above

Copilot AI review requested due to automatic review settings May 14, 2026 16:31
@xiao-xiao-mao xiao-xiao-mao Bot added the enhancement New feature or request label May 14, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds feature parity to Watchlist → Bounties by introducing a chart visibility toggle and rendering a “Bounty Pool by Repository” bar chart based on the currently filtered watched bounties, with accompanying aggregation utilities and tests.

Changes:

  • Added buildBountyPoolByRepositoryRows utility to aggregate/sort/limit bounty totals by repository.
  • Added Vitest coverage for aggregation behavior (totals, sorting, limiting, invalid amounts).
  • Updated WatchlistPage bounties tab to include a Chart toggle and ECharts bar chart rendering.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/utils/bountyPoolByRepository.ts New utility to compute bounty-pool totals grouped by repository for charting.
src/tests/bountyPoolByRepository.test.ts New unit tests covering repository aggregation, sorting, limiting, and invalid inputs.
src/pages/WatchlistPage.tsx Adds chart toggle + chart rendering to Watchlist → Bounties using the new aggregation utility.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/pages/WatchlistPage.tsx Outdated
Comment on lines +2891 to +2920
<Box
sx={{
p: 2,
borderBottom: '1px solid',
borderColor: 'border.light',
height: '500px',
backgroundColor: 'surface.subtle',
}}
>
{showChart && filtered.length > 0 ? (
<ReactECharts
option={chartOption}
style={{ height: '100%', width: '100%' }}
notMerge
/>
) : (
<Box
sx={{
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}
>
<Typography sx={{ color: 'text.secondary', fontSize: '0.85rem' }}>
No watched bounties found.
</Typography>
</Box>
)}
</Box>
Comment thread src/utils/bountyPoolByRepository.ts Outdated
Comment on lines +9 to +12
const parseBountyAmount = (value: string | null | undefined): number => {
const parsed = Number.parseFloat(value ?? '0');
return Number.isFinite(parsed) ? parsed : 0;
};
@longbiaochen
Copy link
Copy Markdown
Author

Updated to address the automated review feedback. Bounty amount parsing is now shared through src/utils/bountyAmount.ts, and the collapsed chart area no longer renders the empty state while hidden.\n\nRe-verified after this update:\n- npm test -- --run src/tests/bountyPoolByRepository.test.ts\n- npm run lint\n- npm run format:check\n- npm run build

@anderdc anderdc mentioned this pull request May 15, 2026
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Watchlist → Bounties: missing “Bounty Pool by Repository” chart and chart toggle (/bounties parity)

2 participants