gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit8fee5d528fee5d52sessions last 99 years (creator 2026-10-23: logins never expire; only sign out ends them)mre8fee5d52/components/person.hl

6.6 KB

  1. // components/person.hl — `/person/<slug>` (tracker.worldapi.org#16): a person's page — name, photo, born/died, bio, then
  2. // the filmography (poster, title, year, role; series and movies, newest first, each → its page: /series/, /shows/ or /movies/<slug>).
  3. // The show page's cast and the search's people link here. tracker.worldapi.org#20: the heading is "Person | <name>" (the type word
  4. // in the person colour, styles.hl `type-*`), each row's kind word in its type's colour.
  5. //
  6. // FIRST VISIT of a person we don't have complete yet (people.hl `needsFill`): the page shows what we have plus "Loading
  7. // filmography…" and fills in WITHOUT a reload — the face `personFill` does ONE step per call (1st: TMDB person + credits,
  8. // then 40 titles per call, the last marks the person complete) and the handler calls it until it says `done`; between two
  9. // calls hl:web serves every other request. hl:web gives a page no "mounted" hook, so the first call comes from a tick like
  10. // the shell's offline probe (components/main.hl): the invisible `personProbe` runs an endless short CSS animation
  11. // (styles.hl) and its `animationiteration` starts the fill (once — `busy`). A failed fill shows why; the next visit tries again.
  12. //
  13. // mission 060 (tracker.worldapi.org#27): the person's short id (shortids.hl) under the photo (no photo: under the facts).
  14. //
  15. // HYBRIEL TRAPS: no session here at all (the fill needs no sign-in — one TMDB request per person, ever), so hybriel#121/#122
  16. // can't bite; every list is replaced whole. Helpers are LOCAL statics (an imported mpackdb helper straight in a member's
  17. // initializer came back wrong after a client-side navigation — components/show.hl `followingOf`).
  18. parent './main.hl'
  19. import { appTitle } from '../project.hl'
  20. import { personBySlug, personInfoOf, filmographyOf, needsFill, personFillStep } from '../lib/people.hl'
  21. import { warmReady, warmText } from '../lib/warm.hl'
  22. // everything the page shows for one slug
  23. static pageOf = (&slug) => {
  24. let p = personBySlug(slug)
  25. if (p == null) { return { found = false name = '' photoUrl = '' born = '' died = '' bio = '' rows = [] loading = false shortId = '' } }
  26. info = personInfoOf(p)
  27. return { found = true name = info.name photoUrl = info.photoUrl born = info.born died = info.died bio = info.bio
  28. rows = filmographyOf(p) loading = needsFill(p) shortId = p.shortId != null ? '' + p.shortId : '' }
  29. }
  30. // one fill step for the person of this slug; the last answers the whole page again
  31. static fillOf = (&slug) => {
  32. let p = personBySlug(slug)
  33. if (p == null) { return { error = 'no such person' } }
  34. r = personFillStep(p.id)
  35. if (r.error != null) { return { error = r.error } }
  36. if (r.done != true) { return { done = false pos = r.pos total = r.total } }
  37. out = pageOf(slug)
  38. out.done = true
  39. out.added = r.added
  40. return out
  41. }
  42. // ---- reactive members -----------------------------------------------------------------------
  43. slug = null
  44. start = pageOf(slug)
  45. found = start.found
  46. notFound = !start.found
  47. name = start.name
  48. photoUrl = start.photoUrl
  49. hasPhoto = photoUrl != ''
  50. // mission 060 (tracker.worldapi.org#27): the short id under the photo — no photo: under the name and facts
  51. shortId = start.shortId
  52. hasShortId = shortId != ''
  53. shortIdInMeta = hasShortId && !hasPhoto
  54. born = start.born
  55. hasBorn = born != ''
  56. died = start.died
  57. hasDied = died != ''
  58. bio = start.bio
  59. hasBio = bio != ''
  60. bioClass = 'short'
  61. rows = start.rows
  62. hasRows = rows.length > 0
  63. loading = start.loading
  64. loadText = 'Loading filmography…'
  65. busy = false
  66. fillError = ''
  67. hasFillError = fillError != ''
  68. noRows = found && !loading && rows.length == 0 && fillError == ''
  69. __title = found ? name + ' — ' + appTitle : appTitle
  70. // mission T17 (boot time): the server listens while bootscan.hl still builds the lists / slug maps / search index (lib/warm.hl); until the 'all'
  71. // stage is there this page says so instead of showing half a map
  72. warming = !warmReady('all')
  73. warmNote = warming ? warmText() : ''
  74. View {
  75. personPage { "data-loading" = loading
  76. if (warming) { p { id = "warming" class = "message banner" warmNote } }
  77. if (notFound) {
  78. article { class = "main"
  79. h1 { "Not found" }
  80. p { "This person doesn't exist." }
  81. }
  82. }
  83. if (found) {
  84. personHeader {
  85. if (hasPhoto) {
  86. personPhoto {
  87. img { src = photoUrl alt = name }
  88. if (hasShortId) { shortIdLabel { id = "shortid" title = "Short id" shortId } }
  89. }
  90. }
  91. personMeta {
  92. h1 { class = "typed" typeWord { class = "type-word type-person" "Person" } typeSep { "|" } typeName { name } }
  93. if (hasBorn) { personFact { class = "born" born } }
  94. if (hasDied) { personFact { class = "died" died } }
  95. if (shortIdInMeta) { shortIdLabel { id = "shortid" title = "Short id" shortId } }
  96. }
  97. }
  98. // a SHORT bio: four lines (styles.hl), a click shows all of it
  99. if (hasBio) { personBio { class = bioClass title = "Show all" bio on click(e) { emit toggleBio(e) } } }
  100. h2 { class = "film-heading" "Filmography" }
  101. if (loading) {
  102. personLoading { id = "personloading" loadText
  103. personProbe { "aria-hidden" = "true" on animationiteration(e) { emit fillTick(e) } }
  104. }
  105. }
  106. if (hasFillError) { p { id = "fillerror" class = "message" fillError } }
  107. if (noRows) { p { id = "nofilms" class = "muted" "No shows or movies known." } }
  108. if (hasRows) {
  109. filmRows {
  110. for (row of rows) {
  111. a { class = "film-row" href = row.href
  112. img { class = "film-poster" src = row.posterUrl alt = "" loading = "lazy" }
  113. filmText {
  114. filmTitle { row.title }
  115. filmMeta {
  116. filmYear { row.year }
  117. filmType { class = row.typeClass row.typeLabel }
  118. }
  119. filmRole { row.role }
  120. }
  121. }
  122. }
  123. }
  124. }
  125. }
  126. }
  127. }
  128. // the probe's tick: the fill, step by step, until done (once per page — `busy`); a lost answer (null) just waits for the
  129. // next tick and goes on where the server is
  130. on fillTick(e) {
  131. if (busy || !loading) { return null }
  132. busy = true
  133. s = slug
  134. let r = emit server personFill(s)
  135. while (r != null && r.error == null && r.done != true && slug == s) {
  136. loadText = 'Loading filmography… ' + r.pos + ' of ' + r.total + ' titles'
  137. r = emit server personFill(s)
  138. }
  139. busy = false
  140. if (r == null || slug != s) { return null }
  141. if (r.error != null) {
  142. loading = false
  143. fillError = 'Could not load the filmography: ' + r.error
  144. return null
  145. }
  146. photoUrl = r.photoUrl
  147. born = r.born
  148. died = r.died
  149. bio = r.bio
  150. rows = r.rows
  151. loading = false
  152. }
  153. on toggleBio(e) {
  154. bioClass = bioClass == 'short' ? 'full' : 'short'
  155. }
  156. // ---- the face (a unique name: hl:web dispatches faces by name across all files) ----
  157. on server personFill(slug) {
  158. return fillOf(slug != null ? '' + slug : '')
  159. }

Branches

Latest commits

  • 8fee5d52sessions last 99 years (creator 2026-10-23: logins never expire; only sign out ends them)mre
  • 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