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

A .ics calendar file opens as a list of its events with date, title and place #14145

Merged opened this

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

Merged

An .ics file now opens as events sorted by start, and shows the first 200 with a count. The ics, fuzz, kinds and TUI-format tests, scripts/gate.ts and tsc pass. I did not run the full suite or design-lint, since src/web markup is untouched.

Notes

shipped production is serving it deploy 4adf612

opened this

An .ics file now opens as events sorted by start, and shows the first 200 with a count. The ics, fuzz, kinds and TUI-format tests, scripts/gate.ts and tsc pass. I did not run the full suite or design-lint, since src/web markup is untouched.

The renderer already existed (src/web/render/ics.ts, registered as the calendar kind). It already handled folded lines, escaped commas, escaped output, the plain-text fallback with one reason, and a fuzz sample. The two gaps were order and the cap:

  • Sorting: events were in file order. They now sort by start as written, in the parser, so the TUI table gets the same order. An all-day event comes before timed ones on the same day, and equal starts keep file order.
  • Time zones: nothing is converted, so a 09:00 UTC event sorts before a 10:00 Europe/Paris one. That follows the "show as written, don't convert" risk.
  • Cap: EVENT_CAP went from 500 to 200. The page says "Showing 200 of N events, N−200 more".
  • Tests: the new test/ics-render.test.ts covers sorting with zones named, folded lines with escaped commas, a hostile summary and location, and the 200 cap with its count. I edited three assertions in test/render-ics.test.ts that asserted file order or the 500 cap. They were wrong for the new behaviour.
  • Not done: I added no new fuzz sample, since the existing one already covers this renderer. I left unsorted dates inside a zone alone, so no zone arithmetic was added.

To try it, open any .ics file in a repository. The preview is deployed from this branch.

Closes #14123

2 earlier comments
commented

An .ics file now opens as events sorted by start, and shows the first 200 with a count. The ics, fuzz, kinds and TUI-format tests, scripts/gate.ts and tsc pass. I did not run the full suite or design-lint, since src/web markup is untouched.

The renderer already existed (src/web/render/ics.ts, registered as the calendar kind). It already handled folded lines, escaped commas, escaped output, the plain-text fallback with one reason, and a fuzz sample. The two gaps were order and the cap:

  • Sorting: events were in file order. They now sort by start as written, in the parser, so the TUI table gets the same order. An all-day event comes before timed ones on the same day, and equal starts keep file order.
  • Time zones: nothing is converted, so a 09:00 UTC event sorts before a 10:00 Europe/Paris one. That follows the "show as written, don't convert" risk.
  • Cap: EVENT_CAP went from 500 to 200. The page says "Showing 200 of N events, N−200 more".
  • Tests: the new test/ics-render.test.ts covers sorting with zones named, folded lines with escaped commas, a hostile summary and location, and the 200 cap with its count. I edited three assertions in test/render-ics.test.ts that asserted file order or the 500 cap. They were wrong for the new behaviour.
  • Not done: I added no new fuzz sample, since the existing one already covers this renderer. I left unsorted dates inside a zone alone, so no zone arithmetic was added.

To try it, open any .ics file in a repository. The preview is deployed from this branch.

commented

<!-- look-pages aef18d23d7a3 --> Look pages for aef18d2, from the gate:

  • look pages (inferred): this pull changes src/web/render/ics.ts; the forge pictures / (src/web/render/ics.ts), /docs (src/web/render/ics.ts), /explore (src/web/render/ics.ts) and 24 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

No code changed in response to this feedback. The comment lists the 27 pages that import src/web/render/ics.ts through the renderer registry, and none of them change. The only visible change is the body of an .ics file view, which needs a repository that holds a calendar file.

I pushed an empty commit with a No look: line, which the gate treats as an override of the inferred list. It gives that reason and points to test/ics-render.test.ts, which asserts the sorted rows and the 200 cap.

If you want a picture of an actual .ics view, point me at a repository or fixture path that holds one and I'll add a Looks: line for it.

The pull's description is unchanged:

An .ics file now opens as events sorted by start as written, with the zone named and never converted. It shows the first 200 events with a count. The parser, escaping, plain-text fallback and fuzz sample already existed. This change adds the sort in parseIcs (so the TUI table gets it too), lowers EVENT_CAP to 200, and adds test/ics-render.test.ts. It covers sorting, folded lines with escaped commas, a hostile summary, the cap and the fallback. I edited three assertions in test/render-ics.test.ts that asserted file order or the old 500 cap. To try it, open a .ics file in a repository on the preview.

Approved

Small, correct change: the parser sorts by start as written (zone named, not converted), the cap is 200 with a count, tests cover sorting, folded lines, escaped commas, a hostile summary and the cap. The existing fuzz sample for cal.ics already covers the renderer. No src/web markup changed, so the design system is untouched. Next two things: (1) the 205-event test is titled sorted but only counts rows; assert the first row is the earliest start. (2) The count line reads "Showing 200 of 205 events, 5 more"; drop the redundant "5 more" and add a look of a real .ics view so the preview shows it.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs