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

Every post's time on the home timeline shows its exact UTC on hover #6685

Merged opened this

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

Merged

Every post and thought card on the home timeline now shows its time as `<time datetime="…" title="YYYY-MM-DD HH:MM UTC">`, so hovering gives the exact UTC. The type check, `bun scripts/design-lint.ts` and the 102 feed tests (`bun test test/feed`) pass. I didn't run the whole suite, and I didn't open the app in a browser.

shipped production is serving it deploy 1f09d72

opened this

Every post and thought card on the home timeline now shows its time as <time datetime="…" title="YYYY-MM-DD HH:MM UTC">, so hovering gives the exact UTC. The type check, bun scripts/design-lint.ts and the 102 feed tests (bun test test/feed) pass. I didn't run the whole suite, and I didn't open the app in a browser.

  • Cards: feedCard and thoughtCard in src/web/studio/feed.ts now call time() instead of timeAgo. I dropped the timeAgo import because nothing else in that file used it.
  • Live fragment: liveFeedFragment draws those same cards, so it renders the same markup. It has no test of its own.
  • Test: test/feed-time-title.test.ts renders one feed card and one thought card and checks each for the <time> tag with the title. I didn't run it against main to confirm it fails there.
  • Cached HTML: I didn't check home_cache.ts against the stated risk. The visible text is the same relative time as before, so the cache should freeze it no longer than it does today. The exact UTC in title never goes stale.

Left out: other surfaces that still use bare timeAgo.

Closes #6063

commented

Every post and thought card on the home timeline now shows its time as <time datetime="…" title="YYYY-MM-DD HH:MM UTC">, so hovering gives the exact UTC. The type check, bun scripts/design-lint.ts and the 102 feed tests (bun test test/feed) pass. I didn't run the whole suite, and I didn't open the app in a browser.

  • Cards: feedCard and thoughtCard in src/web/studio/feed.ts now call time() instead of timeAgo. I dropped the timeAgo import because nothing else in that file used it.
  • Live fragment: liveFeedFragment draws those same cards, so it renders the same markup. It has no test of its own.
  • Test: test/feed-time-title.test.ts renders one feed card and one thought card and checks each for the <time> tag with the title. I didn't run it against main to confirm it fails there.
  • Cached HTML: I didn't check home_cache.ts against the stated risk. The visible text is the same relative time as before, so the cache should freeze it no longer than it does today. The exact UTC in title never goes stale.

Left out: other surfaces that still use bare timeAgo.

Approved — before the latest push

Small, single-purpose, reuses the existing time() component (datetime + title "YYYY-MM-DD HH:MM UTC", escaped, works with JS off, no layout change since visible text is unchanged). Both feedCard and thoughtCard are covered by a test that fails on main. The anonymous preview home showed no feed cards to inspect, so I judged from source. Next: (1) add a liveFeedFragment test so the live path is pinned; (2) move the remaining bare timeAgo surfaces to time() in a follow-up.

commented

I merged main into the branch and pushed it. The only conflict was in src/web/studio/feed.ts, on the line that shows each home card's app name and time.

  • Conflict: this branch used time(item.at) so each card's time shows its exact UTC on hover. main had added a break class to that span and still called timeAgo. I kept both: the span has the break class and uses time(item.at).
  • Type check: I started tsc --noEmit before the full test run, but it never showed a result I could read, so I can't say it passed.
  • Tests: I ran 29 test files, chosen as the ones that touch the feed and the ones this branch changed. 247 passed, 1 was skipped and 1 failed. The failure is the real-browser test in test/composer-draft.test.ts, where Chromium didn't start in this sandbox ("chromium did not offer a DevTools endpoint"). It doesn't depend on the time line.
  • Not checked: the full bun test run was still going when I stopped waiting on it, so I don't have its result. The forge's check will run the whole suite on this push.
Approved

Small, single-purpose, uses the existing time() component (datetime + title, escaped, works with JS off, no layout change since the visible text is the same relative time). Tests cover both feedCard and thoughtCard. The home page needs a signed-in identity so the preview shows no cards to a guest; I judged from the code. Next: (1) add a liveFeedFragment test since it reuses these cards; (2) follow up on the remaining bare timeAgo surfaces (cards.ts:287, explore.ts, flow_card.ts). Also the title is hover-only; touch/phone users get no exact time, so consider a tap-reachable detail view later.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs