gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit3fb871123fb87112|||PR HM55b record six additional focused toggle bisectsTracker3fb87112/components/person.hl

6.3 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. // Server admission and audience pushes fill an incomplete person without reloading.
  7. //
  8. // mission 060 (tracker.worldapi.org#27): the person's short id (shortids.hl) under the photo (no photo: under the facts).
  9. //
  10. // HYBRIEL TRAPS: no session here at all (the fill needs no sign-in — one TMDB request per person, ever), so hybriel#121/#122
  11. // can't bite; every list is replaced whole. Helpers are LOCAL statics (an imported mpackdb helper straight in a member's
  12. // initializer came back wrong after a client-side navigation — components/show.hl `followingOf`).
  13. parent './main.hl'
  14. import { appTitle } from '../lib/app.hl'
  15. import { pageOf } from '../lib/people.hl'
  16. import { warmReady, warmText } from '../lib/warm.hl'
  17. import { requestFill } from '../lib/pagefills.hl'
  18. // everything the page shows for one slug
  19. static initialPage = (&slug) => {
  20. data = pageOf(&slug)
  21. if (data.loading) {
  22. error = requestFill('person', data.id, slug, pageOf)
  23. if (error != '') { data.error = error data.loading = false }
  24. }
  25. return data
  26. }
  27. // ---- reactive members -----------------------------------------------------------------------
  28. slug = null
  29. start = initialPage(&slug)
  30. found = start.found
  31. notFound = !start.found
  32. name = start.name
  33. photoUrl = start.photoUrl
  34. hasPhoto = photoUrl != ''
  35. // mission 060 (tracker.worldapi.org#27): the short id under the photo — no photo: under the name and facts
  36. shortId = start.shortId
  37. hasShortId = shortId != ''
  38. shortIdInMeta = hasShortId && !hasPhoto
  39. born = start.born
  40. hasBorn = born != ''
  41. died = start.died
  42. hasDied = died != ''
  43. bio = start.bio
  44. hasBio = bio != ''
  45. bioClass = 'short'
  46. rows = start.rows
  47. hasRows = rows.length > 0
  48. loading = start.loading
  49. loadText = 'Loading filmography…'
  50. fillError = start.error
  51. hasFillError = fillError != ''
  52. noRows = found && !loading && rows.length == 0 && fillError == ''
  53. __title = found ? name + ' — ' + appTitle : appTitle
  54. // mission T17 (boot time): the server listens while bootscan.hl still builds the lists / slug maps / search index (lib/warm.hl); until the 'all'
  55. // stage is there this page says so instead of showing half a map
  56. warming = !warmReady('all')
  57. warmNote = warming ? warmText() : ''
  58. // Component styles use the shared theme variables.
  59. Style {
  60. personMeta {
  61. display = 'block'
  62. minWidth = '0'
  63. overflowWrap = 'anywhere'
  64. shortIdLabel {
  65. textAlign = 'left'
  66. }
  67. }
  68. personPage {
  69. display = 'block'
  70. }
  71. personHeader {
  72. display = 'flex'
  73. alignItems = 'flex-start'
  74. gap = '.8rem'
  75. marginBottom = '1rem'
  76. @media {
  77. minWidth = '40rem'
  78. gap = '1rem'
  79. }
  80. }
  81. personPhoto {
  82. flex = 'none'
  83. display = 'block'
  84. width = '6rem'
  85. img {
  86. display = 'block'
  87. width = '100%'
  88. height = 'auto'
  89. aspectRatio = '2 / 3'
  90. objectFit = 'cover'
  91. borderRadius = 'var(--radius-large)'
  92. background = 'var(--color-surface)'
  93. }
  94. @media {
  95. minWidth = '40rem'
  96. width = '10rem'
  97. }
  98. }
  99. personFact {
  100. display = 'block'
  101. fontSize = '.95rem'
  102. color = 'var(--color-text-muted)'
  103. }
  104. personBio {
  105. display = 'block'
  106. margin = '0 0 1rem'
  107. fontSize = '.95rem'
  108. whiteSpace = 'pre-line'
  109. cursor = 'pointer'
  110. }
  111. 'person-bio.short' {
  112. display = '-webkit-box'
  113. overflow = 'hidden'
  114. '-webkit-line-clamp' = '4'
  115. '-webkit-box-orient' = 'vertical'
  116. }
  117. personLoading {
  118. display = 'block'
  119. padding = '.6rem 0'
  120. color = 'var(--color-text-muted)'
  121. }
  122. filmRows {
  123. display = 'block'
  124. }
  125. aFilmRow {
  126. display = 'flex'
  127. alignItems = 'center'
  128. gap = '.8rem'
  129. padding = '.45rem 0'
  130. color = 'var(--color-text)'
  131. hover {
  132. textDecoration = 'none'
  133. filmTitle {
  134. color = 'var(--color-accent)'
  135. }
  136. }
  137. }
  138. filmRole {
  139. fontSize = '.85rem'
  140. color = 'var(--color-type5)'
  141. overflowWrap = 'anywhere'
  142. empty {
  143. display = 'none'
  144. }
  145. }
  146. filmYear {
  147. empty {
  148. display = 'none'
  149. }
  150. }
  151. }
  152. View {
  153. personPage { "data-loading" = loading
  154. if (warming) { p { id = "warming" class = "message banner" warmNote } }
  155. if (notFound) {
  156. article { class = "main"
  157. h1 { "Not found" }
  158. p { "This person doesn't exist." }
  159. }
  160. }
  161. if (found) {
  162. personHeader {
  163. if (hasPhoto) {
  164. personPhoto {
  165. img { src = photoUrl alt = name }
  166. if (hasShortId) { shortIdLabel { id = "shortid" title = "Short id" shortId } }
  167. }
  168. }
  169. personMeta {
  170. h1 { class = "typed" typeWord { class = "type-word type-person" "Person" } typeSep { "|" } typeName { name } }
  171. if (hasBorn) { personFact { class = "born" born } }
  172. if (hasDied) { personFact { class = "died" died } }
  173. if (shortIdInMeta) { shortIdLabel { id = "shortid" title = "Short id" shortId } }
  174. }
  175. }
  176. // a SHORT bio: four lines (styles.hl), a click shows all of it
  177. if (hasBio) { personBio { class = bioClass title = "Show all" bio on click(e) { emit toggleBio(e) } } }
  178. h2 { class = "film-heading" "Filmography" }
  179. if (loading) {
  180. personLoading { id = "personloading" loadText
  181. }
  182. }
  183. if (hasFillError) { p { id = "fillerror" class = "message" fillError } }
  184. if (noRows) { p { id = "nofilms" class = "muted" "No shows or movies known." } }
  185. if (hasRows) {
  186. filmRows {
  187. for (row of rows) {
  188. a { Style.aFilmRow href = row.href
  189. img { class = "film-poster" src = row.posterUrl alt = "" loading = "lazy" }
  190. filmText {
  191. filmTitle { row.title }
  192. filmMeta {
  193. filmYear { row.year }
  194. filmType { class = row.typeClass row.typeLabel }
  195. }
  196. filmRole { row.role }
  197. }
  198. }
  199. }
  200. }
  201. }
  202. }
  203. }
  204. }
  205. on client personFillProgress(id, pos, total) {
  206. if (start.id != id || !loading) { return null }
  207. loadText = 'Loading filmography… ' + pos + ' of ' + total + ' titles'
  208. }
  209. on client personFilled(id, data) {
  210. if (start.id != id) { return null }
  211. if (data.error != null && data.error != '') {
  212. fillError = 'Could not load the filmography: ' + data.error
  213. loading = false
  214. return null
  215. }
  216. start = data
  217. loading = false
  218. }
  219. on toggleBio(e) {
  220. bioClass = bioClass == 'short' ? 'full' : 'short'
  221. }

