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

An .ics calendar file opens as its events in the browser #13615

Merged opened this

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

Merged

An `.ics` file now lists its events in the file's own order, with a cap of 500 instead of 200. That is what the issue asks for.

shipped production is serving it deploy 7fd75b3

opened this

An .ics file now lists its events in the file's own order, with a cap of 500 instead of 200. That is what the issue asks for.

The viewer already existed on main (src/web/render/ics.ts, from #10379, #13156 and #13451). It already showed title, start, end and place, handled folded lines and escaped commas, escaped hostile text, and counted the events past the cap. Scout declined for that reason, but the issue names 500 and file order, and the sort could mislead when a file mixes time zones. So this pull changes those two points.

What changed

  • Cap: EVENT_CAP goes from 200 to 500. The "N more" line is unchanged.
  • Order: the by-start sort is removed from parseIcs, so events come out as the file lists them. The terminal door in src/tui/screens/workspace.ts reads the same parser and cap, so it follows with no edit there.
  • Time zones: the sort compared start times as text and applied no zone, so events in different zones could land out of order. With no sort, the "time zones are not applied" note is gone too. Times still show as written with their zone name, which is the raw-time fallback the issue asks for when unsure.
  • Docs: docs/features/ics.md and the header comment in ics.ts now say file order and 500.

Tests (test/render-ics.test.ts)

  • The old sort test now checks that file order is kept.
  • The cap test checks 500, with e499 shown, e500 not, and "7 more".
  • The two-zone test now checks that the file's order is kept and no note appears.
  • The all-day test's expected order flips to match.

I changed those expectations because the behaviour they pinned is what the issue reverses.

What I did not do: no time-zone conversion and no new parsing. Nothing added to the escaping or the no-script paths.

Checks: tsc --noEmit and scripts/gate.ts --fix are clean. The three ICS and workspace test files pass (58 tests). I did not run the full suite; the forge does that on push.

To try it: open any .ics file in a repository's file view. Events appear in the order the file lists them, up to 500.

🤖 Generated with Claude Code

Closes #13591

2 earlier comments
commented

An .ics file now lists its events in the file's own order, with a cap of 500 instead of 200. That is what the issue asks for.

The viewer already existed on main (src/web/render/ics.ts, from #10379, #13156 and #13451). It already showed title, start, end and place, handled folded lines and escaped commas, escaped hostile text, and counted the events past the cap. Scout declined for that reason, but the issue names 500 and file order, and the sort could mislead when a file mixes time zones. So this pull changes those two points.

What changed

  • Cap: EVENT_CAP goes from 200 to 500. The "N more" line is unchanged.
  • Order: the by-start sort is removed from parseIcs, so events come out as the file lists them. The terminal door in src/tui/screens/workspace.ts reads the same parser and cap, so it follows with no edit there.
  • Time zones: the sort compared start times as text and applied no zone, so events in different zones could land out of order. With no sort, the "time zones are not applied" note is gone too. Times still show as written with their zone name, which is the raw-time fallback the issue asks for when unsure.
  • Docs: docs/features/ics.md and the header comment in ics.ts now say file order and 500.

Tests (test/render-ics.test.ts)

  • The old sort test now checks that file order is kept.
  • The cap test checks 500, with e499 shown, e500 not, and "7 more".
  • The two-zone test now checks that the file's order is kept and no note appears.
  • The all-day test's expected order flips to match.

I changed those expectations because the behaviour they pinned is what the issue reverses.

What I did not do: no time-zone conversion and no new parsing. Nothing added to the escaping or the no-script paths.

Checks: tsc --noEmit and scripts/gate.ts --fix are clean. The three ICS and workspace test files pass (58 tests). I did not run the full suite; the forge does that on push.

To try it: open any .ics file in a repository's file view. Events appear in the order the file lists them, up to 500.

🤖 Generated with Claude Code

commented

<!-- look-pages b0f1d607487d --> Look pages for b0f1d60, 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 20 more, the pages whose routes import it. A "Looks: <path>" or "No look: <why>" line in a commit message overrides
commented

The look-pages note was an inference, not a failure. I didn't change any code in response. I pushed an empty commit with a No look: line, which the gate says overrides the inferred pages.

I chose "no look" because this pull only changes the order and cap of the rows in the .ics table. It adds no layout, no component class and no page chrome. The 23 pages the gate picked (/, /docs, /explore and others) are only there because their routes import the renderer registry that ics.ts sits in. None of them shows a calendar.

If a reviewer wants a picture of an actual .ics file view, tell me which path to give in a Looks: line. I don't know of a stable page that shows one.

Approved

Approved. Events now list in the file's own order, the cap is 500, and the misleading zone note is gone. Both doors share parseIcs and EVENT_CAP, so the terminal follows. Docs and tests are updated and each changed behaviour has a test that would fail without it. This is a small pull that adds no markup, so there is no design-system departure. The preview has no .ics file to open, so I judged it from the diff and could not check it there.

Two things I would do next:

  1. Add a workspace (terminal) test that pins file order and the 500 cap, so the second door is covered by its own test and not only through the shared parser.
  2. Rewrap the header comment in src/web/render/ics.ts, where the edited line now runs longer than its neighbours (scripts/gate.ts --fix will do it).
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs