Skip to content

AnchorsPanel, SettlementsPanel, and MetricsBar's error states have no retry action, unlike PoolsPanel #283

Description

@Jagadeeshftw

📌 Description

When PoolsPanel (src/components/PoolsPanel.tsx) fails to load, it renders the error message plus a "Retry" button that calls its own reload(). AnchorsPanel (src/components/AnchorsPanel.tsx), SettlementsPanel (src/components/SettlementsPanel.tsx), and MetricsBar (src/components/MetricsBar.tsx) each have an equivalent error branch (state.status === "error") but render only the bare error text with no way to retry short of a full page reload — despite AnchorsPanel/SettlementsPanel having a reload/refresh function readily available from useAsync, and MetricsBar having its own refresh from useAsync (already wired to its existing "↻" manual-refresh button, just not reused in the error branch).

🧩 Requirements and context

  • Add a retry action to the error state of AnchorsPanel, SettlementsPanel, and MetricsBar, consistent in style/placement with PoolsPanel's existing "Retry" button.
  • Each panel should reuse the reload/refresh trigger it already has (reload() for AnchorsPanel, the settlements list's own reload() for SettlementsPanel, refresh() for MetricsBar) rather than introducing a new fetch path.
  • No change to the loading or ready states of any of the three components.

🛠️ Suggested execution

  • Add a "Retry" button to each component's error branch that calls its existing reload/refresh function, matching PoolsPanel's button styling and label.
  • Extend src/components/AnchorsPanel.test.tsx, src/components/SettlementsPanel.test.tsx, and src/components/MetricsBar.test.tsx with a test per component that triggers the error state, clicks "Retry", and asserts the underlying fetch function is called again.

✅ Acceptance criteria

  • AnchorsPanel's, SettlementsPanel's, and MetricsBar's error states each offer a "Retry" action.
  • Clicking Retry re-triggers that component's existing fetch without a full page reload.
  • Test coverage for the retry action in all three components.

🔒 Security notes

No new attack surface; reuses each component's already-existing, already-authorized fetch path.

📋 Guidelines

  • Minimum 95% test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26frontendFrontend / UI workui-uxUI/UX design task

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions