agent-native icon indicating copy to clipboard operation
agent-native copied to clipboard

feat(analytics): persisted auto-refresh interval for SQL dashboards

Open zuchka opened this issue 6 months ago • 25 comments

Summary

  • Adds refreshInterval?: number to SqlDashboardConfig — stored in the dashboard config, survives page reloads
  • Wires through SqlChartCard → SqlChart → useSqlQuery as React Query's refetchInterval
  • Sets staleTime: 0 when refetchInterval is active so every tick fires a real fetch
  • Adds a Refresh Select control to the filter row on every dashboard (Off / 0.5 s / 1 s / 5 s / 10 s / 30 s), saved via the existing persist() path
  • Dashboards without refreshInterval set are completely unaffected (default Off)

Files changed

File Change
app/pages/adhoc/sql-dashboard/types.ts Add refreshInterval?: number to SqlDashboardConfig
app/lib/sql-query.ts staleTime: 0 when refetchInterval is set
app/components/dashboard/SqlChart.tsx Accept + forward refreshInterval to useSqlQuery
app/pages/adhoc/sql-dashboard/SqlChartCard.tsx Accept + forward refreshInterval to SqlChart
app/pages/adhoc/sql-dashboard/index.tsx Read from loaded config, pass to card, render Select control

Test plan

  • [ ] Open any dashboard → filter row shows Refresh: Off dropdown
  • [ ] Set to 1 s → panels start refetching every second (visible in Network tab)
  • [ ] Save and reload page → interval persists at 1 s
  • [ ] Set back to Off → polling stops
  • [ ] Other dashboards open fresh with Off (no unintended polling)
  • [ ] Dashboard seed with "refreshInterval": 1000 auto-sets the dropdown to 1 s on first load

🤖 Generated with Claude Code

zuchka avatar May 20 '26 00:05 zuchka

Deploy Preview for agent-native-scheduling ready!

Name Link
Latest commit e8da298603324709578eed5ed146269e878a8e11
Latest deploy log https://app.netlify.com/projects/agent-native-scheduling/deploys/6a0cfc3a12e9bd0008826221
Deploy Preview https://deploy-preview-779--agent-native-scheduling.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify avatar May 20 '26 00:05 netlify

Deploy Preview for agent-native-voice ready!

Name Link
Latest commit e8da298603324709578eed5ed146269e878a8e11
Latest deploy log https://app.netlify.com/projects/agent-native-voice/deploys/6a0cfc3a578ea30008a87558
Deploy Preview https://deploy-preview-779--agent-native-voice.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify avatar May 20 '26 00:05 netlify

Deploy Preview for agent-native-starter canceled.

Name Link
Latest commit e8da298603324709578eed5ed146269e878a8e11
Latest deploy log https://app.netlify.com/projects/agent-native-starter/deploys/6a0cfc3a0bba6c0009b74e5e

netlify avatar May 20 '26 00:05 netlify

Deploy Preview for agent-native-meeting-notes ready!

Name Link
Latest commit e8da298603324709578eed5ed146269e878a8e11
Latest deploy log https://app.netlify.com/projects/agent-native-meeting-notes/deploys/6a0cfc3accfac40008c8defb
Deploy Preview https://deploy-preview-779--agent-native-meeting-notes.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify avatar May 20 '26 00:05 netlify

Deploy Preview for nutritrack-daily-calories canceled.

Name Link
Latest commit e8da298603324709578eed5ed146269e878a8e11
Latest deploy log https://app.netlify.com/projects/nutritrack-daily-calories/deploys/6a0cfc3addaa79000829646a

netlify avatar May 20 '26 00:05 netlify

Deploy Preview for agent-native-calendar canceled.

Name Link
Latest commit e8da298603324709578eed5ed146269e878a8e11
Latest deploy log https://app.netlify.com/projects/agent-native-calendar/deploys/6a0cfc3ac8d8040008f75a4e

netlify avatar May 20 '26 00:05 netlify

Deploy Preview for agent-native-content canceled.

