gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit18114a5318114a53tracker: franchises gate waits for the signed-out selector instead of the removed Log in buttonmre18114a53/components/schedule.hl

3.1 KB

  1. // components/schedule.hl — `/my/schedule` (tracker.worldapi.org#6, moved from `/schedule` in #8): every episode of a show the signed-in
  2. // user follows that is not yet released, soonest first. Creator's words: "/schedule has a similar list
  3. // without check icons for he upcoming episodes of shows followed". Same row shape as /unwatched (step 5)
  4. // minus the check icon and minus any click handling — this page is read-only, so it needs no `on server`
  5. // face at all. Reused (not copied) from follows.hl/shows.hl: `followedShowIds`, `cardOf`, `episodeRowsOf`
  6. // — the same functions /unwatched already imports.
  7. //
  8. // Upcoming = release date strictly AFTER today (the architect's reading of the ticket: "the creator named
  9. // the order only for /unwatched" — /unwatched is release <= today, so the natural complement here is
  10. // release > today; an episode releasing today already belongs to /unwatched once watched state is added).
  11. parent './main.hl'
  12. import { appTitle } from '../project.hl'
  13. import { userIdOfSession } from '../lib/users.hl'
  14. import { followedShowIds } from '../lib/follows.hl'
  15. import { cardOf, episodeRowsOf, episodeCode } from '../lib/shows.hl'
  16. import { todayStr } from '../lib/util.hl'
  17. // ---- pure helpers (static: an mpackdb-backed helper must be `static` to stay callable outside its
  18. // own initializer, hybriel#115/#116 — see components/unwatched.hl's header comment) --------------
  19. // insertion sort, hand-written (no list sort(), hybriel#1) — soonest release first
  20. static insertByReleaseAsc = (&sorted, &row) => {
  21. out = []
  22. let inserted = false
  23. for (x of sorted) {
  24. if (!inserted && row.release <= x.release) { out.push(row) inserted = true }
  25. out.push(x)
  26. }
  27. if (!inserted) { out.push(row) }
  28. return out
  29. }
  30. static scheduleRowsOf = (&userId) => {
  31. if (userId == null) { return [] }
  32. today = todayStr()
  33. let out = []
  34. // tracker#30 (mission 025): the slim cached card + episode rows per followed title (shows.hl), no record fetched per load
  35. for (sid of followedShowIds(userId)) {
  36. let c = cardOf(sid)
  37. if (c != null) {
  38. for (e of episodeRowsOf(sid)) {
  39. let upcoming = e.release != null && e.release > today
  40. if (upcoming) {
  41. out = insertByReleaseAsc(out, {
  42. id = e.id showTitle = c.titleYear showHref = c.href
  43. episodeLabel = episodeCode(e.s, e.e) + ' · ' + e.title
  44. release = e.release
  45. })
  46. }
  47. }
  48. }
  49. }
  50. return out
  51. }
  52. // ---- reactive members -----------------------------------------------------------------------
  53. session = null
  54. userId = userIdOfSession(session)
  55. signedIn = userId != null
  56. // a plain copy of userId for `rows` (mission 047: session sync, see components/show.hl `me`)
  57. me = userId
  58. rows = signedIn ? scheduleRowsOf(me) : []
  59. hasRows = rows.length > 0
  60. noRows = !hasRows
  61. emptyText = signedIn ? 'No upcoming episodes.' : 'Sign in to see the shows you follow.'
  62. __title = 'Schedule — ' + appTitle
  63. View {
  64. schedulePage {
  65. h1 { "Schedule" }
  66. if (noRows) { p { class = "muted" emptyText } }
  67. if (hasRows) {
  68. scheduleRows {
  69. for (row of rows) {
  70. scheduleRow {
  71. a { class = "schedule-show" href = row.showHref row.showTitle }
  72. scheduleEpisode { row.episodeLabel }
  73. scheduleDate { row.release }
  74. }
  75. }
  76. }
  77. }
  78. }
  79. }

Branches

Latest commits

  • 18114a53tracker: franchises gate waits for the signed-out selector instead of the removed Log in buttonmre
  • 08561d73ident selector back in the header (creator 2026-10-24): selector top right signed in and out on phone and desktop, no second Log in button, new gate checks (WIP: gates not re-run after the last edits)mre
  • 59ef1e4atests/browser: repair 'done' check counts the 404 titles the first run already finished (race: failed=1 when Bulk Film 79 ran before the restart)mre
  • 5925fc4dreports/MK-mobile.md: rebase update, gate countsmre
  • 6adbc7f0extlink badges: background-clip after the background shorthand (it reset the clip: the pills were 44 px tall); gates check the lookmre
  • 8d3b0f20widget: the franchise link's 44 px tap area no longer overlaps the Prequel/Sequel rowmre
  • 1d98dcfdbrowser gate: the badges' size check reads the padding box (the 44 px tap area is transparent border)mre
  • 2f9e29ffreports/MK-mobile.md, deploy.sh GATES: tests/mobile.mjs, theme check markermre
  • 7cfc8ab5a season of more than 150 episodes starts closed on its title page; the phone gate checks itmre
  • 59095c59tests/mobile.mjs: the phone gate (390 px touch, tap targets, /franchises paging)mre
  • 105309detap targets: every row link, the TMDB/IMDb badges, the widget links, the franchise names and the login-failed link are 44 px high on a phonemre
  • f0b86c8efranchises: 40 loose timelines per page (/franchises/page/N) and a merge sort for the names (1,546 timelines: 20 s and 54,000 px before)mre
  • b9e841a7Merge branch 'sy-sync'mre
  • d1ae2701sync components.hybriel 4922f9c: modal and pagination 44 px targets (vendored copies, verbatim) (SY)mre
  • 043624b2theme: sync from layouts 4994037 (list rows stack, td word-keep, heading code, edited tap target)mre
  • 05d89fd0deploy: security gate (tests/security.mjs)mre
  • 2ae8a47bMerge branch 'sk-sec'mre
  • 8fee5d52sessions last 99 years (creator 2026-10-23: logins never expire; only sign out ends them)mre
  • 944ad51eSK: report reports/SK-sec.md, LOGsk
  • 415487c1SK: import budget per user + id type check, gate checkssk