rusackas opened a new pull request, #41740:
URL: https://github.com/apache/superset/pull/41740

   ### SUMMARY
   
   The dashboard auto-refresh timer is driven by the `useHeaderAutoRefresh` 
hook, and that hook only mounts inside the `DashboardHeader` component. When 
the header isn't rendered — standalone `HideNavAndTitle` mode, `?standalone=1` 
report rendering, or `hideTitle: true` in embedded dashboards — the hook never 
runs, so the configured refresh interval never starts and charts stop 
auto-refreshing.
   
   This is the long-standing behavior reported in #25970: several folks noticed 
auto-refresh works with `standalone=1` but breaks with 
`standalone=2`/`HideNavAndTitle` or when `hideTitle` hides the header in the 
embedded SDK.
   
   The fix decouples the refresh timer from header visibility. I added a small 
headless `HeadlessAutoRefresh` component that reads the same redux state the 
header uses (chart ids, refresh frequency, immune slices, auto-refresh mode, 
loading state) and runs the existing `useHeaderAutoRefresh` hook. In 
`DashboardBuilder`, when the header is hidden we render `HeadlessAutoRefresh` 
instead of `DashboardHeader`. Exactly one instance of the timer is ever live: 
the header when it's visible, the headless component when it isn't — so there's 
no risk of double-firing.
   
   I intentionally reused the existing hook rather than duplicating the refresh 
logic, so pause/tab-visibility/immune-slice handling all keep working 
identically in both paths.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A — no visual change. The behavior change is that charts now keep 
refreshing on the configured interval even when the header is hidden.
   
   ### TESTING INSTRUCTIONS
   
   1. Open a dashboard and set a refresh interval (e.g. "Set auto-refresh 
interval" → 10 seconds).
   2. View it with the header hidden, using any of:
      - `?standalone=2` (hides nav and title)
      - the embedded SDK with `dashboardUiConfig: { hideTitle: true }`
   3. Confirm the charts continue to auto-refresh on the interval. Previously 
they would never refresh.
   4. Sanity check the normal (header-visible) case still auto-refreshes and 
the pause toggle still works.
   
   Unit tests: `HeadlessAutoRefresh.test.tsx` verifies the component drives the 
auto-refresh hook from redux state (and renders nothing) when the header is 
absent.
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: Fixes #25970
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to