gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmain4099e64aMerge branch 'font-segoe-ui' into mainAtlasmain/components/demo/notes-demo.hl

2.6 KB

  1. // components/demo/notes-demo.hl — `/shells/list-first[/:id]`: SHELL 2 as a mock Notes app, signed in. On the phone `/`
  2. // shows only the list (its welcome text is never seen there); a note's route shows only the note, with a link back.
  3. // Desktop: list and note side by side; `/` shows the welcome text beside the list.
  4. parent '../main.hl'
  5. import AppHeader from '../../theme/shell/app-header.hl'
  6. import UserMenu from '../../theme/shell/user-menu.hl'
  7. import ListFirst from '../../theme/shell/list-first.hl'
  8. import { notes } from '../../lib/mock.hl'
  9. id = null
  10. String view = id == null ? 'list' : 'detail'
  11. Hybrid rows = listRows(id)
  12. Hybrid note = noteOf(id)
  13. Boolean hasNote = id != null
  14. Boolean welcome = id == null
  15. Boolean emptyNote = note.paragraphs.length == 0
  16. __title = 'List-first demo · WorldAPI layouts'
  17. // the list with the opened note marked
  18. listRows(String at) {
  19. out = []
  20. for (n of notes) { out.push({ href = '/shells/list-first/' + n.id title = n.title updated = n.updated cls = n.id == at ? 'selected' : '' aria = n.id == at ? 'page' : 'false' }) }
  21. return out
  22. }
  23. noteOf(String at) {
  24. for (n of notes) { if (n.id == at) { return n } }
  25. return { id = '' title = '' updated = '' paragraphs = [] }
  26. }
  27. Style {
  28. // The note fields retain their shared demo-root selectors.
  29. notesDemo {
  30. noteTitle {
  31. display = 'block'
  32. fontWeight = '600'
  33. color = 'var(--color-text-strong)'
  34. }
  35. noteUpdated {
  36. display = 'block'
  37. fontSize = '.85rem'
  38. color = 'var(--color-text-muted)'
  39. }
  40. noteFilter {
  41. display = 'block'
  42. padding = '.25rem .75rem .75rem'
  43. }
  44. }
  45. }
  46. View {
  47. notesDemo {
  48. AppHeader { brand = "Notes (demo)" brandHref = "/shells/list-first"
  49. UserMenu { name = "Signed in as az5b2 (mock)"
  50. a { href = "/shells" "Settings" }
  51. a { href = "/shells" "Logout" }
  52. }
  53. }
  54. ListFirst { view = view
  55. aside { 'aria-label' = "Notes"
  56. noteFilter { input { type = "search" placeholder = "Filter notes" 'aria-label' = "Filter notes" } }
  57. ul { for (r of rows) { li { a { href = r.href class = r.cls 'aria-current' = r.aria noteTitle { r.title } noteUpdated { r.updated } } } } }
  58. }
  59. main {
  60. if (welcome) {
  61. h1 { "Notes" }
  62. p { class = "muted" "Pick a note on the left. (A phone never shows this text: it opens on the list.)" }
  63. p { class = "links" a { href = "/shells" "‹ Shells" } }
  64. }
  65. if (hasNote) {
  66. a { class = "back" href = "/shells/list-first" "All notes" }
  67. h1 { note.title }
  68. p { class = "muted" "Updated " note.updated }
  69. article { for (t of note.paragraphs) { p { t } } }
  70. if (emptyNote) { p { class = "empty" "This note is empty." } }
  71. }
  72. }
  73. }
  74. }
  75. }

Branches

Latest commits

  • 4099e64aMerge branch 'font-segoe-ui' into mainAtlas
  • e14fb795|||PR Theme font: Segoe UI first (his choice 2026-11-19)Atlas
  • 44071d2cMerge branch 'hl-standard-5' into mainAtlas
  • 5ea64202|||PR Gate: count the new-tab check's console errors tooAtlas
  • 2752ceddMerge branch 'hl-standard-4' into mainAtlas
  • ac552b81|||PR Gate: keyboard (Tab/Enter/Space) and Back/Forward/reload/new-tab checks (HL-STANDARD F5, F21)Atlas
  • 8cddcaa9Merge branch 'hl-standard-2' into mainAtlas
  • 2b480a64|||PR Type the route parameter of main-menu build (HL-STANDARD L10)Atlas
  • ab54a39dMerge branch 'hl-standard' into mainAtlas
  • 04d36fcf|||PR Type function parameters and drop unneeded let (HL-STANDARD L2, L10)Atlas
  • 220c8fa4Merge branch 'readme-audit' into mainAtlas
  • b78fb85a|||PR README matches the codemre
  • 9f351699Preserve comments and nest supported selectors without changing rendered outputmre
  • 97110ad9WIP: nest accepted layout selectors; stopped at startup parse failuremre
  • ce4a0baeKeep caller slot styles whole so minimal shell apps startmre
  • 12cd3992Re-vendor complete Hybriel plugins and runtime to day44mre
  • b05c20feBackup tar: --hard-dereference, so mpackdb sidecars are never stored as hard links (Tracker's finding)mre
  • 8d9ed0b8Re-vendor complete Hybriel plugins and runtime to day39mre
  • ebd00b6cNest caller slot styles in three-panemre
  • 009991efNest caller slot styles in list-firstmre