gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit408de1f2408de1f2layouts: no jobs switch needed in the standbymre408de1f2/lib/comments.hl

2.6 KB

  1. // lib/comments.hl — THE COMMENTS SHOWCASE'S MOCK DATA (the showcase's, not the component's): a short thread with an edited
  2. // comment and likes, and what the page does when the block tells it something — a new list each time (the block shows the
  3. // list it is given). The page keeps the list in itself: every visitor plays with an own copy, nothing is stored.
  4. static NL = "
  5. "
  6. static mockThread = [
  7. { id = 'c1' author = 'alice' when = 'Oct 17, 09:12' text = 'The block takes **Markdown**: *emphasis*, `code`, links like [the README](/read/readme-comments) and lists:' + NL + NL + '- one' + NL + '- two' likes = 2 liked = false history = [] }
  8. { id = 'c2' author = 'bob' when = 'Oct 17, 10:40' text = 'Edited twice — the earlier versions fold out under **edited**.' likes = 1 liked = true history = [ { when = 'Oct 17, 10:31' text = 'First try.' } { when = 'Oct 17, 10:35' text = 'First try, fixed.' } ] }
  9. { id = 'c3' author = 'alice' when = 'Oct 18, 14:05' text = 'A long word wraps on a phone: Donaudampfschifffahrtsgesellschaftskapitänswitwenrentenversicherung.' likes = 0 liked = false history = [] files = [ { name = 'notes-from-the-meeting.pdf' url = '' image = false size = 1536000 } ] }
  10. ]
  11. // the files of a new comment as the block shows them: names and sizes, no address (the showcase keeps nothing: a row, no link)
  12. static shownFiles = (files) => {
  13. out = []
  14. for (f of files) { out.push({ name = f.name url = '' image = false size = f.size }) }
  15. return out
  16. }
  17. // a new comment by `who` at the end
  18. static withNew = (list, who, text, seq, files) => {
  19. out = []
  20. for (c of list) { out.push(c) }
  21. out.push({ id = 'n' + seq author = who when = 'just now' text = text likes = 0 liked = false history = [] files = files })
  22. return out
  23. }
  24. // the comment `id` with a new text; its old text goes to the end of its history
  25. static withEdit = (list, id, text) => {
  26. out = []
  27. for (c of list) {
  28. if (c.id == id) {
  29. let past = []
  30. for (h of c.history) { past.push(h) }
  31. past.push({ when = c.when text = c.text })
  32. out.push({ id = c.id author = c.author when = 'just now' text = text likes = c.likes liked = c.liked history = past files = c.files })
  33. } else { out.push(c) }
  34. }
  35. return out
  36. }
  37. static without = (list, id) => {
  38. out = []
  39. for (c of list) { if (c.id != id) { out.push(c) } }
  40. return out
  41. }
  42. // the user's like on `id` switched: on adds one, off takes one away
  43. static withLike = (list, id) => {
  44. out = []
  45. for (c of list) {
  46. if (c.id == id) { out.push({ id = c.id author = c.author when = c.when text = c.text likes = c.liked ? c.likes - 1 : c.likes + 1 liked = !c.liked history = c.history files = c.files }) }
  47. else { out.push(c) }
  48. }
  49. return out
  50. }

Branches

Latest commits

  • 408de1f2layouts: no jobs switch needed in the standbymre
  • 0b85f57elayouts: a standby container (port 45019, profile standby); deploy hands over through standby-swap.sh without a gapmre
  • 31e40b8bMerge dm3-media: range handling in the layouts media routemre
  • 856dcacbLayouts media route: read suffix ranges and ignore range lists and garbage, like the components route (the layouts copy still answered 416 for the last bytes)mre
  • ad5056eaMerge dm3-sync: components re-sync to c2834ddmre
  • 740e2abeRe-sync the components copy to c2834dd: media player fixes (state after a queue pick, cover-less audio, accessibility labels)mre
  • 7fe103bbMerge mp-player: the media player showcase pagemre
  • 7db43c4eMedia route: serve the showcase's media from committed files (storage/ is not in git)mre
  • f77b7d12Media player: re-sync components from 1c41293 (replay / forward 10 icons, play button surface on audio and video)mre
  • 40a9e69cMP: report, LOG linemre
  • 5b5dbf0fMedia player: the component from components.hybriel dd003e5 (sync-components), the showcase page /components/media-player with a queue, its media files served with ranges (lib/media.hl), theme rules (the seek bar, the queue's current item, the radii), the page in the overview listsmre
  • 9197159fTake components e54f83a: table lines and one-row desktop toolbar in the theme, Table button gates, a table in the md-editor demomre
  • e6322a44UX: report and LOG linemre
  • 58c2da6fUX: nav marker without bars; chat composer is one box (files-upload pick mode, showcase); comments state footer + closer reactions row; modal footer rule only for its own footer; gates for all of itmre
  • 956f107async components.hybriel 4922f9c: 44 px targets in month-view, date-picker, range-picker, pagination, modal, comments; names follow <html lang> (English default), UTC weekday fix; gate: 390 px target checks, 'edited' hit-area padding; comments showcase 'You are' is a labelled group (SY)mre
  • 49940371sessions last 99 years (creator 2026-10-23: logins never expire; only sign out ends them)mre
  • 6f7bd392gate: the phone toolbar is two even rows (E2)mre
  • 3049c082sync components.hybriel 214c318: MdEditor on a phone, two even toolbar rows of 44 px targets, label 15 px, table head 16 px (E2)mre
  • b9a3f85fLOG: MLmre
  • 7979397creport ML-mobilemre