gitoriaLog in with ident

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit9101716491017164ident mission 009 (1/4): file moves — the root .hl files into lib/ (api.hl → lib/api-helpers.hl), styles.hl → components/styles.hl; imports adjusted, no other changemre91017164/components/main.hl

1.8 KB

  1. // components/main.hl — THE SHELL: the application header and the slot the page renders
  2. // into. All CSS is in styles.hl.
  3. import { siteName } from '../project.hl'
  4. slot = null
  5. // OFFLINE (mission 046): true while the shell's probe cannot reach ident (the header says so)
  6. noNetwork = false
  7. View {
  8. body {
  9. applicationHeader {
  10. a { class = "brand" href = "/" siteName }
  11. span { class = "tagline" "worldapi login" }
  12. nav {
  13. a { id = "navidentities" href = "/" "Identities" }
  14. a { id = "navinbox" href = "/inbox" "Inbox" }
  15. a { id = "navapps" href = "/apps" "Apps" }
  16. }
  17. if (noNetwork) { offlineNote { id = "offline" "Offline — ident needs the network to sign in and to save" } }
  18. }
  19. // THE NETWORK PROBE: a CSS animation (styles.hl `ident-net-probe`) starts half a second
  20. // after the page is up and repeats every 20 s; each start and repeat asks /api/online.
  21. // A View has no "mounted" event, and a probe that fired before the page is hydrated
  22. // would be lost, so the delayed animation is the trigger. No JavaScript of ours.
  23. netProbe { on animationstart(e) { emit probe(e) } on animationiteration(e) { emit probe(e) } }
  24. main { slot }
  25. script { src = "/avatar.js" }
  26. }
  27. }
  28. // the probe: no answer (or not ident's 204) = offline; the next repeat clears it again.
  29. // On `/start` (the installed app's start page, start.hl) an answer means: go on to `/`.
  30. on probe(e) {
  31. let r = window.__hlAttempt(() => { return fetch('/api/online', { cache = 'no-store' }) })
  32. noNetwork = !r.ok || r.value.status != 204
  33. if (!noNetwork && window.location.pathname == '/start') { window.location.replace('/') }
  34. }
  35. // "SIGN OUT EVERYWHERE" from another device or tab (home.hl signOutAll): the server pushes
  36. // this to every open page of the account (project.hl audience), which reloads into the
  37. // signed-out state at once — no click needed.
  38. on client signedOutAll(accountId) {
  39. window.location.reload()
  40. }

Branches

Latest commits

  • 91017164ident mission 009 (1/4): file moves — the root .hl files into lib/ (api.hl → lib/api-helpers.hl), styles.hl → components/styles.hl; imports adjusted, no other changemre
  • f8bdcbc2ident: Hybriel master 06617221 (plugin allocators 3a781359 + 413f60e4, mpackdb 2cb7ae5e, http1 773de63e); all gates greenmre
  • ff78726cident: Hybriel master 190aa11d (fc838894 GC correctness, #127, #126 closure scopes); gates all greenmre
  • a3a7d21aident: Hybriel master 8efba065 (#126 GC by bytes, #48 lambda params copy); session-writing lambdas take &sessionmre
  • 98226b41antcolony#40: mission references point to the moved missionsmre
  • ff805b9aantcolony#40: history (LOG.md), worker briefs (missions/) and reports moved here from antcolony, numbered per project; old numbers in antcolony docs/mission-map.mdmre
  • 51a7bcdfident: Hybriel master 73267707 (#122); /code uses the new page() signature; pending address passed as parameter; once-checksmre
  • 836f644fident#24: installable app (manifest, service worker, data-free offline /start), own iconmre
  • 8bebbbf2deploy.sh: back up live storage/.sessions/.env before every deploy (newest 5 kept)mre
  • cc063ea2deploy.sh: never send .git or .gitignore to Byrodinmre
  • 81b15b7bState of 2026-09-27, before the move to gitoriamre