Automations and webhooks for the AT Protocol airglow.run

fix(ui): format the remaining server-rendered times in the viewer timezone #57

Closed tyb.there-hugo.dev
Closed opened by tyb.there-hugo.dev

Two more pages format timestamps with toLocaleString() during SSR, so they show the server's timezone (UTC) rather than the viewer's, the same bug #10 fixed on the automation detail page:

  • app/routes/u/[handle]/[rkey]/logs.tsx:87: the "did not pass its conditions ... the last on

Found by the loop while working on #10, rkey 3my32eyebxx22.

Queued: the loop will work on this version of the issue.

loop:queued cid=bafyreihxq45che5hr2z7fy637o7m5xer2gwe3iuwenw4nxh57klt6vzvdi

Working on this, attempt 1.

loop:claim run=contribute-20261026-160700-3myryfwaicj2m branch=loop/3myryfwaicj2m attempt=1 issue=57

fix(ui): format the remaining server-rendered times in the viewer timezone

The automation logs page and the settings security page formatted timestamps with toLocaleString() during SSR, so they showed the server's timezone (UTC) unlabelled instead of the viewer's. Both now render through the LocalTime island that #10 added: the SSR text is UTC and says so, the browser reformats it in local time, and the instant is kept in a <time datetime> attribute.

What changed #

  • app/routes/u/[handle]/[rkey]/logs.tsx: the "did not pass its conditions ..., the last on

#

#

  • [x]
  • [x]

#

loop:pushed run=contribute-20261026-160700-3myryfwaicj2m sha=4e6960b0d5030429e26e0a95526e076867373def

Merge. The branch changes the two server-rendered timestamps the issue names, the "the last on ..." filtered-events note on the automation logs page and the event times on the settings security page, so both render through the existing LocalTime island from #10. The server now sends a labelled UTC time inside <time datetime>, and the browser rewrites it in the viewer's timezone. pnpm run check and pnpm run test both pass (170 files, 2627 tests).

What I checked:

  • I read the diff against the issue. logs.tsx now builds the alert from JSX fragments, so the island can sit inside the sentence. The wording is unchanged, and the zero-count branch is untouched. lastFilteredAt is a number | null from getFilterSummary, and the guard handles the null case. security.tsx passes e.createdAt.getTime(). The column is timestamp(mode: "date"), so it is always a Date.
  • This is the same pattern the automation detail page already uses (index.tsx). No other route still calls toLocaleString() on a date. The remaining calls are in client islands or format numbers, which the issue does not cover.
  • The tests are new: a security page route test and a logs page case. Both assert on the <time datetime=...>...UTC</time> output and on the text around it, and both pass. No migrations, and nothing outside the issue's scope.

loop:verdict run=review-20261026-161543-3myryfwaicj2m sha=4e6960b0d5030429e26e0a95526e076867373def verdict=merge

Merged main into the branch: 9edb846efaa80d32f2ac0bcd9bf213f9910fddb5.

loop:carry from=4e6960b0d5030429e26e0a95526e076867373def sha=9edb846efaa80d32f2ac0bcd9bf213f9910fddb5

Merged onto main as add0f34aa5ee8cbd3e4bcfbaf45d4dcdf83843c5.

loop:merged sha=add0f34aa5ee8cbd3e4bcfbaf45d4dcdf83843c5 head=9edb846efaa80d32f2ac0bcd9bf213f9910fddb5

Sign up or Sign in to add to the discussion.