When interacting with the app offline I want to see a visual 'offline' indication rather than an infinite loading indicator, so that I know that the app is offline and some app features may be limited.
This is a design task and has space for defining the exact user experience. The use cases are:
Current behavior with Vaadin 18.0.0.alpha1 / Flow 5.0.offline-SNAPSHOT:

A quick prototype for one idea: https://output.jsbin.com/hurulub
Not really usable on touch devices, so those would need additional care.
Some thoughts:
Comments from a grooming session:
navigator.online == true (e.g. _connection lost_)navigator.online == false) and connection lost (navigation.online == true)With V14 the app could be in the following states: connected, loading, reconnecting, connection lost. The navigator.online flag plays no role in determining the application connectivity state - it depends only on the ability to connect to the Vaadin UI instance on the backend. The state diagram would he roughly this:
With V18 I suggest to keep the same 4 states and avoid introducing a separate "offline" state that would be different from "connection lost". However, the 'reconnecting' state would only make sense for Flow views, but not for Fusion views.
The navigator.online flag and the online and offline events could be used as an optimisation to avoid sending Flow heartbeats while the browser is offline, and as a substitute for heartbeats when Flow is not used in the app and Flow heartbeats are not available:
An updated (still very rough) live prototype: https://stackblitz.com/edit/vaadin-loading-indicator-proto?file=index.ts
@vlukashov That jsbin doesn't seem to work for me (504 Gateway Time-out) even though jsbin front page works.
@vlukashov That jsbin doesn't seem to work for me (504 Gateway Time-out) even though jsbin front page works.
updated a live prototype link
SubTask
Have a state store for storing the connection state of the app. Implement state transition based on the statechart and real use cases #9343.
SubTask
Have a state indicator component for storing the connection state of the app. #9322. Note this shouldn't break the custom loading indicator and reconnection dialog. Currently, styles can be customized based on v-xxx styles, timout can also be configured. See https://vaadin.com/docs/v14/flow/advanced/tutorial-loading-indicator.html
SubTask (#9424)
When receiving an online event, should also check the connection to the backend, similar to the heartbeat request or head request.
SubTask (#9401, #9402)
API for customizing the loading indicator, and the reconnection dialog. Currently, the API is in AppShellSetting. This should be supported for compatibility reasons.
SubTask (part of #9401, #9402)
Be able to customize the text in the visual indicator.
SubTask (Optimization)
For Flow, stop the reconnection request when offline, should continue sending when back online. Heartbeat is handled in #9207.
Updated state diagram, combining the Flow and Fusion transitions and with the state names proposed in #9377 (CONNECTED, LOADING, RECONNECTING and CONNECTION_LOST):

Make sure we can have both fusion and flow views, and navigation between them would have a consistent connection state.
Close this Epic as it passed due. All the tickets in this Epic are closed except one in Review.