Skip to content

feat: format timestamps in message events#53

Merged
jvxz merged 4 commits intomainfrom
feat/event-list-timestamps
May 6, 2026
Merged

feat: format timestamps in message events#53
jvxz merged 4 commits intomainfrom
feat/event-list-timestamps

Conversation

@jvxz
Copy link
Copy Markdown
Owner

@jvxz jvxz commented May 6, 2026

No description provided.

@jvxz jvxz linked an issue May 6, 2026 that may be closed by this pull request
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 6, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
magi 934153a Commit Preview URL

Branch Preview URL
May 06 2026, 01:41 AM

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 6, 2026

Greptile Summary

This PR extracts timestamp rendering from message.vue into a dedicated timestamp.vue component and adds smart formatting: today's messages show hour/minute only, while older ones fall back to locale-default date display. A tooltip with the full weekday/date/time is shown on hover.

  • The new component uses temporal-polyfill for date comparisons, with timezone handling correctly implemented via Temporal.Now.timeZoneId() to ensure the event date and "today" are compared in the same local zone.
  • The isOld computed captures the current date at first evaluation; sessions that straddle midnight will not refresh the label for already-rendered messages, which is a minor cosmetic edge case.

Confidence Score: 5/5

Safe to merge; the change is a self-contained UI extraction with correct timezone-aware date comparison logic.

The timezone mismatch flagged in the previous review round has been addressed by using Temporal.Now.timeZoneId() consistently. The only remaining edge case — stale isOld across midnight — is cosmetic and confined to long-lived sessions. No data, auth, or Matrix SDK paths are touched.

No files require special attention.

Important Files Changed

Filename Overview
app/components/page/room/event/message/timestamp.vue New component that wraps NuxtTime with Temporal-based "is old" detection and a full-date tooltip; timezone handling is now correct using Temporal.Now.timeZoneId(), but isOld won't re-evaluate across midnight due to non-reactive Temporal.Now calls
app/components/page/room/event/message.vue Replaced inline NuxtTime with the new PageRoomEventMessageTimestamp component; straightforward extraction with no logic changes
nuxt.config.ts Adds temporal-polyfill as an auto-import preset so Temporal is globally available in components
package.json Adds temporal-polyfill ^0.3.2 as a runtime dependency

Fix All in Cursor

Reviews (2): Last reviewed commit: "fix: use Temporal.Now.timeZoneId to get ..." | Re-trigger Greptile

Comment thread app/components/page/room/event/message/timestamp.vue
Comment thread app/components/page/room/event/message/timestamp.vue
@jvxz jvxz merged commit 7f45c81 into main May 6, 2026
3 of 4 checks passed
@jvxz jvxz deleted the feat/event-list-timestamps branch May 6, 2026 01:45
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.

feat: improve event list event time formatting

1 participant