gitoria

calendar

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitb37cc1dab37cc1da|||PR Vendor Hybriel day59Atlasb37cc1da/components/month-view/month-view.hl

41.2 KB

  1. // month-view.hl — THE MONTH VIEW: prev / next buttons on top, the month's name and the year between them, the
  2. // days below (weeks start on Monday; the days of the neighbouring months are dimmed; today is marked).
  3. // THE CALENDAR'S COPY of the pure-Hybriel month view of components.hybriel.worldapi.org (no .js), plus the user's
  4. // events on the days and the editor for them (add: click a day; edit / delete: click an event). Events come from
  5. // events.hl, one server round trip per change (faces calLoad / calSave / calDelete in calendar.hl). The date
  6. // arithmetic is written here (plain integers), so it runs the same on the server (first render) and in the browser.
  7. // What only the browser knows — today in the user's time zone, the month and weekday names in the user's language,
  8. // the time zone's name (`Date` and `Intl` are browser globals of View handlers) — is read the moment the pointer, a
  9. // finger or the keyboard reaches the month view; until then the server's UTC date and language-neutral names (month number, dots) show — the server never knows
  10. // the language, so it never guesses one: names appear once, in the browser's language, and stay.
  11. // The page reads `year` and `month` (1–12) as its own members. USE ONE PER PAGE: a composed component's
  12. // members are the page's state (COMPONENTS.md §12).
  13. import { serverToday } from './clock.hl'
  14. import { pad, daysIn, before } from './dates.hl'
  15. import { namesFor } from './names.hl'
  16. import { userIdOfSession } from '../../lib/users.hl'
  17. import { eventsBetween, upcoming } from '../../lib/events.hl'
  18. import { defaultsOf } from '../../lib/settings.hl'
  19. import { pushConfigured } from '../../lib/util.hl'
  20. import { notify, subscribePush } from 'hl:web'
  21. import { plan, missed, shift, describe, withIndex, defaultRows } from './reminders.hl'
  22. // the request's Accept-Language, handed in by the page (calendar.hl reads it from `headers`, hybriel #105): the first
  23. // render already writes the names
  24. acceptLanguage = null
  25. Hybrid known = namesFor(acceptLanguage)
  26. Boolean namesKnown = known != null
  27. String today = serverToday()
  28. Number year = toNumber(today.slice(0, 4))
  29. Number month = toNumber(today.slice(5, 7))
  30. Hybrid monthNames = namesKnown ? known.months : ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
  31. Hybrid weekdayNames = namesKnown ? known.days : ['·', '·', '·', '·', '·', '·', '·']
  32. String title = monthNames[month - 1] + ' ' + year
  33. Hybrid base = build(year, month, today)
  34. Hybrid weekdays = weekdayNames
  35. session = null
  36. userId = userIdOfSession(session)
  37. Boolean signedIn = userId != null
  38. String winFirst = base[0].date
  39. String winLast = base[41].date
  40. Hybrid events = signedIn ? eventsBetween(userId, winFirst, winLast) : []
  41. Hybrid days = fill(base, events)
  42. // the reminders (ticket calendar#4): the events of the next days with the reminders that apply (`soon`, kept with the page
  43. // state, so an offline page still knows them), the calendar's defaults in words, the timers the browser holds
  44. Hybrid soon = signedIn ? upcoming(userId, shift(today, -2), shift(today, 9)) : []
  45. String defaultText = signedIn ? describe(defaultsOf(userId)) : ''
  46. Hybrid defRows = signedIn ? defaultsOf(userId) : []
  47. Boolean fCustom = false
  48. Hybrid remRows = []
  49. Hybrid setRows = []
  50. Hybrid timers = []
  51. Number lastArm = 0
  52. // P1: arm() is called from several places at once (page load, pageshow, visibilitychange, the server's answer); its notify calls wait
  53. // for the browser, so a second run started in between showed the same missed reminder again and left timers behind. One at a time.
  54. Number arming = 0
  55. Number armAgain = 0
  56. String notifyState = 'unknown'
  57. String setError = ''
  58. String askClass = 'hidden'
  59. String blockedClass = 'hidden'
  60. String plannedText = ''
  61. String pushText = ''
  62. Boolean pushTried = false
  63. Boolean pushAvailable = pushConfigured
  64. String pushOffClass = 'hidden'
  65. Boolean pushIsOff = false
  66. Boolean pushOn = false
  67. String fId = ''
  68. String fTitle = ''
  69. Boolean fAllDay = false
  70. String fStartDate = ''
  71. String fStartTime = '09:00'
  72. String fEndDate = ''
  73. String fEndTime = '10:00'
  74. String fPlace = ''
  75. String fNotes = ''
  76. String fZone = 'UTC'
  77. String formClass = 'closed'
  78. String formError = ''
  79. String formHeading = 'New event'
  80. Boolean isNew = true
  81. String formKind = 'timed'
  82. String ownClass = 'quiet'
  83. String calClass = ''
  84. String defaultClass = ''
  85. String rowsClass = 'hidden'
  86. String addClass = 'quiet hidden'
  87. String timedButton = ''
  88. String alldayButton = 'quiet'
  89. String deleteClass = 'danger hidden'
  90. String prevLabel = namesKnown ? known.prev : '‹'
  91. String nextLabel = namesKnown ? known.next : '›'
  92. Number seen = 0
  93. Number paged = 0
  94. // 0 = Monday … 6 = Sunday (Sakamoto's method gives 0 = Sunday)
  95. weekdayOf(Number y, Number m, Number d) {
  96. t = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4]
  97. yy = m < 3 ? y - 1 : y
  98. sun = (yy + (yy - yy % 4) / 4 - (yy - yy % 100) / 100 + (yy - yy % 400) / 400 + t[m - 1] + d) % 7
  99. return (sun + 6) % 7
  100. }
  101. // 42 days (six weeks of seven), so the view keeps its height from month to month
  102. build(Number y, Number m, String todayText) {
  103. py = m == 1 ? y - 1 : y
  104. pm = m == 1 ? 12 : m - 1
  105. ny = m == 12 ? y + 1 : y
  106. nm = m == 12 ? 1 : m + 1
  107. lead = weekdayOf(y, m, 1)
  108. n = daysIn(y, m)
  109. pn = daysIn(py, pm)
  110. out = []
  111. let day = 1 - lead
  112. let w = 0
  113. while (w < 6) {
  114. let i = 0
  115. while (i < 7) {
  116. let cy = y
  117. let cm = m
  118. let cd = day
  119. let cls = ''
  120. if (day < 1) { cy = py cm = pm cd = pn + day cls = 'outside' }
  121. if (day > n) { cy = ny cm = nm cd = day - n cls = 'outside' }
  122. date = cy + '-' + pad(cm) + '-' + pad(cd)
  123. if (date == todayText) { cls = 'today' }
  124. out.push({ n = cd date = date cls = cls })
  125. day = day + 1
  126. i = i + 1
  127. }
  128. w = w + 1
  129. }
  130. return out
  131. }
  132. // the events that touch a day, as four chips on the day cell (a nested `for` does not repaint when the outer list is
  133. // reassigned: hybriel #86 — so the chips are fixed members of the day: t = text, c = class, v = event id).
  134. // Timed events start with their time on the first day. More than four: the fourth chip says "+N more".
  135. fill(Hybrid list, Hybrid evs) {
  136. out = []
  137. let i = 0
  138. while (i < list.length) {
  139. d = list[i]
  140. hit = []
  141. let j = 0
  142. while (j < evs.length) {
  143. e = evs[j]
  144. if (!before(d.date, e.first) && !before(e.last, d.date)) { hit.push(e) }
  145. j = j + 1
  146. }
  147. row = { n = d.n date = d.date cls = d.cls addLabel = 'Add event on ' + d.date }
  148. let k = 0
  149. while (k < 4) {
  150. let text = ''
  151. let cls = 'unused'
  152. let id = ''
  153. if (k < hit.length && (hit.length <= 4 || k < 3)) {
  154. e = hit[k]
  155. text = (e.allDay || d.date != e.first ? '' : e.startTime + ' ') + e.title
  156. cls = 'event'
  157. id = e.id
  158. }
  159. if (k == 3 && hit.length > 4) { text = '+' + (hit.length - 3) + ' more' cls = 'more' }
  160. row['t' + k] = text
  161. row['c' + k] = cls
  162. row['v' + k] = id
  163. k = k + 1
  164. }
  165. out.push(row)
  166. i = i + 1
  167. }
  168. return out
  169. }
  170. // the form's fields for a new event on `date` (all text; allDay a Boolean); zone = the browser's time zone name
  171. blank(String date, String zone) {
  172. return { id = '' title = '' allDay = false startDate = date startTime = '09:00' endDate = date endTime = '10:00' place = '' notes = '' zone = zone custom = false rows = [] }
  173. }
  174. show(Number y, Number m, Hybrid evs) {
  175. year = y
  176. month = m
  177. title = monthNames[m - 1] + ' ' + y
  178. base = build(y, m, today)
  179. winFirst = base[0].date
  180. winLast = base[41].date
  181. events = evs
  182. days = fill(base, evs)
  183. }
  184. // Layout only (mission 006): the theme (theme/theme.hl, `html month-view …`) tiles the day cells and takes the frames and radii away, buttons
  185. // and fields come from the theme (44 px taps, 16 px fields). Colours: the semantic WorldAPI tokens as css variables, each with its palette
  186. // value as fallback (a component's browser module cannot import tokens.hl itself); the app sets --color-accent in its styles.hl.
  187. // PHONE FIRST: a day cell has no side padding (its event chips are 44 px tall and as wide as the cell); the wide layout is from 60rem.
  188. Style {
  189. monthView { display = 'grid' gap = '.5rem'
  190. header { display = 'flex' flexWrap = 'wrap' alignItems = 'center' justifyContent = 'space-between' gap = '.5rem'
  191. // sync of components.hybriel 4922f9c (MC): the prev / next buttons are 44 px targets on any width (the theme gave 36 px high at 1280)
  192. button { minWidth = '2.75rem' minHeight = '2.75rem' }
  193. }
  194. // calendar#14: on a phone the month name and the Reminder settings button did not fit in one row, so the name broke into two lines
  195. // ("Oktobe / r 2026"). The name never breaks; the button drops to its own row on the right when the row is too narrow.
  196. '#settings-open' { marginLeft = 'auto' }
  197. h2 { margin = '0' fontSize = '1.1rem' color = 'var(--color-text-strong, rgb(245, 250, 255))' textAlign = 'center' flex = '1 1 auto' whiteSpace = 'nowrap' textTransform = 'capitalize' }
  198. '.hidden' { display = 'none' }
  199. }
  200. // the 7-column grid is the weekday row's and the days' only: it used to be `month-view ol`, so it also caught the reminder
  201. // lists (the settings dialog's rows stood in 7 narrow columns, calendar#11)
  202. '#month-weekdays, #month-days' { display = 'grid' gridTemplateColumns = 'repeat(7, minmax(0, 1fr))' margin = '0' padding = '0' listStyle = 'none' }
  203. '#month-weekdays' {
  204. li { margin = '0' padding = '.3rem 0' fontSize = '.8rem' fontWeight = '600' color = 'var(--color-text-muted, rgb(145, 150, 155))' textAlign = 'center' }
  205. }
  206. '#month-days' {
  207. li {
  208. position = 'relative'
  209. minHeight = '3.5rem'
  210. margin = '0'
  211. padding = '.2rem 0'
  212. textAlign = 'right'
  213. background = 'var(--color-surface, rgb(35, 40, 45))'
  214. cursor = 'pointer'
  215. overflow = 'hidden'
  216. }
  217. // The add action covers the cell; the date stays visible above it.
  218. 'button.day-add' {
  219. position = 'absolute'
  220. inset = '0'
  221. width = '100%'
  222. height = '100%'
  223. minWidth = '0'
  224. minHeight = '0'
  225. padding = '0'
  226. border = '0'
  227. borderRadius = '0'
  228. background = 'transparent'
  229. focusVisible {
  230. outline = '2px solid var(--color-accent)'
  231. outlineOffset = '-2px'
  232. }
  233. }
  234. time {
  235. pointerEvents = 'none'
  236. position = 'relative'
  237. display = 'block'
  238. paddingRight = '.25rem'
  239. color = 'var(--color-text, rgb(195, 200, 205))'
  240. fontSize = '.95rem'
  241. }
  242. 'li.outside' { background = 'var(--color-background, rgb(25, 30, 35))'
  243. time { color = 'var(--color-text-muted, rgb(145, 150, 155))' }
  244. }
  245. 'li.today' { outline = '2px solid var(--color-accent, #569bd4)' outlineOffset = '-2px'
  246. time { color = 'var(--color-accent, #569bd4)' fontWeight = '800' }
  247. }
  248. }
  249. // the notifications section of the reminder settings: the state in words, then one full-width button per action (44 px taps)
  250. notifyBox { display = 'grid' gap = '.5rem'
  251. h3 { margin = '0' fontSize = '.85rem' fontWeight = '600' color = 'var(--color-text-muted, rgb(145, 150, 155))' }
  252. p { margin = '0' fontSize = '.85rem' color = 'var(--color-text-muted, rgb(145, 150, 155))'
  253. empty { display = 'none' }
  254. }
  255. button { width = '100%' }
  256. }
  257. reminderBox { display = 'grid' gap = '.4rem'
  258. h3 { margin = '0' fontSize = '.85rem' fontWeight = '600' color = 'var(--color-text-muted, rgb(145, 150, 155))' }
  259. p { margin = '0' fontSize = '.85rem' color = 'var(--color-text-muted, rgb(145, 150, 155))' }
  260. }
  261. // the reminder lists (the event's own, the calendar's defaults): one row per reminder, the full width
  262. '#rem-rows, #set-rows' { display = 'grid' gridTemplateColumns = 'minmax(0, 1fr)' gap = '.5rem' margin = '0' padding = '0' listStyle = 'none' }
  263. // PHONE: a reminder is `[number] [unit, the rest of the width] [×]` and, for "days before, at", the time under them; every
  264. // field is at least a tap (2.75rem) high (the theme); the unit's select takes the width the number and × leave
  265. reminderRow { display = 'grid' gridTemplateColumns = '5rem minmax(0, 1fr) 2.75rem' alignItems = 'center' gap = '.4rem'
  266. input { minWidth = '0' width = '100%' }
  267. select { minWidth = '0' width = '100%' gridColumn = '2' }
  268. 'input[type=time]' { gridColumn = '1 / 3' }
  269. button { gridColumn = '3' gridRow = '1' minWidth = '2.75rem' minHeight = '2.75rem' padding = '0' }
  270. }
  271. 'reminder-row.other' { 'input[type=time]' { display = 'none' } }
  272. // ---- the events on the days and the editors (moved here from styles.hl, calendar#16; the markup is this file's) ----
  273. // PHONE: a cell is 48 px wide, so a chip is the cell's width and at least the tap (44 px, the theme's button size) high; its
  274. // text is cut with an ellipsis. The cell has no side padding so the chip may be that wide.
  275. dayEvents {
  276. position = 'relative'
  277. pointerEvents = 'none'
  278. display = 'grid'
  279. gap = '.15rem'
  280. marginTop = '.2rem'
  281. textAlign = 'left'
  282. }
  283. 'button.unused' { display = 'none' }
  284. 'button.hidden' { display = 'none' }
  285. 'button.event, button.more' {
  286. pointerEvents = 'auto'
  287. display = 'block'
  288. minWidth = '0'
  289. width = '100%'
  290. padding = '.15rem .2rem'
  291. overflow = 'hidden'
  292. fontSize = '.75rem'
  293. fontWeight = '500'
  294. lineHeight = '1.3'
  295. textAlign = 'left'
  296. textOverflow = 'ellipsis'
  297. whiteSpace = 'nowrap'
  298. color = 'var(--color-accent)'
  299. background = 'var(--color-background-sunken)'
  300. }
  301. 'button.more' { color = 'var(--color-text-muted)' background = 'transparent' }
  302. '#notify-ask' { color = 'var(--color-accent-text)' background = 'var(--color-accent)' }
  303. // the switches (time/all day, the event's own reminders or the calendar's): the chosen one is the accent, the other `quiet`
  304. kindSwitch { display = 'flex' flexWrap = 'wrap' gap = '.5rem'
  305. 'button:not(.quiet)' { color = 'var(--color-accent-text)' background = 'var(--color-accent)' }
  306. }
  307. formButtons { display = 'flex' flexWrap = 'wrap' gap = '.5rem'
  308. 'button.danger' { marginLeft = 'auto' }
  309. }
  310. // the editors (event, reminder settings): a full-page scrim with one panel
  311. eventEditor { position = 'fixed' inset = '0' zIndex = '40' display = 'grid' placeItems = 'center' padding = '1rem' background = 'color-mix(in srgb, var(--color-background-sunken) 82%, transparent)'
  312. form { display = 'grid' gap = '.7rem' width = '100%' maxWidth = '28rem' maxHeight = '100%' overflowY = 'auto' padding = '1rem' background = 'var(--color-surface)' borderRadius = 'var(--radius-large)' }
  313. h2 { margin = '0' }
  314. label { display = 'grid' gap = '.2rem' margin = '0' fontSize = '.85rem' fontWeight = '400' color = 'var(--color-text-muted)' }
  315. input { width = '100%' color = 'var(--color-text-strong)' }
  316. textarea { width = '100%' color = 'var(--color-text-strong)' }
  317. }
  318. 'event-editor.closed' { display = 'none' }
  319. // the settings dialog is a popover (top layer): the browser's popover defaults (fit-content box, border, margin) give way to the full-page scrim
  320. 'event-editor[popover]' { width = '100%' height = '100%' maxWidth = 'none' maxHeight = 'none' margin = '0' border = '0' overflow = 'hidden' color = 'var(--color-text)' }
  321. 'event-editor[popover]:not(:popover-open)' { display = 'none' }
  322. fieldRow { display = 'grid' gridTemplateColumns = 'minmax(0, 1fr) minmax(0, 1fr)' gap = '.5rem' }
  323. 'form.allday' { 'label.timed' { display = 'none' }
  324. fieldRow { gridTemplateColumns = 'minmax(0, 1fr)' }
  325. }
  326. '@media (min-width: 60rem)' {
  327. // the desktop's chips are small on purpose (a pointer; four of them stand in one cell): under 44 px, deliberately
  328. 'button.event, button.more' { minHeight = '0' padding = '.05rem .3rem' borderRadius = 'var(--radius-small)' }
  329. '#month-days' { li { minHeight = '5rem' padding = '.3rem' } }
  330. // the editor's panel is 28rem wide there: the time stands in the row's line again
  331. reminderRow { gridTemplateColumns = '5rem minmax(0, 1fr) 7.5rem 2.75rem'
  332. 'input[type=time]' { gridColumn = '3' }
  333. button { gridColumn = '4' }
  334. }
  335. 'reminder-row.other' { select { gridColumn = '2 / 4' } }
  336. }
  337. }
  338. View {
  339. monthView { on pointerover(e) { emit monthEnv(e) } on focusin(e) { emit monthEnv(e) } on touchstart(e) { emit monthEnv(e) }
  340. header {
  341. button { id = "month-prev" type = "button" class = "quiet" title = prevLabel "‹" on click(e) { emit monthPrev(e) } }
  342. h2 { id = "month-title" title }
  343. button { id = "month-next" type = "button" class = "quiet" title = nextLabel "›" on click(e) { emit monthNext(e) } } if (signedIn) { button { id = "settings-open" type = "button" class = "quiet" popovertarget = "settingseditor" popovertargetaction = "show" "Reminder settings" } }
  344. }
  345. ol { id = "month-weekdays" for (name of weekdays) { li { name } } }
  346. ol { id = "month-days"
  347. for (d of days) {
  348. li { class = d.cls
  349. if (signedIn) { button { type = "button" class = "day-add" 'aria-label' = d.addLabel on click() { addDay(d.date) } } }
  350. time { datetime = d.date d.n }
  351. dayEvents {
  352. button { class = d.c0 type = "button" value = d.v0 d.t0 on click() { pickEvent(d.v0, d.date) } }
  353. button { class = d.c1 type = "button" value = d.v1 d.t1 on click() { pickEvent(d.v1, d.date) } }
  354. button { class = d.c2 type = "button" value = d.v2 d.t2 on click() { pickEvent(d.v2, d.date) } }
  355. button { class = d.c3 type = "button" value = d.v3 d.t3 on click() { pickEvent(d.v3, d.date) } }
  356. }
  357. }
  358. }
  359. }
  360. eventEditor { id = "eventeditor" class = formClass
  361. form { id = "eventform" class = formKind
  362. on submit(e) {
  363. e.preventDefault()
  364. emit saveEvent(e)
  365. }
  366. h2 { id = "formheading" formHeading }
  367. kindSwitch {
  368. button { id = "kind-timed" type = "button" class = timedButton "At a time" on click(e) { emit setKind(false) } }
  369. button { id = "kind-allday" type = "button" class = alldayButton "All day" on click(e) { emit setKind(true) } }
  370. }
  371. label { "Title"
  372. input { id = "f-title" name = "title" maxlength = "200" autocomplete = "off" required = "required" value = fTitle on input(e) { emit setF('title', e.target.value) } }
  373. }
  374. fieldRow {
  375. label { "From"
  376. input { id = "f-startdate" name = "startDate" type = "date" required = "required" value = fStartDate on input(e) { emit setF('startDate', e.target.value) } }
  377. }
  378. label { class = "timed" "at"
  379. input { id = "f-starttime" name = "startTime" type = "time" value = fStartTime on input(e) { emit setF('startTime', e.target.value) } }
  380. }
  381. }
  382. fieldRow {
  383. label { "To"
  384. input { id = "f-enddate" name = "endDate" type = "date" value = fEndDate on input(e) { emit setF('endDate', e.target.value) } }
  385. }
  386. label { class = "timed" "at"
  387. input { id = "f-endtime" name = "endTime" type = "time" value = fEndTime on input(e) { emit setF('endTime', e.target.value) } }
  388. }
  389. }
  390. label { "Place"
  391. input { id = "f-place" name = "place" maxlength = "200" autocomplete = "off" value = fPlace on input(e) { emit setF('place', e.target.value) } }
  392. }
  393. label { "Notes"
  394. textarea { id = "f-notes" name = "notes" rows = "4" maxlength = "5000" value = fNotes on input(e) { emit setF('notes', e.target.value) } }
  395. }
  396. reminderBox {
  397. h3 { "Reminders" }
  398. kindSwitch {
  399. button { id = "rem-calendar" type = "button" class = calClass "Calendar's" on click(e) { emit setCustom(false) } }
  400. button { id = "rem-own" type = "button" class = ownClass "Own" on click(e) { emit setCustom(true) } }
  401. }
  402. p { id = "rem-default-text" class = defaultClass defaultText }
  403. ol { id = "rem-rows" class = rowsClass
  404. for (r of remRows) {
  405. reminderRow { class = r.cls
  406. input { type = "number" min = "0" value = r.n on change(e) { emit setRem('rem', r.i, 'n', e.target.value) } }
  407. select { value = r.unit on change(e) { emit setRem('rem', r.i, 'unit', e.target.value) }
  408. option { value = "minutes" "minutes before" }
  409. option { value = "hours" "hours before" }
  410. option { value = "days" "days before, at" }
  411. }
  412. input { type = "time" value = r.time on change(e) { emit setRem('rem', r.i, 'time', e.target.value) } }
  413. button { type = "button" class = "quiet" "×" on click(e) { emit delRem('rem', r.i) } }
  414. }
  415. }
  416. }
  417. button { id = "rem-add" type = "button" class = addClass "Add reminder" on click(e) { emit addRem('rem') } }
  418. }
  419. p { id = "formerror" class = "message" formError }
  420. formButtons {
  421. button { id = "event-save" type = "submit" "Save" }
  422. button { id = "event-cancel" type = "button" class = "quiet" "Cancel" on click(e) { emit closeForm(e) } }
  423. button { id = "event-delete" type = "button" class = deleteClass "Delete" on click(e) { emit deleteEvent(e) } }
  424. }
  425. }
  426. }
  427. eventEditor { id = "settingseditor" popover = "manual" on toggle(e) { emit settingsToggled(e) } on keydown(e) { emit settingsKey(e) }
  428. form { id = "settingsform" class = "timed"
  429. on submit(e) {
  430. e.preventDefault()
  431. emit saveSettings(e)
  432. }
  433. h2 { "Reminder settings" }
  434. notifyBox {
  435. h3 { "Notifications on this device" }
  436. p { id = "notify-blocked" class = blockedClass "Notifications are blocked for this site in the browser settings." }
  437. p { id = "notify-planned" plannedText }
  438. p { id = "push-state" pushText }
  439. button { id = "notify-ask" type = "button" class = askClass "Turn on notifications" on click(e) { emit askNotify(e) } }
  440. button { id = "push-test" type = "button" class = pushOffClass "Send a test notification" on click(e) { emit pushTest(e) } }
  441. button { id = "push-off" type = "button" class = pushOffClass "Turn off on this device" on click(e) { emit pushOff(e) } }
  442. }
  443. reminderBox {
  444. h3 { "Default reminders" }
  445. p { class = "muted" "Every event without reminders of its own is reminded like this:" }
  446. ol { id = "set-rows"
  447. for (r of setRows) {
  448. reminderRow { class = r.cls
  449. input { type = "number" min = "0" value = r.n on change(e) { emit setRem('set', r.i, 'n', e.target.value) } }
  450. select { value = r.unit on change(e) { emit setRem('set', r.i, 'unit', e.target.value) }
  451. option { value = "minutes" "minutes before" }
  452. option { value = "hours" "hours before" }
  453. option { value = "days" "days before, at" }
  454. }
  455. input { type = "time" value = r.time on change(e) { emit setRem('set', r.i, 'time', e.target.value) } }
  456. button { type = "button" class = "quiet" "×" on click(e) { emit delRem('set', r.i) } }
  457. }
  458. }
  459. }
  460. button { id = "set-add" type = "button" class = "quiet" "Add reminder" on click(e) { emit addRem('set') } }
  461. }
  462. p { id = "settingserror" class = "message" setError }
  463. formButtons {
  464. button { id = "set-save" type = "submit" "Save" }
  465. button { id = "set-cancel" type = "button" class = "quiet" popovertarget = "settingseditor" popovertargetaction = "hide" autofocus = "autofocus" "Cancel" }
  466. }
  467. }
  468. }
  469. input { id = "month-view-goto" type = "hidden" on change(e) { emit monthGoto(e.target.value) } }
  470. }
  471. }
  472. // the events of the six weeks shown, from the server (none while signed out)
  473. loadEvents(Number y, Number m) {
  474. if (!signedIn) { return [] }
  475. b = build(y, m, today)
  476. r = emit server calLoad(b[0].date, b[41].date)
  477. if (r != null && r.soon != null) { takeSoon(r) }
  478. return r == null || r.events == null ? [] : r.events
  479. }
  480. on monthPrev(Hybrid e) {
  481. browserEnv()
  482. paged = 1
  483. y = month == 1 ? year - 1 : year
  484. m = month == 1 ? 12 : month - 1
  485. show(y, m, loadEvents(y, m))
  486. }
  487. on monthNext(Hybrid e) {
  488. browserEnv()
  489. paged = 1
  490. y = month == 12 ? year + 1 : year
  491. m = month == 12 ? 1 : month + 1
  492. show(y, m, loadEvents(y, m))
  493. }
  494. // the browser's today, language and time zone, once: today follows the user's time zone, the names their language
  495. on monthEnv(Hybrid e) {
  496. browserEnv()
  497. // every ten minutes of use the timers are set again (a long-open page keeps the next week planned)
  498. if (signedIn && Date.now() - lastArm > 600000) { arm() }
  499. }
  500. // the device's IANA time zone, read from the browser each time (arm can run before the first pointer set fZone)
  501. deviceZone() {
  502. z = Intl.DateTimeFormat().resolvedOptions().timeZone
  503. return z != null && z != '' ? z : 'UTC'
  504. }
  505. browserEnv() {
  506. if (seen == 1) { return null }
  507. seen = 1
  508. serverDay = today
  509. now = new Date()
  510. lang = navigator.language != null ? navigator.language : 'en'
  511. zone = Intl.DateTimeFormat().resolvedOptions().timeZone
  512. browserDay = ('' + (10000 + now.getFullYear())).slice(1) + '-' + pad(now.getMonth() + 1) + '-' + pad(now.getDate())
  513. if (browserDay != serverDay) { today = browserDay }
  514. // the server already wrote the names of a language it knows: they stay, so paging never switches them
  515. if (!namesKnown) {
  516. mf = Intl.DateTimeFormat(lang, { month = 'long' timeZone = 'UTC' })
  517. df = Intl.DateTimeFormat(lang, { weekday = 'short' timeZone = 'UTC' })
  518. ms = []
  519. ds = []
  520. let i = 0
  521. while (i < 12) { ms.push(mf.format(new Date(Date.UTC(2024, i, 15, 12)))) i = i + 1 }
  522. i = 0
  523. while (i < 7) { ds.push(df.format(new Date(Date.UTC(2024, 0, 1 + i, 12)))) i = i + 1 }
  524. // (only what differs is assigned: a same-valued assignment still repaints the title and the days)
  525. if (ms.join('|') != monthNames.join('|')) { monthNames = ms }
  526. if (ds.join('|') != weekdayNames.join('|')) { weekdayNames = ds weekdays = ds }
  527. de = lang.slice(0, 2) == 'de'
  528. pl = de ? 'Voriger Monat' : 'Previous month'
  529. nl = de ? 'Nächster Monat' : 'Next month'
  530. if (pl != prevLabel) { prevLabel = pl }
  531. if (nl != nextLabel) { nextLabel = nl }
  532. }
  533. fZone = zone != null && zone != '' ? zone : 'UTC'
  534. readPermission()
  535. // calendar#9: a phone freezes or drops an app it switched away from, and its timers with it. Whenever the app is
  536. // shown again the timers are set again, and what came due meanwhile is shown at once (arm → missed)
  537. document.addEventListener('visibilitychange', () => { if (document.visibilityState == 'visible') { arm() } })
  538. window.addEventListener('pageshow', () => { arm() })
  539. // Nothing is repainted unless the browser's day is not the server's: the server already drew this month with its events,
  540. // and a round trip here, answered while the user pages or taps a day, used to put the month back or swallow the tap.
  541. if (browserDay == serverDay) {
  542. if (!namesKnown) {
  543. named = monthNames[month - 1] + ' ' + year
  544. if (named != title) { title = named }
  545. }
  546. } else if (paged == 0) {
  547. // the month shown follows the corrected today only while the user has not paged yet (also when they page meanwhile)
  548. y = toNumber(today.slice(0, 4))
  549. m = toNumber(today.slice(5, 7))
  550. evs = loadEvents(y, m)
  551. if (paged == 0) { show(y, m, evs) } else { show(year, month, events) }
  552. } else { show(year, month, events) }
  553. // (offline the server did not answer: the timers are set from the reminders the page already holds)
  554. arm()
  555. }
  556. // ---- the reminders: notifications the browser holds a timer for (they fire while the app or its worker is open, also offline) ----
  557. // the server's newest answer about the reminders to come; the timers are set again from it
  558. takeSoon(Hybrid r) {
  559. soon = r.soon
  560. if (r.defaults != null) { defaultText = r.defaults }
  561. if (r.defaultRows != null) { defRows = r.defaultRows }
  562. arm()
  563. }
  564. // one timer per reminder that is still to come within a week; the old timers are dropped first. Before that, calendar#9:
  565. // the reminders that came due since this device last planned or showed one, while no timer could fire (the app switched
  566. // away and frozen, dropped, or closed), are shown now — late, for events that have not started yet
  567. arm() {
  568. if (arming == 1) {
  569. armAgain = 1
  570. return null
  571. }
  572. arming = 1
  573. armOnce()
  574. while (armAgain == 1) {
  575. armAgain = 0
  576. armOnce()
  577. }
  578. arming = 0
  579. return null
  580. }
  581. armOnce() {
  582. if (!signedIn) { return null }
  583. let i = 0
  584. while (i < timers.length) { clearTimeout(timers[i]) i = i + 1 }
  585. nowMs = Date.now()
  586. readPermission()
  587. let since = remindedUntil(nowMs)
  588. if (notifyState == 'granted') {
  589. since = pushedSince(since)
  590. late = missed(soon, since, nowMs, today, deviceZone())
  591. i = 0
  592. while (i < late.length) {
  593. q = late[i]
  594. notify(q.title, { body = q.late tag = q.key icon = '/icons/icon-192.png' })
  595. i = i + 1
  596. }
  597. }
  598. remember(nowMs)
  599. list = plan(soon, nowMs, 604800000, deviceZone())
  600. ids = []
  601. i = 0
  602. while (i < list.length) {
  603. // `p` is a new binding on every pass (hybriel #106): each timer keeps ITS reminder
  604. p = list[i]
  605. ids.push(setTimeout(() => {
  606. remember(p.at)
  607. notify(p.title, { body = p.body tag = p.key icon = '/icons/icon-192.png' })
  608. }, p.at - nowMs))
  609. i = i + 1
  610. }
  611. timers = ids
  612. lastArm = nowMs
  613. // calendar#9 part 2: a device that already allowed notifications is subscribed to Web Push once per page (its own handler:
  614. // the browser's subscribe can take long and must not hold the timers)
  615. if (!pushTried && notifyState == 'granted') {
  616. pushTried = true
  617. emit pushEnsure(1)
  618. }
  619. plannedText = list.length == 0 ? '' : (list.length == 1 ? '1 reminder' : list.length + ' reminders') + ' set for the next 7 days'
  620. }
  621. // P1: a device with push gets its reminders from the server, even when the page is closed. A reminder the server pushed
  622. // (shown, tapped, swiped away) must not be shown again by this page as "missed": the later of the page's own instant and the
  623. // server's. Without a subscription, or if the server does not answer, the page's own instant stays.
  624. pushedSince(Number own) {
  625. if (!pushAvailable || pushOffKept()) { return own }
  626. reg = navigator.serviceWorker != null ? navigator.serviceWorker.getRegistration() : null
  627. sub = reg != null && reg.pushManager != null ? reg.pushManager.getSubscription() : null
  628. if (sub == null) { return own }
  629. r = emit server calPushedUntil(sub.endpoint)
  630. return r != null && r.since != null && r.since > own ? r.since : own
  631. }
  632. // the instant up to which this device has planned or shown the user's reminders (the browser's localStorage); none
  633. // kept yet → the last 12 hours count as missed
  634. remindedKey() {
  635. return 'calendar-reminded-until-' + userId
  636. }
  637. remindedUntil(Number nowMs) {
  638. store = window.localStorage
  639. kept = store != null ? store.getItem(remindedKey()) : null
  640. return kept != null && kept != '' ? toNumber(kept) : nowMs - 43200000
  641. }
  642. remember(Number at) {
  643. store = window.localStorage
  644. if (store == null) { return null }
  645. kept = store.getItem(remindedKey())
  646. if (kept == null || kept == '' || toNumber(kept) < at) { store.setItem(remindedKey(), '' + at) }
  647. }
  648. // ONE state for the notification section (C13): `pushOn` (this device is subscribed to push) and `notifyState` / `pushIsOff` decide
  649. // every control at once — "Turn on" only while not on, test + off only while on, the blocked hint only when blocked
  650. readPermission() {
  651. n = window.Notification
  652. notifyState = n == null ? 'unsupported' : n.permission
  653. pushIsOff = pushOffKept()
  654. showControls()
  655. }
  656. showControls() {
  657. askClass = !pushOn && (notifyState == 'default' || (notifyState == 'granted' && pushIsOff)) ? '' : 'hidden'
  658. blockedClass = notifyState == 'denied' ? '' : 'hidden'
  659. pushOffClass = pushOn ? '' : 'hidden'
  660. if (!pushOn && notifyState == 'unsupported') { pushText = 'This browser cannot show notifications.' }
  661. if (!pushOn && pushText == '') { pushText = 'Reminders show while the calendar is open on this device.' }
  662. }
  663. // the button is the click the browser wants before it allows notifications
  664. on askNotify(Hybrid e) {
  665. browserEnv()
  666. notify('Notifications are on', { body = 'Your reminders show up here.' })
  667. pushTried = true
  668. pushOffKeep(false)
  669. readPermission()
  670. emit pushEnsure(1)
  671. }
  672. // "Turn off on this device": the browser drops its push subscription and the server forgets the device. The choice is kept
  673. // (localStorage) so that this device is not subscribed again at the next page; "Turn on notifications" undoes it.
  674. on pushOff(Hybrid e) {
  675. browserEnv()
  676. pushOffKeep(true)
  677. reg = navigator.serviceWorker != null ? navigator.serviceWorker.getRegistration() : null
  678. sub = reg != null && reg.pushManager != null ? reg.pushManager.getSubscription() : null
  679. if (sub != null) {
  680. endpoint = sub.endpoint
  681. sub.unsubscribe()
  682. emit server calPushOff(endpoint)
  683. }
  684. pushOn = false
  685. pushText = 'Reminders show while the calendar is open on this device.'
  686. readPermission()
  687. }
  688. // "Send a test notification": the server sends ONE push to this device in ~10 seconds; leave the app and it arrives like a reminder
  689. on pushTest(Hybrid e) {
  690. browserEnv()
  691. reg = navigator.serviceWorker != null ? navigator.serviceWorker.getRegistration() : null
  692. sub = reg != null && reg.pushManager != null ? reg.pushManager.getSubscription() : null
  693. if (sub == null) {
  694. pushText = 'This device is not subscribed: tap "Turn on notifications" first.'
  695. return null
  696. }
  697. r = emit server calPushTest(sub.endpoint)
  698. pushText = r != null && r.ok ? 'A test notification is on its way (about 10 seconds). Close the calendar or lock the phone now: "Calendar test - Push works on this device" should appear.' : 'The test could not be started: ' + (r != null && r.error != null ? r.error : 'no answer')
  699. }
  700. pushOffKey() {
  701. return 'calendar-push-off-' + userId
  702. }
  703. pushOffKept() {
  704. store = window.localStorage
  705. return store != null && store.getItem(pushOffKey()) == '1'
  706. }
  707. pushOffKeep(Boolean off) {
  708. store = window.localStorage
  709. if (store == null) { return null }
  710. if (off) { store.setItem(pushOffKey(), '1') } else { store.removeItem(pushOffKey()) }
  711. pushIsOff = off
  712. }
  713. // calendar#9 part 2: this device's Web Push subscription goes to the server, which sends the reminders to it when the page
  714. // is closed. No push (no key on the server, no browser support, refused) leaves the page's own timers as they were.
  715. on pushEnsure(Number n) {
  716. if (!signedIn || !pushAvailable || notifyState != 'granted' || pushOffKept()) { return null }
  717. sub = subscribePush()
  718. if (sub == null) {
  719. pushText = 'Reminders show while the calendar is open on this device.'
  720. pushOn = false
  721. showControls()
  722. return null
  723. }
  724. r = emit server calPushSave(sub, fZone)
  725. pushText = r != null && r.ok ? 'Reminders also reach this device when the calendar is closed.' : 'Reminders show while the calendar is open on this device.'
  726. pushOn = r != null && r.ok
  727. showControls()
  728. }
  729. // the page is shown (first show included): a device that already allowed notifications is subscribed / its subscription
  730. // refreshed now, not at the user's first touch
  731. on client shown(r) {
  732. browserEnv()
  733. }
  734. // from a host script (the date picker): "YYYY-MM-DD" → show that date's month
  735. on monthGoto(String text) {
  736. paged = 1
  737. y = toNumber(text.slice(0, 4))
  738. m = toNumber(text.slice(5, 7))
  739. show(y, m, loadEvents(y, m))
  740. }
  741. // ---- the editor ----
  742. // the reminders switch: the calendar's or the event's own
  743. syncCustom() {
  744. calClass = fCustom ? 'quiet' : ''
  745. ownClass = fCustom ? '' : 'quiet'
  746. defaultClass = fCustom ? 'hidden' : ''
  747. rowsClass = fCustom ? '' : 'hidden'
  748. addClass = fCustom ? 'quiet' : 'quiet hidden'
  749. }
  750. // the classes that follow the form's kind and whether it edits an existing event
  751. syncForm() {
  752. formKind = fAllDay ? 'allday' : 'timed'
  753. timedButton = fAllDay ? 'quiet' : ''
  754. alldayButton = fAllDay ? '' : 'quiet'
  755. deleteClass = isNew ? 'danger hidden' : 'danger'
  756. }
  757. openForm(Hybrid fields, String heading, Boolean fresh) {
  758. fId = fields.id
  759. fTitle = fields.title
  760. fAllDay = fields.allDay
  761. fStartDate = fields.startDate
  762. fStartTime = fields.startTime
  763. fEndDate = fields.endDate
  764. fEndTime = fields.endTime
  765. fPlace = fields.place
  766. fNotes = fields.notes
  767. isNew = fresh
  768. fCustom = fields.custom
  769. remRows = withIndex(fields.rows)
  770. syncCustom()
  771. formHeading = heading
  772. formError = ''
  773. formClass = 'open'
  774. syncForm()
  775. }
  776. // Each day and chip carries its action's date or event id from the loop record.
  777. addDay(String date) {
  778. if (!signedIn) { return null }
  779. openForm(blank(date, fZone), 'New event', true)
  780. }
  781. pickEvent(String id, String date) {
  782. if (!signedIn) { return null }
  783. // The overflow chip has always opened a new event for its day.
  784. if (id == '') { addDay(date) return null }
  785. let j = 0
  786. while (j < events.length) {
  787. ev = events[j]
  788. if (ev.id == id) {
  789. fields = { id = ev.id title = ev.title allDay = ev.allDay startDate = ev.startDate startTime = ev.startTime endDate = ev.endDate endTime = ev.endTime place = ev.place notes = ev.notes zone = fZone custom = ev.custom rows = ev.rows }
  790. openForm(fields, 'Edit event', false)
  791. return null
  792. }
  793. j = j + 1
  794. }
  795. }
  796. on setF(String name, String value) {
  797. if (name == 'title') { fTitle = value }
  798. if (name == 'startDate') { fStartDate = value }
  799. if (name == 'startTime') { fStartTime = value }
  800. if (name == 'endDate') { fEndDate = value }
  801. if (name == 'endTime') { fEndTime = value }
  802. if (name == 'place') { fPlace = value }
  803. if (name == 'notes') { fNotes = value }
  804. }
  805. on setCustom(Boolean own) {
  806. fCustom = own
  807. // switching to own reminders starts from the calendar's, so nothing has to be typed for the usual case
  808. if (own && remRows.length == 0) { remRows = withIndex(defaultRows) }
  809. syncCustom()
  810. }
  811. // one reminder row of the event editor (which = 'rem') or of the settings (which = 'set')
  812. on setRem(String which, Number i, String field, String value) {
  813. rows = which == 'rem' ? remRows : setRows
  814. if (i < 0 || i >= rows.length) { return null }
  815. out = []
  816. let k = 0
  817. while (k < rows.length) {
  818. r = rows[k]
  819. let n = r.n
  820. let unit = r.unit
  821. let time = r.time
  822. if (k == i && field == 'n') { n = value }
  823. if (k == i && field == 'unit') { unit = value }
  824. if (k == i && field == 'time') { time = value }
  825. out.push({ unit = unit n = n time = time })
  826. k = k + 1
  827. }
  828. if (which == 'rem') { remRows = withIndex(out) } else { setRows = withIndex(out) }
  829. }
  830. on addRem(String which) {
  831. rows = which == 'rem' ? remRows : setRows
  832. out = []
  833. let k = 0
  834. while (k < rows.length) { out.push({ unit = rows[k].unit n = rows[k].n time = rows[k].time }) k = k + 1 }
  835. out.push({ unit = 'minutes' n = '10' time = '09:00' })
  836. if (which == 'rem') { remRows = withIndex(out) } else { setRows = withIndex(out) }
  837. }
  838. on delRem(String which, Number i) {
  839. rows = which == 'rem' ? remRows : setRows
  840. out = []
  841. let k = 0
  842. while (k < rows.length) {
  843. if (k != i) { out.push({ unit = rows[k].unit n = rows[k].n time = rows[k].time }) }
  844. k = k + 1
  845. }
  846. if (which == 'rem') { remRows = withIndex(out) } else { setRows = withIndex(out) }
  847. }
  848. // ---- the calendar settings: the default reminders ----
  849. // the dialog is a MANUAL popover (a nested auto one would be closed with the menu that opened it; the menu's "Reminder settings" opens it declaratively, popovertarget — the menu lives in the shell, outside this
  850. // component): opening it is the event that reads the device's state and the calendar's defaults
  851. on settingsToggled(Hybrid e) {
  852. if (e.newState != 'open') { return null }
  853. // no pointer event of the month view may have come yet, so the page's browser state is read now —
  854. // the notification section is right on the first look (and a device that allowed notifications is subscribed)
  855. browserEnv()
  856. readPermission()
  857. r = emit server calSettingsLoad()
  858. if (r == null || r.error != null) {
  859. setError = r == null ? 'the settings need the server: you are offline' : r.error
  860. return null
  861. }
  862. setRows = withIndex(r.rows)
  863. setError = ''
  864. }
  865. // Escape closes it (a manual popover has no light dismiss: it must stay open when the menu, which opened it, closes)
  866. on settingsKey(Hybrid e) {
  867. if (e.key == 'Escape') { document.getElementById('settingseditor').hidePopover() }
  868. }
  869. on saveSettings(Hybrid e) {
  870. r = emit server calSettingsSave(setRows)
  871. if (r == null || r.error != null) {
  872. setError = r == null ? 'the settings could not be saved (offline?)' : r.error
  873. return null
  874. }
  875. document.getElementById('settingseditor').hidePopover()
  876. takeSoon(r)
  877. }
  878. on setKind(Boolean allDay) {
  879. fAllDay = allDay
  880. if (!allDay && fStartTime == '') { fStartTime = '09:00' }
  881. if (!allDay && fEndTime == '' && fEndDate != '') { fEndTime = '10:00' }
  882. syncForm()
  883. }
  884. on closeForm(Hybrid e) {
  885. formClass = 'closed'
  886. }
  887. // what the form holds, as the face takes it
  888. formFields() {
  889. return { id = fId title = fTitle allDay = fAllDay startDate = fStartDate startTime = fStartTime endDate = fEndDate endTime = fEndTime place = fPlace notes = fNotes zone = fZone custom = fCustom reminders = remRows }
  890. }
  891. // the event as the page shows it, for an event saved while offline (the server sends the real one when it is back)
  892. localView(Hybrid f) {
  893. allDay = f.allDay
  894. last = f.endDate != '' ? f.endDate : f.startDate
  895. mine = []
  896. let k = 0
  897. while (k < f.reminders.length) { mine.push({ unit = f.reminders[k].unit n = f.reminders[k].n time = f.reminders[k].time }) k = k + 1 }
  898. return { id = f.id title = f.title allDay = allDay first = f.startDate last = last
  899. startDate = f.startDate startTime = allDay ? '' : f.startTime endDate = f.endDate endTime = allDay ? '' : f.endTime
  900. place = f.place notes = f.notes start = f.startDate zone = f.zone custom = f.custom rows = f.custom ? mine : defRows }
  901. }
  902. on saveEvent(Hybrid e) {
  903. f = formFields()
  904. if (fTitle.trim() == '' || fStartDate == '') {
  905. formError = 'the event needs a title and a start date'
  906. return null
  907. }
  908. r = emit server calSave(f, winFirst, winLast)
  909. if (r == null) {
  910. // OFFLINE: the save waits in the app's queue (it is sent when the connection is back); here the event and its
  911. // reminders are set at once, so the notification still comes
  912. if (f.id == '') { f.id = 'local-' + Date.now() }
  913. emit server calSaveQueued(f, winFirst, winLast)
  914. v = localView(f)
  915. evs = []
  916. let k = 0
  917. while (k < events.length) { if (events[k].id != v.id) { evs.push(events[k]) } k = k + 1 }
  918. evs.push(v)
  919. mine = []
  920. k = 0
  921. while (k < soon.length) { if (soon[k].id != v.id) { mine.push(soon[k]) } k = k + 1 }
  922. mine.push({ id = v.id title = v.title allDay = v.allDay startDate = v.startDate startTime = v.startTime place = v.place zone = v.zone rows = v.rows })
  923. soon = mine
  924. formClass = 'closed'
  925. show(year, month, evs)
  926. arm()
  927. return null
  928. }
  929. if (r.error != null) {
  930. formError = r.error
  931. return null
  932. }
  933. formClass = 'closed'
  934. takeSoon(r)
  935. show(year, month, r.events)
  936. }
  937. on deleteEvent(Hybrid e) {
  938. r = emit server calDelete(fId, winFirst, winLast)
  939. if (r == null || r.error != null) {
  940. formError = r == null ? 'the event could not be deleted (offline?)' : r.error
  941. return null
  942. }
  943. formClass = 'closed'
  944. takeSoon(r)
  945. show(year, month, r.events)
  946. }

