tracker
All repositories: gitoria
3.1 KB
// components/schedule.hl — `/my/schedule` (tracker.worldapi.org#6, moved from `/schedule` in #8): every episode of a show the signed-in// user follows that is not yet released, soonest first. Creator's words: "/schedule has a similar list// without check icons for he upcoming episodes of shows followed". Same row shape as /unwatched (step 5)// minus the check icon and minus any click handling — this page is read-only, so it needs no `on server`// face at all. Reused (not copied) from follows.hl/shows.hl: `followedShowIds`, `cardOf`, `episodeRowsOf`// — the same functions /unwatched already imports.//// Upcoming = release date strictly AFTER today (the architect's reading of the ticket: "the creator named// the order only for /unwatched" — /unwatched is release <= today, so the natural complement here is// release > today; an episode releasing today already belongs to /unwatched once watched state is added).parent './main.hl'import { appTitle } from '../project.hl'import { userIdOfSession } from '../lib/users.hl'import { followedShowIds } from '../lib/follows.hl'import { cardOf, episodeRowsOf, episodeCode } from '../lib/shows.hl'import { todayStr } from '../lib/util.hl'// ---- pure helpers (static: an mpackdb-backed helper must be `static` to stay callable outside its// own initializer, hybriel#115/#116 — see components/unwatched.hl's header comment) --------------// insertion sort, hand-written (no list sort(), hybriel#1) — soonest release firststatic insertByReleaseAsc = (&sorted, &row) => {out = []let inserted = falsefor (x of sorted) {if (!inserted && row.release <= x.release) { out.push(row) inserted = true }out.push(x)}if (!inserted) { out.push(row) }return out}static scheduleRowsOf = (&userId) => {if (userId == null) { return [] }today = todayStr()let out = []// tracker#30 (mission 025): the slim cached card + episode rows per followed title (shows.hl), no record fetched per loadfor (sid of followedShowIds(userId)) {let c = cardOf(sid)if (c != null) {for (e of episodeRowsOf(sid)) {let upcoming = e.release != null && e.release > todayif (upcoming) {out = insertByReleaseAsc(out, {id = e.id showTitle = c.titleYear showHref = c.hrefepisodeLabel = episodeCode(e.s, e.e) + ' · ' + e.titlerelease = e.release})}}}}return out}// ---- reactive members -----------------------------------------------------------------------session = nulluserId = userIdOfSession(session)signedIn = userId != null// a plain copy of userId for `rows` (mission 047: session sync, see components/show.hl `me`)me = userIdrows = signedIn ? scheduleRowsOf(me) : []hasRows = rows.length > 0noRows = !hasRowsemptyText = signedIn ? 'No upcoming episodes.' : 'Sign in to see the shows you follow.'__title = 'Schedule — ' + appTitleView {schedulePage {h1 { "Schedule" }if (noRows) { p { class = "muted" emptyText } }if (hasRows) {scheduleRows {for (row of rows) {scheduleRow {a { class = "schedule-show" href = row.showHref row.showTitle }scheduleEpisode { row.episodeLabel }scheduleDate { row.release }}}}}}}
Branches
Latest commits
- 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
- 53099ffbmission 046: person page reads a slim per-title credit row cache (no whole-record fetch per credit); gate tests/person-lookup.mjsmre
- 9b3828aemission 046a: report, LOGmre
- 4b37356emission 046: franchise seed supersedeCollections reads the curated timelines once (10 s one-tick block at the end of boot)mre
- ac6268e3mission 046a: re-vendor Hybriel 528bc89f (integration 6): plugins mpackdb/time/web (bin/ git-ignored)mre
- 322b3293mission 046: photoQueue guard for non-row fetch results (damaged persons index)mre
- e5b99aecmission 046: photoQueue in slices (people.hl photoQueueStart/Step, jobs.hl photoTick), tests/photoqueue.hlmre
- 31dcf2admission 045: report, LOGmre
- 9c3971d0tests/persons-skip-count.hlmre