gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit54cbec8054cbec80compose: ignore SIGPIPE (TR7 crash loop, exit 141)mre54cbec80/components/franchiseedit.hl

4.3 KB

  1. // components/franchiseedit.hl — `/franchises/edit` (tracker.worldapi.org#19, mission 066): the creator's editor, step 1 —
  2. // a new franchise (name + summary → its index), a new timeline (name → its own editor, /timelines/<slug>/edit, where titles
  3. // are added and ordered and the franchise is attached), and a finder for the timelines that exist (by name → their editor).
  4. // Only the creator (franchises.hl isEditorSession: ident id az5b2, TRACKER_EDITORS) sees the forms; every face checks it again.
  5. //
  6. // HYBRIEL TRAPS (as components/search.hl): no member reads both a route param and `session`; every list is replaced whole.
  7. parent './main.hl'
  8. import { navigate } from 'hl:web'
  9. import { appTitle } from '../project.hl'
  10. import { isEditorSession, createFranchise, createTimeline, findTimelines } from '../lib/franchises.hl'
  11. import { warmReady, warmText } from '../lib/warm.hl'
  12. static editorOf = (&session) => { return isEditorSession(session) }
  13. session = null
  14. isEditor = editorOf(session)
  15. notEditor = isEditor == false
  16. message = ''
  17. hasMessage = message != ''
  18. found = []
  19. hasFound = found.length > 0
  20. __title = 'Edit franchises — ' + appTitle
  21. // mission T17 (boot time): the server listens while bootscan.hl still builds the lists / slug maps / search index (lib/warm.hl); until the 'all'
  22. // stage is there this page says so instead of showing half a map
  23. warming = !warmReady('all')
  24. warmNote = warming ? warmText() : ''
  25. View {
  26. franchiseEditPage {
  27. if (warming) { p { id = "warming" class = "message banner" warmNote } }
  28. h1 { "Edit franchises" }
  29. if (notEditor) { p { id = "edit-refused" class = "muted" "Only the creator can edit franchises and timelines." } }
  30. if (isEditor) {
  31. if (hasMessage) { p { id = "edit-message" class = "message" message } }
  32. editSection {
  33. h2 { class = "film-heading" "New franchise" }
  34. input { id = "fe-name" type = "text" placeholder = "Name, e.g. Star Trek" autocomplete = "off" "aria-label" = "Franchise name" }
  35. textarea { id = "fe-summary" rows = "3" placeholder = "A few words about it (optional)" "aria-label" = "Franchise summary" }
  36. button { id = "fe-create" type = "button" class = "primary" "Create franchise" on click(e) { emit newFranchise(e) } }
  37. }
  38. editSection {
  39. h2 { class = "film-heading" "New timeline" }
  40. input { id = "te-name" type = "text" placeholder = "Name, e.g. Star Trek — Prime" autocomplete = "off" "aria-label" = "Timeline name" }
  41. button { id = "te-create" type = "button" class = "primary" "Create timeline" on click(e) { emit newTimeline(e) } }
  42. }
  43. editSection {
  44. h2 { class = "film-heading" "Edit a timeline" }
  45. input { id = "tl-find" type = "search" placeholder = "Timeline name" autocomplete = "off" "aria-label" = "Find a timeline" on input(e) { emit findTyped(e) } }
  46. if (hasFound) {
  47. timelineList { id = "tl-found"
  48. for (t of found) {
  49. a { class = "timeline-link" href = t.href
  50. timelineLinkName { t.name }
  51. timelineLinkCount { t.countText }
  52. }
  53. }
  54. }
  55. }
  56. }
  57. }
  58. }
  59. }
  60. on newFranchise(e) {
  61. r = emit server fedCreateFranchise(document.getElementById('fe-name').value, document.getElementById('fe-summary').value)
  62. if (r == null || r.error != null) { message = r != null ? r.error : 'Could not create it.' return null }
  63. navigate('/franchises/' + r.slug)
  64. }
  65. on newTimeline(e) {
  66. r = emit server fedCreateTimeline(document.getElementById('te-name').value)
  67. if (r == null || r.error != null) { message = r != null ? r.error : 'Could not create it.' return null }
  68. navigate('/timelines/' + r.slug + '/edit')
  69. }
  70. on findTyped(e) {
  71. v = e.target.value
  72. r = emit server fedFindTimelines(v)
  73. if (r == null || document.getElementById('tl-find').value != v) { return null }
  74. found = r.rows
  75. }
  76. // ---- the faces (unique names: hl:web dispatches by name across all files; the trailing `session` is the server's) ----
  77. on server fedCreateFranchise(name, summary, session) {
  78. if (!isEditorSession(session)) { return { error = 'only the creator can do that' } }
  79. return createFranchise(name, summary)
  80. }
  81. on server fedCreateTimeline(name, session) {
  82. if (!isEditorSession(session)) { return { error = 'only the creator can do that' } }
  83. return createTimeline(name)
  84. }
  85. // timeline names are public (/franchises lists them all) — no session needed
  86. on server fedFindTimelines(text) {
  87. return { rows = findTimelines(text) }
  88. }

Branches

Latest commits

  • 54cbec80compose: ignore SIGPIPE (TR7 crash loop, exit 141)mre
  • 3e164b63Tracker: status after CL1mre
  • 9d686bb3Tracker: CL1 reviewedmre
  • b8bba562CL1: crash loop report (SIGPIPE confirmed, trap wrapper option)mre
  • 298785f2Tracker: CL1 startedmre
  • 36b22710Tracker: port slot, CL1 briefmre
  • a401190fTracker: GO for the crash loopmre
  • e195d372Tracker: token pathsmre
  • 7f541d11Tracker conductor: CONDUCTOR.md, short STATUS.md, old status + decisions archive to archive/2026-10-31mre
  • 8dd423f7README: login.js stays by caramboleyo's explicit rulemre
  • d8df1493tracker: standby service on port 45018 and a gap-free hand-over in deploy.sh step 4mre
  • 36dd1686ident#31: the selector's sign-in returns to the page the user started on (return attribute = the login callback with next), gate checkmre
  • ff9b838etracker: the Ended status pill uses the same red as layouts (pill danger); gate updatedmre
  • 40d9719eTP2: LOG line and report for the tracker pillsmre
  • ab3f2ba5tracker: status, genres, TMDB/IMDb/TVDB/TVmaze links and list kinds use the theme's pill; dense season list with the season check centred on its title line; gates for bothmre
  • 521061d6tracker header on phones: signed in, the brand fits whole at 360 and 390 px (tighter gaps and side paddings, slightly smaller brand, narrow screens and signed in only); mobile gate checks itmre
  • 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