feat(analytics): persisted auto-refresh interval for SQL dashboards
Summary
- Adds
refreshInterval?: numbertoSqlDashboardConfig— stored in the dashboard config, survives page reloads - Wires through
SqlChartCard→SqlChart→useSqlQueryas React Query'srefetchInterval - Sets
staleTime: 0whenrefetchIntervalis active so every tick fires a real fetch - Adds a Refresh
Selectcontrol to the filter row on every dashboard (Off / 0.5 s / 1 s / 5 s / 10 s / 30 s), saved via the existingpersist()path - Dashboards without
refreshIntervalset 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": 1000auto-sets the dropdown to 1 s on first load
🤖 Generated with Claude Code
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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
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 |
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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
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 |
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 |
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 |
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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |