Skip to content

fix(feed): a run with no zone of its own reads in its runner's zone - #929

Open
ddteeter wants to merge 2 commits into
mainfrom
fix/w16-run-zone
Open

ddteeter wants to merge 2 commits into
mainfrom
fix/w16-run-zone

Conversation

@ddteeter

Copy link
Copy Markdown
Owner

Summary

A run with no zone of its own (an indoor run, or one with no weather reading) now reads its day and clock in its runner's saved-place zone, and in UTC only when the runner has saved no place either (owner, 2026-11-20, #925; design 257).

Until now three surfaces read such a run in UTC:

  • the feed card's posted label;
  • the entry detail's run line;
  • the entry's report label.

So a Chicago runner's 5:55 PM indoor run read "Yesterday · 11:55 PM" ten minutes later. The profiles, the public kit page and the band runs already fell back to the runner's zone through runDayOf. Now one rule, runZoneOf in lib/dates.ts, serves all of them.

The feed-e1 conformance spec failed just after midnight UTC for the same reason: its runs had no zone, so they read in UTC. It now seeds its runner a saved zone where "now" is at least six hours from midnight. The snapshot is unchanged.

Closes #925

Changes

  • src/lib/dates.ts: runZoneOf(observed, runnerZone): the observed zone, else the runner's, else none (UTC). Each is checked with isTimeZone.
  • src/modules/feed/following/feed.ts and feed/entries/entries.ts: the author read also selects user_profiles.time_zone. EntryRunFields, which the card and the detail share, gains runnerZone.
  • PostCard, EntryDetail and routes/feed/entry.$entryId.tsx's report label read in runZoneOf(conditions?.timeZone, runnerZone).
  • feed/public-web/public-kit.ts: runDayOf uses runZoneOf instead of its own ?? chain.
  • e2e/conformance/feed-e1 and feed-support.ts: seedRunner takes an optional saved zone.

The fallback is always the runner's zone, never the viewer's: a run happened where its runner is.

Tests

  • test/lib/dates.test.ts: runZoneOf prefers the observed zone, falls back to the runner's, skips an invalid zone on either side, and returns none when neither is known.
  • test/feed/runner-zone.test.ts (worker, new): the feed card and the entry detail carry the author's saved zone, not the viewer's, and none when the author saved no place.
  • test/modules/post-card.dom.test.tsx: a run 13 hours back reads 13h ago in Tokyo, and Yesterday · 11:00 PM with no zone.
  • test/modules/entry-detail.dom.test.tsx: the run line reads in the runner's zone, and the observed zone wins over it.

Demo

The attached video opens the entry detail of a Chicago runner's indoor run, started at 23:55 UTC. Its run line reads WED NOV 18 · 5:55 PM, in the runner's zone, where it read 11:55 PM before.

Deferred

None. The D-row is the coordinator's, at the docs pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GFN3dijQKqrMz7KjBt8GKn

zone-demo.mp4

ddteeter and others added 2 commits November 20, 2026 21:15
An indoor run, or one with no weather reading, has no zone, and the feed
card, the entry detail and its report label read it in UTC: a Chicago
runner's 5:55 PM indoor run read "Yesterday · 11:55 PM" ten minutes on.
They now fall back to the author's saved-place zone, then UTC (owner,
2026-11-20, #925), through one rule, runZoneOf, which runDayOf shares.
The feed-e1 conformance seeds its runner a zone far from midnight, so it
no longer fails just after midnight UTC.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GFN3dijQKqrMz7KjBt8GKn

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

e2e: feed-e1 conformance fails in the ten minutes after midnight UTC

1 participant