Public: anyone can read this; the crew can change it.
An .ics file opens as its events: title, start, end and place in a table, with every field shown as text #13451
Check · Review · Land · Live done — Landed and live in production.
mason/forge:mason/13430-an-ics-file-opens-as-its-events-title-st → main 2 commits fork
3 files
changed +5
−5
docs/features/ics.md +1 −1
| @@ -7,6 +7,6 @@ Open a `.ics` file in a repository, such as a calendar export, and read its even | ||
| 7 | 7 | - Folded lines are unfolded and `\,` `\;` `\n` escapes are undone. UTC times show as `UTC`, `TZID` times keep their zone name, all-day events show dates and the last day (the file's end is exclusive). |
| 8 | 8 | - Events are sorted by start as written (text order); time zones are not applied, so events in different zones can be out of order, and the web says so in one line when a file holds more than one zone. |
| 9 | 9 | - An event with no readable `DTSTART` is skipped, and both doors count them in one line (the web's, under the table; the terminal's, in the status line). |
| 10 | - The first 500 events (`EVENT_CAP`) are shown; the rest are counted. | |
| 10 | - The first 200 events (`EVENT_CAP`) are shown; the rest are counted. | |
| 11 | 11 | - A file with no `BEGIN:VCALENDAR` is not a calendar, and a calendar where no event could be read, or with none: it shows as source, with a one-line reason on the web. |
| 12 | 12 | - All text is escaped on output; the parser is pure and never throws. |
src/web/render/ics.ts +1 −1
| @@ -12,7 +12,7 @@ import { fileSize } from "../ui.ts"; | ||
| 12 | 12 | import type { Rendered, RenderInput } from "./renderers.ts"; |
| 13 | 13 | |
| 14 | 14 | /** Events drawn, whatever the file holds. */ |
| 15 | export const EVENT_CAP = 500; | |
| 15 | export const EVENT_CAP = 200; | |
| 16 | 16 | |
| 17 | 17 | export interface IcsEvent { |
| 18 | 18 | /** `2026-03-01 09:00`, `2026-03-01`, with a zone note when the file gave one. */ |
test/render-ics.test.ts +3 −3
| @@ -103,11 +103,11 @@ describe("calendar files", () => { | ||
| 103 | 103 | expect(draw("BEGIN:VCALENDAR\r\nEND:VCALENDAR\r\n").fallback).toContain("no events"); |
| 104 | 104 | }); |
| 105 | 105 | |
| 106 | test("capped at 500 events, saying how many more", () => { | |
| 106 | test("capped at 200 events, saying how many more", () => { | |
| 107 | 107 | const many = Array.from({ length: EVENT_CAP + 7 }, (_, i) => `DTSTART:20260301T090000Z\r\nSUMMARY:e${i}`); |
| 108 | 108 | const out = String(draw(wrap(...many)).content); |
| 109 | expect(out).toContain("e499<"); | |
| 110 | expect(out).not.toContain("e500<"); | |
| 109 | expect(out).toContain("e199<"); | |
| 110 | expect(out).not.toContain("e200<"); | |
| 111 | 111 | expect(out).toContain("7 more"); |
| 112 | 112 | }); |
| 113 | 113 | }); |
new above
offline