gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit7b8a4f747b8a4f74security audit SK: nosniff + image sandbox headers, face id checks, adult follow, login budget + new session at login, guest-link budget, tests/security.mjssk7b8a4f74/theme/shell/main-menu.hl

3.0 KB

  1. // main-menu.hl — THE MAIN MENU: the app's top-level links, `Series | Shows | Movies` (docs/layouts/main-menu.md).
  2. // Write it twice from ONE list: in the header (shown from 60rem) and in the sidebar (shown on the phone, where the
  3. // header has no room). The link whose href is `current` (or a page below it) is marked: class `current` and
  4. // aria-current="page". Without a matching path the host says which one: `current = "/docs"` (the page /read/x is
  5. // under Docs) or `current = true` on the item itself. An item may carry a small count: `count = 3` (a badge, not text).
  6. //
  7. // static menu = [ { label = 'Series' href = '/series' } { label = 'Movies' href = '/movies' } ]
  8. // AppHeader { MainMenu { items = menu current = "/series" } }
  9. // Sidebar { desktop = "false" MainMenu { items = menu current = "/series" } }
  10. Hybrid items = []
  11. String current = ''
  12. String label = 'Main menu'
  13. Hybrid rows = build(items, current)
  14. // one row per link: the current one (the page itself or a page below it) is marked
  15. build(list, at) {
  16. out = []
  17. for (it of list) {
  18. let here = it.current == true || at == it.href || (it.href != '/' && at.startsWith(it.href + '/'))
  19. let n = it.count == null ? '' : '' + it.count
  20. out.push({ label = it.label href = it.href count = n has = n != '' cls = here ? 'current' : '' aria = here ? 'page' : 'false' })
  21. }
  22. return out
  23. }
  24. Style {
  25. 'main-menu' { display = 'block' }
  26. 'main-menu a' { display = 'flex' alignItems = 'center' minHeight = 'var(--layout-tap)' padding = '.55rem .75rem' fontWeight = '600' color = 'var(--color-text)' borderRadius = 'var(--radius-small)' }
  27. 'main-menu a:hover' { textDecoration = 'none' color = 'var(--color-text-strong)' background = 'var(--color-surface)' }
  28. // the marked link: accent text AND a bar in the accent (not colour alone), on the surface
  29. 'main-menu a.current' { color = 'var(--color-accent)' background = 'var(--color-surface)' boxShadow = 'inset .2rem 0 0 var(--color-accent)' }
  30. 'main-menu a span.count' { marginLeft = '.5rem' padding = '0 .45rem' minWidth = '1.4rem' textAlign = 'center' fontSize = '.8rem' fontWeight = '700' lineHeight = '1.4rem' color = 'var(--color-accent-text)' background = 'var(--color-accent)' borderRadius = 'var(--radius-small)' }
  31. // in the header: only from 60rem, the links in a row
  32. 'application-header main-menu' { display = 'none' }
  33. // in the sidebar: only on the phone, the links stacked
  34. 'app-sidebar main-menu' { marginBottom = '1rem' }
  35. '@media (min-width: 60rem)' {
  36. 'application-header main-menu' { display = 'block' marginLeft = 'auto' }
  37. 'application-header main-menu nav' { display = 'flex' gap = '.15rem' }
  38. 'application-header main-menu a' { minHeight = '2.25rem' padding = '.45rem .7rem' }
  39. 'application-header main-menu a.current' { boxShadow = 'inset 0 -.2rem 0 var(--color-accent)' }
  40. 'app-sidebar main-menu' { display = 'none' }
  41. }
  42. }
  43. View {
  44. mainMenu {
  45. nav { 'aria-label' = label
  46. for (r of rows) { a { href = r.href class = r.cls 'aria-current' = r.aria r.label if (r.has) { span { class = 'count' r.count } } } }
  47. }
  48. }
  49. }

Branches

Latest commits

  • 7b8a4f74security audit SK: nosniff + image sandbox headers, face id checks, adult follow, login budget + new session at login, guest-link budget, tests/security.mjssk
  • f0f26c5areports: T18 section (gates, boot-gate, 3x3 table, search + short-id compare)mre
  • 2a8682a1deploy.sh GATES: tests/warmstart.mjsmre
  • 3761338breports/T17-boot.md: handoff (phase table, fix, numbers so far, open proof)mre
  • 52e09eb2boot: sync window 1000 ms (the gates ask for a complete start), README boot-time sectionmre
  • c87149e8tests/warmstart.mjs: the progressive start proven over HTTP (note in the window, 503 short id, after: everything); bootBeginmre
  • 593a6350boot: resumable start-up scan, the server listens first (T17)mre
  • be4890a0reports: H2 hydration audit (no test change needed)mre
  • 1f9c8bf4re-vendor Hybriel 5406d146 (hl:web batches 9+10: #72 emits while the socket is closed delivered after reconnect, browser boot linear, faster list appends; contains int 6–14 + m406)mre
  • c1df88eddocker-compose: HL_GC_TABLE_LOAD=62 (tracker mission 048, T16 real-data numbers)mre
  • d0a82867mission 048: report, LOG (HL_GC_TABLE_LOAD=62 measured)mre
  • 2d4be66fre-vendor Hybriel 5df4eb7e (GC: HL_GC_TABLE_LOAD knob, mission 406)mre
  • 99e7c8b9tests: realdata-m035-radii, repro-t38, realdata-060-backfill ports from env (REAL_PORT, REAL_CHROME, REPRO_CHROME), defaults unchangedmre
  • 4625aa22re-vendor Hybriel 6f8a0689 (int 6–11: streaming cursors, #203 index heal + close() fix, fd403 listDir/cursor fds, hl:time browser side, hl:web batches 5+6)mre
  • a6dfd6ecdeploy: person-lookup gate (tracker#46)mre
  • 33ad4bd5Merge commit 'f57f64f'mre
  • 7d38cec4docker-compose: nofile 65536 (default soft 1024 refused boot: errno 24 in fs.listDir, Hybriel 528bc89f)mre
  • f57f64f0mission 046: report, LOGmre
  • 5965963adeploy: backup copies index files first and *.mpack data last (hot-copy skew, hybriel #203)mre
  • efe1b485mission 046: re-vendor Hybriel master 60b2817b (integration 8, #203): plugins mpackdb + web (bin/ git-ignored: hybriel, libhlrt.a, hlc.o, hlrt/ from native/zig-out)mre