Name Link
Latest commit e8da298603324709578eed5ed146269e878a8e11
Latest deploy log https://app.netlify.com/projects/agent-native-content/deploys/6a0cfc3a24eb5a0008480b5f

netlify avatar May 20 '26 00:05 netlify

Deploy Preview for agent-native-design ready!

Name Link
Latest commit e8da298603324709578eed5ed146269e878a8e11
Latest deploy log https://app.netlify.com/projects/agent-native-design/deploys/6a0cfc3a8b557e0009b96f2c
Deploy Preview https://deploy-preview-779--agent-native-design.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify avatar May 20 '26 00:05 netlify

Deploy Preview for agent-native-images canceled.

Name Link
Latest commit e8da298603324709578eed5ed146269e878a8e11
Latest deploy log https://app.netlify.com/projects/agent-native-images/deploys/6a0cfc3aa3f09800084eacfc

netlify avatar May 20 '26 00:05 netlify

Deploy Preview for agent-native-macros canceled.

Name Link
Latest commit e8da298603324709578eed5ed146269e878a8e11
Latest deploy log https://app.netlify.com/projects/agent-native-macros/deploys/6a0cfc3aa3f09800084ead01

netlify avatar May 20 '26 00:05 netlify

Deploy Preview for agent-native-forms canceled.

Name Link
Latest commit e8da298603324709578eed5ed146269e878a8e11
Latest deploy log https://app.netlify.com/projects/agent-native-forms/deploys/6a0cfc3a1dbca10008eaee54

netlify avatar May 20 '26 00:05 netlify

Deploy Preview for agent-native-brain canceled.

Name Link
Latest commit e8da298603324709578eed5ed146269e878a8e11
Latest deploy log https://app.netlify.com/projects/agent-native-brain/deploys/6a0cfc3ac8d8040008f75a4c

netlify avatar May 20 '26 00:05 netlify

Deploy Preview for agent-native-issues canceled.

Name Link
Latest commit e8da298603324709578eed5ed146269e878a8e11
Latest deploy log https://app.netlify.com/projects/agent-native-issues/deploys/6a0cfc3addaa790008296470

netlify avatar May 20 '26 00:05 netlify

Deploy Preview for agent-native-dispatch canceled.

Name Link
Latest commit e8da298603324709578eed5ed146269e878a8e11
Latest deploy log https://app.netlify.com/projects/agent-native-dispatch/deploys/6a0cfc3a1dbca10008eaee52

netlify avatar May 20 '26 00:05 netlify

Deploy Preview for agent-native-recruiting canceled.

Name Link
Latest commit e8da298603324709578eed5ed146269e878a8e11
Latest deploy log https://app.netlify.com/projects/agent-native-recruiting/deploys/6a0cfc3a0bba6c0009b74e5a

netlify avatar May 20 '26 00:05 netlify

Deploy Preview for agent-native-slides canceled.

Name Link
Latest commit e8da298603324709578eed5ed146269e878a8e11
Latest deploy log https://app.netlify.com/projects/agent-native-slides/deploys/6a0cfc3aaac4eb000819d5fe

netlify avatar May 20 '26 00:05 netlify

Deploy Preview for agent-native-mail canceled.

Name Link
Latest commit e8da298603324709578eed5ed146269e878a8e11
Latest deploy log https://app.netlify.com/projects/agent-native-mail/deploys/6a0cfc3a5905210008fc9073

netlify avatar May 20 '26 00:05 netlify

Deploy Preview for agent-native-videos canceled.

Name Link
Latest commit e8da298603324709578eed5ed146269e878a8e11
Latest deploy log https://app.netlify.com/projects/agent-native-videos/deploys/6a0cfc3ab035d80008fd42ce

netlify avatar May 20 '26 00:05 netlify

Deploying agent-native-mail with  Cloudflare Pages  Cloudflare Pages

Latest commit: e8da298
Status:🚫  Build failed.

View logs

Deploying agent-native-calendar with  Cloudflare Pages  Cloudflare Pages

Latest commit: e8da298
Status:🚫  Build failed.

View logs