Skip to content

feat: add per-view data refresh controls (manual + auto)#1

Open
Joeltabe wants to merge 1 commit intomainfrom
codex/add-data-refresh-controls
Open

feat: add per-view data refresh controls (manual + auto)#1
Joeltabe wants to merge 1 commit intomainfrom
codex/add-data-refresh-controls

Conversation

@Joeltabe
Copy link
Copy Markdown
Owner

Motivation

  • Provide users manual and automatic refresh controls for real-time views so data can be explicitly refreshed or polled with configurable intervals and scope.
  • Surface feedback (last-updated timestamp, progress animation, cancel) and support refresh-on-focus to keep dashboards up-to-date without global, hard-coded polling.
  • Persist preferences per view so users keep their chosen refresh behavior across reloads and sessions.

Description

  • Add a new hook useRefreshControls to persist per-view preferences (localStorage), manage selected refresh targets, run manual refreshes (via query refetch or provided refetch functions), schedule auto-refresh intervals, support refresh-on-focus, and allow cancellation via React Query.
  • Add reusable UI under frontend/src/components/RefreshControls/ (RefreshButton, AutoRefreshToggle, RefreshSettingsPanel, and an index.tsx wrapper) that shows refresh animation, last-updated timestamp, interval selection, refresh scope (all vs selective), and cancel action.
  • Integrate the controls into Dashboard, Analytics, Bridges, Transactions, and Asset Detail pages and wire targets to each page’s queries; update TransactionHistory to accept refreshInterval and refreshOnWindowFocus props.
  • Update data hooks (useAssets, useAssetsWithHealth, useBridges, usePrices, useTransactions) to accept refresh options (refetchInterval, refetchOnWindowFocus) so the UI controls drive polling behavior; document persistence keys and behavior in README.md.
  • Update tests to provide a QueryClientProvider and mock refetch where needed.
  • Closes Create Asset Metadata Management StellaBridge/Bridge-Watch#117

Testing

  • Ran unit tests with npm run test --workspace=frontend and all frontend tests passed (2 tests total).
  • Ran linter with npm run lint --workspace=frontend and linting completed successfully.
  • Attempted npm run build:frontend which failed due to pre-existing TypeScript errors (unused React imports in skeleton components) unrelated to these changes; tests and linting succeeded despite the build issue.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Asset Metadata Management

1 participant