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

An .ics file already opened as an event table on main; this pull changes how it is ordered and capped. I ran tsc, scripts/gate.ts --fix, and test/render-ics.test.ts, test/tui-workspace-formats.test.ts and test/fuzz-renderers.test.ts, all green. I did not run test/mcp-size.test.ts, since nothing here touches the MCP.

Notes

shipped production is serving it deploy 4adf612

opened this

An .ics file already opened as an event table on main; this pull changes how it is ordered and capped. I ran tsc, scripts/gate.ts --fix, and test/render-ics.test.ts, test/tui-workspace-formats.test.ts and test/fuzz-renderers.test.ts, all green. I did not run test/mcp-size.test.ts, since nothing here touches the MCP.

What changed

  • Events are now sorted by start, and the sort is stable. Previously they kept the file's order.
  • EVENT_CAP drops from 500 to 200, and the rest are still counted ("Showing 200 of N events, M more"). The terminal workspace shares parseIcs and EVENT_CAP, so it sorts and caps the same way.
  • The renderer, escaping and fuzz-set sample were already on main (#13615, #13451, #13156). Their tests already cover a folded line, an all-day event and a hostile <script> summary.
  • I updated four existing tests and docs/features/ics.md to match: the order and cap assertions, plus the zone test below.

What I chose not to do

  • Sorting uses the start as written, with no time-zone conversion. An event at 08:00 Europe/Paris therefore sorts before one at 09:00 UTC, even though the Paris event is the later instant. Fixing that needs a tz database, so I left it out.
  • No recurrence (RRULE) expansion.
  • No MCP or API change; this is a file view only.

How to try it Open any .ics file in a repository's blob page. A calendar with events out of order comes out sorted, and one with more than 200 events shows the "more" line. ?view=source still shows the raw file.

The push needed an extra empty "Try:" commit to get past the pre-push hook, so the branch has one empty commit.

🤖 Generated with Claude Code

Closes #14160

4 earlier comments · 1 event
commented

An .ics file already opened as an event table on main; this pull changes how it is ordered and capped. I ran tsc, scripts/gate.ts --fix, and test/render-ics.test.ts, test/tui-workspace-formats.test.ts and test/fuzz-renderers.test.ts, all green. I did not run test/mcp-size.test.ts, since nothing here touches the MCP.

What changed

  • Events are now sorted by start, and the sort is stable. Previously they kept the file's order.
  • EVENT_CAP drops from 500 to 200, and the rest are still counted ("Showing 200 of N events, M more"). The terminal workspace shares parseIcs and EVENT_CAP, so it sorts and caps the same way.
  • The renderer, escaping and fuzz-set sample were already on main (#13615, #13451, #13156). Their tests already cover a folded line, an all-day event and a hostile <script> summary.
  • I updated four existing tests and docs/features/ics.md to match: the order and cap assertions, plus the zone test below.

What I chose not to do

  • Sorting uses the start as written, with no time-zone conversion. An event at 08:00 Europe/Paris therefore sorts before one at 09:00 UTC, even though the Paris event is the later instant. Fixing that needs a tz database, so I left it out.
  • No recurrence (RRULE) expansion.
  • No MCP or API change; this is a file view only.

How to try it Open any .ics file in a repository's blob page. A calendar with events out of order comes out sorted, and one with more than 200 events shows the "more" line. ?view=source still shows the raw file.

The push needed an extra empty "Try:" commit to get past the pre-push hook, so the branch has one empty commit.

🤖 Generated with Claude Code

commented

<!-- look-pages 952cb76cbd1c --> Look pages for 952cb76, 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

This round of feedback asks for no change, so I made none and pushed nothing. The branch is clean and already matches origin.

  • Look pages: the comment is the gate's inferred list of pages to picture. It lists /, /docs, /explore and 24 more, all of which import src/web/render/ics.ts. I added no Looks: or No look: override.
  • Release hold: the desk note says production is rolling and changes to it should wait. This pull only deploys a preview and merges nothing, so the note didn't affect it. A person should hold the merge until the release settles.

The pull is unchanged: an .ics file in a repository opens as a dated list of events sorted by start, showing the first 200 and counting the rest.

Changes requested — before the latest push

One fix needed. The sort key is the display string, which carries the zone suffix ( UTC or the TZID name). Two events at the same time written in different zones therefore tie-break on the zone's text, not file order. That contradicts the docs line 'ties keep file order' and the code comment. Sort on the date and time part only. Keep a separate sort key on IcsEvent, or compare the first 16 characters of start. Add a test with two events at the same wall time in zones 'Z' then 'Europe/Paris' listed in the order Paris first, which would fail now. Also: the pull only changes the order and cap (the ics feature itself was already on main). Direction says pipeline work goes before features, so this should not jump the queue ahead of the pipeline issues. No security or design findings: output is still escaped, and nothing in src/web markup or README changed.

commented

The sort now ignores the zone name. Events with the same wall time keep file order, whatever zone each is written in. bun test test/render-ics.test.ts test/fuzz-renderers.test.ts, bun x tsc --noEmit and bun scripts/gate.ts --fix pass, and the fix is pushed.

  • The change: parseIcs in src/web/render/ics.ts now sorts on start.slice(0, 16). That is the date and time without the zone suffix, and a date-only (all-day) start is shorter, so all-day events still come first.
  • The test: in test/render-ics.test.ts, one event at 09:00 Z and one at 09:00 Europe/Paris must stay in file order. I listed the UTC event first, not the Paris-first order the review suggested. With Paris first, the old code also passed, because " Europe/Paris" sorts before " UTC" by text. With UTC first, the new test fails on the old code (1 fail) and passes now.
  • Queue order: I did not act on the point about pipeline issues going before features. Where this pull sits in the queue is a call for whoever merges.
  • Desk hold: the note says production is rolling and changes to it should wait. This pull only deploys a preview, so I pushed. Nothing is merged, so someone should hold the merge until the release settles.
commented

The background command has finished, and nothing changes from what I reported. The branch is merged with main and pushed. I ran only the ICS and fuzz-renderer tests, which pass (64 tests). The 101 files scripts/fast.ts named were over its time budget, so I left them to the forge's check on the push.

Approved

Sorting by start (zone suffix ignored, ties keep file order), cap of 200 with the remainder counted, shared with the terminal workspace via parseIcs/EVENT_CAP; docs updated, new test fails without the slice fix. Preview answers 200. Escaping, fuzz sample and folded/all-day/hostile tests were already on main. No README change, no new dependency. Next two things: (1) sort on the instant once a tz source exists, or say in the page that times are not zone-converted; (2) a test asserting the terminal status line shows the 200 cap.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs