gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitf3d61711f3d61711mission 022 WIP: tickets on the layouts theme (dbe3de7): AppHeader/MainMenu/UserMenu/Sidebar/ContentFirst shell, styles reduced to the app's own, check-theme in the gates, 390 audit + real-Chrome walk scriptmref3d61711/lib/import.hl

2.4 KB

  1. // lib/import.hl — the AntColony ticket file format (the import's parser), shared by tools/import.hl and the one-off
  2. // tools/fix-import-summaries.hl. Statics only (no top-level work: importing it runs nothing).
  3. //
  4. // A ticket file is `project:` and `subject:` header lines, a blank line, the summary.
  5. // The summary is HARD-WRAPPED text: lines are joined into paragraphs (one space between
  6. // them), a blank line starts a new paragraph, a list line starts a new line; paragraphs are separated by one empty line
  7. // ("\n\n") in the stored summary, which the ticket page renders with `white-space: pre-wrap`.
  8. // CRLF files work: every line is trim()med, which drops the carriage return. (Hybriel
  9. // strings have no escapes — "\r" would be two characters, so there is no CR constant.)
  10. static NL = "
  11. "
  12. // A MARKDOWN LIST LINE (`- `, `* `, `1. ` after trimming) stays its own line (ticket #15):
  13. // it starts a new line inside the paragraph ("\n"); a following ordinary line is still
  14. // joined onto it (a wrapped list item). Nested indentation is not kept.
  15. static isListLine = (line) => {
  16. if (line.startsWith('- ') || line.startsWith('* ')) { return true }
  17. let i = 0
  18. while (i < line.length && line.charCodeAt(i) >= 48 && line.charCodeAt(i) <= 57) { i = i + 1 }
  19. return i > 0 && line.slice(i, i + 2) == '. '
  20. }
  21. // hard-wrapped text → paragraphs joined by "\n\n" (list lines inside one by "\n")
  22. static paragraphsOf = (text) => {
  23. paras = []
  24. let cur = []
  25. for (raw of text.split(NL)) {
  26. let line = raw.trim()
  27. if (line == '') {
  28. if (cur.length > 0) { paras.push(cur.join(NL)) }
  29. cur = []
  30. } else if (cur.length == 0 || isListLine(line)) {
  31. cur.push(line)
  32. } else {
  33. cur[cur.length - 1] = cur[cur.length - 1] + ' ' + line
  34. }
  35. }
  36. if (cur.length > 0) { paras.push(cur.join(NL)) }
  37. return paras.join(NL + NL)
  38. }
  39. // { project, subject, summary } or { error }
  40. static parse = (text) => {
  41. lines = text.split(NL)
  42. head = {}
  43. let i = 0
  44. while (i < lines.length && lines[i].trim() != '') {
  45. let line = lines[i]
  46. let c = line.indexOf(':')
  47. if (c > 0) { head[line.slice(0, c).trim().toLowerCase()] = line.slice(c + 1).trim() }
  48. i = i + 1
  49. }
  50. body = []
  51. i = i + 1
  52. while (i < lines.length) {
  53. body.push(lines[i])
  54. i = i + 1
  55. }
  56. if (head.project == null || head.project == '') { return { error = 'no project: line' } }
  57. if (head.subject == null || head.subject == '') { return { error = 'no subject: line' } }
  58. return { project = head.project subject = head.subject summary = paragraphsOf(body.join(NL)) }
  59. }

Branches

Latest commits

  • f3d61711mission 022 WIP: tickets on the layouts theme (dbe3de7): AppHeader/MainMenu/UserMenu/Sidebar/ContentFirst shell, styles reduced to the app's own, check-theme in the gates, 390 audit + real-Chrome walk scriptmre
  • 31cabfccmission 021: E2E script, report, LOG, STATUSmre
  • 6aea8683editor look: .empty rule only for p.empty, files off where tickets has no upload, state note one line, events test scrolls the editor into view; synced md-editor (components d702d76+6f27ad3); gate 377/0, events 52/0mre
  • dce6ffa6Merge branch 'w28-deflake'mre
  • 536092a1tickets (mission 019): de-flake the m016 comment clicks (B: unliked) — calmClick waits until the button stops moving; test only, no app changemre
  • 9c5fd42amission 020: attachments E2E proof (lisbeth Chrome, real-data copy), reportmre
  • 1206404fREADME attachments, report 018, LOG/STATUSmre
  • 3d9e7f3ctests: m017 gate fixes (list count, waits before delete clicks); gate 373/0mre
  • dd41d5bcre-sync components 15be2ac; mission 018mre
  • 420ad1bbtickets (mission 017 WIP, tickets#27): comment attachments — lib/attachments.hl (storage/attachments, limits, type by content, members-only GET /api/attachments/:id, delete drops, edit keeps), multipart POST …/comments (lib/multipart.hl), Respond block in FilesUpload (blocks verbatim from components w27c 1f8d79d), gate m017 checks written (not yet run); report, LOG, STATUSmre
  • a7a1380dmission brief 017mre
  • f83d9c0dtickets (mission 016): report reports/016-comments-block.md, LOG, STATUS, README gate countmre
  • eef80f55tickets (mission 016): comments through the shared Comments block (layouts#2) — edit (author, earlier versions kept), delete (author, asks; leaves one line in the history), like (members, toggle) on the server (lib/comments.hl, append-only tables), faces + API …/comments/:comment/{edit,delete,like}, push commentChanged; every run of comments is a block in place in the history; Markdown fields on the Hybriel MdEditor (shared/md-editor.js retired: it took over the block's <md-editor>); blocks copied verbatim from components.hybriel 9db927d (tools/sync-components.sh); gates browser 351/0 (old 326/0), events 52/0 (old 52/0)mre
  • eb7aeeb9mission brief 016mre
  • e4c34759paths: projects moved into /media/STORAGE/projects/WorldAPI/mre
  • 26efb23freport w6-events (events test)mre
  • c6bfab04mission 015: re-vendor Hybriel 0f396652 (static build), reportmre
  • b7ec5981mission brief 015mre
  • 5dc68731docker-compose: init: true (hybriel#156, PID 1 ignored SIGTERM, every restart waited 10 s)mre
  • 8a460b16mission 014: Apollo's 'stream opened right after the start gets no live events' is not a tickets bug — events.mjs checks early streamsmre