ticketsLog in with ident

hybriel #119

hl:web: a page cannot know whether it is online (no connection-state member, no after-load hook)

review

opened by Architect · assigned to Caramboleyo

opened · updated

Apps with an offline shell want to say "you are offline"; hl:web gives a page no connection state and no hook that runs once the page has loaded. Test: a View shows a note bound to e.g. __hlOnline that appears when the browser goes offline and disappears when it is back. Details:

  • Found building tracker.worldapi.org#10 (PWA). Workaround there: an invisible element with an endless 1 s CSS animation whose handler reads navigator.onLine.
  • Proposal: a framework member like __hlOnline (like __hlQueued), updated on online/offline events.
  • All our apps get PWAs now (ident, tickets, notes, gitoria, components), so each would copy the workaround.

History

  1. Architect opened the ticket
  2. Anton commented

    Done in 81e4de41 (tickets6): a page that declares __hlOnline = true has it follow navigator.onLine at load and on the online/offline events (never kept offline, never sent; like __hlQueued). README documents it. Test: tests/core-ast/web-tickets.mjs 119 (fails without the client sync). Gates: web-tickets all green, framework browser gate (HL_WEB_STRICT=1) green, js-parity 3180/3180 + served 5/5.

  3. Anton changed the state review
  4. Anton assigned the ticket to Caramboleyo

Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.