Branches

Latest commits

  • b37cc1da|||PR Vendor Hybriel day59Atlas
  • 05665102Merge branch 'vendor-day56' into mainAtlas
  • 687296fb|||PR Vendor Hybriel day56Atlas
  • a6166d4eMerge branch 'hl-standard-3' into mainAtlas
  • 6d0eb3b0|||PR Calendar day add buttons only when signed in (Kunibert minor)Atlas
  • add4b499|||PR Make calendar day actions keyboard accessibleAtlas
  • 79e49b4dMerge branch 'hl-standard' into mainAtlas
  • e9fec7bb|||PR HL-STANDARD clean-up: typed parameters, plain locals, by-reference cacheAtlas
  • eff166a4Re-vendor complete Hybriel plugins and runtime to day44mre
  • cef81394Wait for the DST fixture page instead of an unused socketmre
  • 42434f47Check lazy-session cookies after login with a stored anonymous fixturemre
  • 728e84e3Re-vendor complete Hybriel day41 plugin directoriesmre
  • cbd7ff43Backup tar: --hard-dereference, so mpackdb sidecars are never stored as hard links (Tracker's finding)mre
  • 59d1da0acalendar: plain declarations instead of needless let in 9 files (calendar#17): 49 declarations that are never reassigned; reassigned ones and the timer closure's p stay letmre
  • f5415cf9calendar: the Style blocks in the language's nested form (calendar#16): rules named after the View's own elements with their children nested, pseudo-classes and @media nested, merged duplicate select rule; same CSS, shots identical in Chrome at 4 sizesmre
  • edb7c947calendar: the sign-in callback keeps the session it finds and signs it in (same cookie, nothing signed out; ident#28); security gate 56+4 failing → 60 passedmre
  • bf8cc0fcStyles move into their components: the shell's styles into main.hl, the events and the editors into the month view's Style block; styles.hl keeps only the theme inherit, the accent and the message line; .gitignore ignores a bin symlink too; tests/styles-shots.mjs for the before/after pixel comparemre
  • 5d8579d7README: login.js stays by caramboleyo's explicit rulemre
  • cc759328Merge sb3-standby: calendar deploys through its standbymre
  • f2fcdc6dcalendar: a standby container (port 45015, profile standby, reminder clock off) and a /health page; deploy hands over through standby-swap.sh without a gapmre