tracker
All repositories: gitoria
5.9 KB
// components/person.hl — `/person/<slug>` (tracker.worldapi.org#16): a person's page — name, photo, born/died, bio, then// the filmography (poster, title, year, role; series and movies, newest first, each → /shows/<slug>). The show page's cast// and the search's people link here.//// FIRST VISIT of a person we don't have complete yet (people.hl `needsFill`): the page shows what we have plus "Loading// filmography…" and fills in WITHOUT a reload — the face `personFill` does ONE step per call (1st: TMDB person + credits,// then 40 titles per call, the last marks the person complete) and the handler calls it until it says `done`; between two// calls hl:web serves every other request. hl:web gives a page no "mounted" hook, so the first call comes from a tick like// the shell's offline probe (components/main.hl): the invisible `personProbe` runs an endless short CSS animation// (styles.hl) and its `animationiteration` starts the fill (once — `busy`). A failed fill shows why; the next visit tries again.//// mission 060 (tracker.worldapi.org#27): the person's short id (shortids.hl) under the photo (no photo: under the facts).//// HYBRIEL TRAPS: no session here at all (the fill needs no sign-in — one TMDB request per person, ever), so hybriel#121/#122// can't bite; every list is replaced whole. Helpers are LOCAL statics (an imported mpackdb helper straight in a member's// initializer came back wrong after a client-side navigation — components/show.hl `followingOf`).parent './main.hl'import { appTitle } from '../project.hl'import { personBySlug, personInfoOf, filmographyOf, needsFill, personFillStep } from '../people.hl'// everything the page shows for one slugstatic pageOf = (slug) => {let p = personBySlug(slug)if (p == null) { return { found = false name = '' photoUrl = '' born = '' died = '' bio = '' rows = [] loading = false shortId = '' } }let info = personInfoOf(p)return { found = true name = info.name photoUrl = info.photoUrl born = info.born died = info.died bio = info.biorows = filmographyOf(p) loading = needsFill(p) shortId = p.shortId != null ? '' + p.shortId : '' }}// one fill step for the person of this slug; the last answers the whole page againstatic fillOf = (slug) => {let p = personBySlug(slug)if (p == null) { return { error = 'no such person' } }let r = personFillStep(p.id)if (r.error != null) { return { error = r.error } }if (r.done != true) { return { done = false pos = r.pos total = r.total } }let out = pageOf(slug)out.done = trueout.added = r.addedreturn out}// ---- reactive members -----------------------------------------------------------------------slug = nullstart = pageOf(slug)found = start.foundnotFound = !start.foundname = start.namephotoUrl = start.photoUrlhasPhoto = photoUrl != ''// mission 060 (tracker.worldapi.org#27): the short id under the photo — no photo: under the name and factsshortId = start.shortIdhasShortId = shortId != ''shortIdInMeta = hasShortId && !hasPhotoborn = start.bornhasBorn = born != ''died = start.diedhasDied = died != ''bio = start.biohasBio = bio != ''bioClass = 'short'rows = start.rowshasRows = rows.length > 0loading = start.loadingloadText = 'Loading filmography…'busy = falsefillError = ''hasFillError = fillError != ''noRows = found && !loading && rows.length == 0 && fillError == ''__title = found ? name + ' — ' + appTitle : appTitleView {personPage { "data-loading" = loadingif (notFound) {article { class = "main"h1 { "Not found" }p { "This person doesn't exist." }}}if (found) {personHeader {if (hasPhoto) {personPhoto {img { src = photoUrl alt = name }if (hasShortId) { shortIdLabel { id = "shortid" title = "Short id" shortId } }}}personMeta {h1 { name }if (hasBorn) { personFact { class = "born" born } }if (hasDied) { personFact { class = "died" died } }if (shortIdInMeta) { shortIdLabel { id = "shortid" title = "Short id" shortId } }}}// a SHORT bio: four lines (styles.hl), a click shows all of itif (hasBio) { personBio { class = bioClass title = "Show all" bio on click(e) { emit toggleBio(e) } } }h2 { class = "film-heading" "Filmography" }if (loading) {personLoading { id = "personloading" loadTextpersonProbe { "aria-hidden" = "true" on animationiteration(e) { emit fillTick(e) } }}}if (hasFillError) { p { id = "fillerror" class = "message" fillError } }if (noRows) { p { id = "nofilms" class = "muted" "No shows or movies known." } }if (hasRows) {filmRows {for (row of rows) {a { class = "film-row" href = row.hrefimg { class = "film-poster" src = row.posterUrl alt = "" loading = "lazy" }filmText {filmTitle { row.title }filmMeta {filmYear { row.year }filmType { row.typeLabel }}filmRole { row.role }}}}}}}}}// the probe's tick: the fill, step by step, until done (once per page — `busy`); a lost answer (null) just waits for the// next tick and goes on where the server ison fillTick(e) {if (busy || !loading) { return null }busy = truelet s = sluglet r = emit server personFill(s)while (r != null && r.error == null && r.done != true && slug == s) {loadText = 'Loading filmography… ' + r.pos + ' of ' + r.total + ' titles'r = emit server personFill(s)}busy = falseif (r == null || slug != s) { return null }if (r.error != null) {loading = falsefillError = 'Could not load the filmography: ' + r.errorreturn null}photoUrl = r.photoUrlborn = r.borndied = r.diedbio = r.biorows = r.rowsloading = false}on toggleBio(e) {bioClass = bioClass == 'short' ? 'full' : 'short'}// ---- the face (a unique name: hl:web dispatches faces by name across all files) ----on server personFill(slug) {return fillOf(slug != null ? '' + slug : '')}
Branches
- mainmain branch
Latest commits
- d8b12d67tracker#27 (mission 060): short ids for movies, series and persons — old 702 kept (data/old-short-ids.json), new random [a-z0-9]{5} unique across both, claimed at creation, background backfill (resumes), shown under poster/photo, /<shortId> → 301; gate 259, tests/realdata-060*, README + STATUSmre
- f14db671tracker#22-#25 (mission 058): episode air dates, season check = all episodes watched, movie watched check (+ /my/movies count), /genres/<genre> pages (movies + series, newest first, paginated); gate 238, tests/realdata-058.mjs, README + STATUSmre
- 1704ec45tracker#17 (mission 057): season caret down/up, skeleton rows while a season loads, sessionless showSeasonEpisodes face (no page re-mount), client-only close; gate 214, tests/realdata-057.mjs, README + STATUSmre
- f2fe3e36mission 056: README + STATUS (merge, fixes, Hybriel 8590df63, real-data check), tests/realdata-056.mjs, tools/check-public-slugs.hlmre
- f40c250emission 056: re-vendor hybriel master 8590df63 (#121, #122); an adult title's page is Not found for non-followers; gate: leave the page before stopping the servermre
- 2b7fdd6cmission 056: signed-out header one row on phones ("Log in", nowrap), backfill skips adult titles' posters, gate checksmre
- 2c53d5efMerge branch 't16-person' (tracker#16 person pages) into main; filmography shows only public titles (054 adult flag), gate race fix (backfill start line)mre
- c171227emission 054: hide adult/unknown titles from the public lists and the search; in-app adult-flag backfill (TMDB details + poster per title, resumes), gate + real-data proofmre
- 139fafd8tracker#16: short bio (4 lines, click = all), real-data check script, README + STATUSmre
- 93be9476tracker#16: person pages /person/<slug> with the filmography fetched from TMDB on the first visit (step by step), gatemre
- 47a3cae6STATUS: mission 053 merge commit idsmre
- dcc5eecaMerge branch 't14-search'mre
- 03edc783Merge branch 't15-tvmaze'mre
- 71b46345tracker#15: numbering check by date or title, placeholder titles in other languages, docs + real-data proofmre
- 6bb2daf1tracker#13: homepage (tiles, intro, latest movies/shows), /shows, /movies/page/N, /my/movies; lists cached in memorymre
- b8bd1157tracker#14: README + STATUS (search, real-data numbers, gate, merge notes)mre
- 65c694a8tracker#14: search — header magnifier, /search/<text> (in-memory word-prefix index over titles + people), Fetch from web (TMDB search/multi, ours left out), Add = import via syncShow; gate +25 checks, real-data scriptmre
- 34f2c15btracker#15: TVmaze merge in the sync (gaps only: new episodes/seasons, empty titles/air dates; numbering check), fake TVmaze episodes + gatemre
- cbdc4ea7tracker#12: link icons TMDB/IMDb/TVDB/TVmaze; sync fills missing ids (TVmaze lookup); movies fetched via /movie/mre
- b105bcd8tracker#11: Hybriel master ff51cf46 (checks no longer vanish), mobile-first styles, carets, follow button, sign-in modal, inverted check, orange castmre