Branches

Latest commits

  • 3fb87112|||PR HM55b record six additional focused toggle bisectsTracker
  • 20131f51|||PR HM55b record incomplete episode-toggle bisectTracker
  • 17feb7abHM55 WIP: hm54-fill re-applied on main; browser gate fails at ep3 toggleTracker
  • 28eab08cMerge branch 'records-hm55' into mainTracker
  • d3edaa05|||PR records: HM55 start, PROCEDURES.mdTracker
  • 3059f86cMerge branch 'records-design-rule' into mainTracker
  • 421a4809|||PR records: his-design rule (Apollo 2026-11-13)Tracker
  • d1390692Merge branch 'records-dp75b' into mainTracker
  • a4d1a7d2|||PR records: later steps checked, branch auditTracker
  • e070e16fMerge branch 'records-dp75' into mainTracker
  • 642b4fa8|||PR records: DP75 day62 live, AP62 briefTracker
  • bfc4ea4dMerge branch 'ap62' into mainTracker
  • 2c95ac46|||PR AP62: re-vendor Hybriel set day62 (source 70341ad2, bin a54f5f08)Tracker
  • b9c7c3c8Merge branch 'records-dp74' into mainTracker
  • 85cfb4ae|||PR records: AP61 day61, DP74 liveTracker
  • b1496147Merge branch 'ap61' into mainTracker
  • 2047955bMerge branch 'u12-gateports' into mainTracker
  • c8da40f3|||PR AP61: re-vendor Hybriel set day61 (source a05af47c, bin a11042e5)Tracker
  • 4e018678|||PR deploy.sh: gates use Tracker's ports 8716-8719 and LC_ALL=C; README: 2 backups keptTracker
  • 0b86324aMerge branch 'records-dp73' into mainTracker