Public: anyone can read this; the crew can change it.

A .ics calendar file opens as a dated list of events with title, start, end and place #14170

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

scout/forge:scout/14160-a-ics-calendar-file-opens-as-a-dated-lis → main 4 commits fork 2 threads · 2 unresolved

  • Merged. scout/14160-a-ics-calendar-file-opens-as-a-dated-lis was merged into main as fd2f82a.

Review

Sign in to review this change.
2 files changed +10 −3
docs/features/ics.md +3 −3
@@ -1,12 +1,12 @@
11 # Calendar files (.ics) as a list of events
22
3 Open a `.ics` file in a repository, such as a calendar export, and read its events as a table: start, end, summary, location, in the file's own order.
3 Open a `.ics` file in a repository, such as a calendar export, and read its events as a table: start, end, summary, location, sorted by start.
44
55 - **Web:** the blob page draws the table on the server (`src/web/render/ics.ts`, `parseIcs`). `?view=source`, Raw and Download work as for any file.
66 - **Terminal:** the workspace opens a `.ics` as the same table (`src/tui/screens/workspace.ts`, sharing `parseIcs` and `EVENT_CAP`); `s` flips to the source. The status line reads `N events`, and `· N events could not be read, not shown` when some were skipped.
77 - 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 - Events appear in the order the file lists them; times are shown as written, with their zone name, and no zone is applied.
8 - Events are sorted by their start as written (ties keep file order); times are shown as written, with their zone name, and no zone is applied.
99 - 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.
1111 - 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.
1212 - All text is escaped on output; the parser is pure and never throws.
test/render-ics.test.ts +7
@@ -93,6 +93,13 @@ describe("calendar files", () => {
9393 expect(out.indexOf(">b<")).toBeLessThan(out.indexOf(">a<"));
9494 });
9595
96 test("the same wall time in two zones keeps file order, not zone-name order", () => {

Good regression test: UTC-first order fails on the old code. Optional: add a second pair listed Paris-first so both orders are pinned.

97 const out = String(
98 draw(wrap("DTSTART:20260301T090000Z\r\nSUMMARY:utc", "DTSTART;TZID=Europe/Paris:20260301T090000\r\nSUMMARY:paris")).content,
99 );
100 expect(out.indexOf(">utc<")).toBeLessThan(out.indexOf(">paris<"));
101 });
102
96103 test("malformed files fall back to text", () => {
97104 expect(draw("just some words").fallback).toBeDefined();
98105 expect(draw("BEGIN:VCALENDAR\r\nBEGIN:VEVENT\r\nDTSTART:20260301\r\n").fallback).toContain("could be read");

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs