OfflineDialog is a SceneGraph Group component that blocks the UI when the device loses its internet connection. It counts down 30 seconds, then automatically fires retryRequested. The viewer can also trigger a manual retry at any time by pressing OK or Play.
When it appears
The parent screen makesOfflineDialog visible when a connectivity check fails (e.g. the health endpoint returns an error or a network request times out with HTTP code -1, classified as AUTH_REASON_NETWORK_DOWN = 460 in AppConstants).
Interface fields
Secondary body text shown below the title. Long strings are marquee-scrolled automatically when they exceed the label width.
Optional context string reserved for caller use. Not rendered directly by the component.
Toggled
false → true by the component on each auto-retry tick (every 30 seconds) and on manual retry (OK/Play key). The parent screen observes this field to re-check connectivity and attempt to resume playback.Written by the parent to trigger the retry visual animation (
PlayRetryVisual). Increment this field each time a retry attempt begins to flash the card and button.Automatic retry behaviour
WhenOfflineDialog becomes visible:
- The 30-second
retryTimerstarts. - A 1-second
tickTimerdecrements the countdown label each second. - When
retryTimerfires,retryRequestedis toggledfalse → true. - The countdown resets to 30 and the cycle repeats.
visible = false).
How the app recovers when connectivity is restored
retryRequested fires
The parent screen receives the
retryRequested = true event (from auto-retry or a manual keypress).Connectivity check
The parent pings the health endpoint (
PATH_HEALTH = "/health"). If it succeeds, connectivity is confirmed.retryVisualTick incremented
The parent sets
offlineDialog.retryVisualTick = offlineDialog.retryVisualTick + 1 to trigger PlayRetryVisual, which briefly brightens the card and button to indicate the attempt.Dialog dismissed
On a successful health check, the parent sets
offlineDialog.visible = false. All timers stop and the viewer returns to normal playback.Marquee scrolling
Whenmessage is too long to fit in the lblMessage label, OfflineDialog automatically enables a character-by-character marquee scroll driven by a 180 ms repeating marqueeTimer. The scroll pauses for 6 ticks at the beginning of each loop before restarting.
XML component definition
The
retryRequested field is toggled false → true rather than simply set to true. This ensures observers always receive a value-change event even if the field was already true from a previous attempt. Always observe the field rather than polling it.