Skip to content

Chat message date display#824

Merged
danditomaso merged 2 commits into
meshtastic:mainfrom
philon-:message-dates
Sep 2, 2025
Merged

Chat message date display#824
danditomaso merged 2 commits into
meshtastic:mainfrom
philon-:message-dates

Conversation

@philon-

@philon- philon- commented Sep 1, 2025

Copy link
Copy Markdown
Contributor

Description

This PR adds date labels to messages in chat, as well as a date sort on all messages.

Related Issues

Together with PR #818, hopefully addresses #717: Sorting performed before rendering after this PR, and missing date fallback is added in PR #818.

Fixes #639

Changes Made

  • Added DateDelimiter component with separators and locale-aware labels (Today, Yesterday, or formatted date).
  • Messages are now sorted chronologically (oldest → newest) before rendering to ensure messages that are stored out of order are displayed in order.

Testing Done

Screenshots (if applicable)

Screenshot From 2025-09-01 18-13-06

Checklist

  • Code follows project style guidelines
  • Documentation has been updated or added
  • Tests have been added or updated
  • All i18n translation labels have been added (read
    CONTRIBUTING_I18N_DEVELOPER_GUIDE.md for more details)

Copilot AI review requested due to automatic review settings September 1, 2025 16:36
@vercel

vercel Bot commented Sep 1, 2025

Copy link
Copy Markdown

@philon- is attempting to deploy a commit to the Meshtastic Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds date grouping functionality to chat messages with visual date delimiters and chronological sorting. It introduces locale-aware date labels (Today, Yesterday, or formatted dates) and ensures messages are displayed in chronological order.

  • Added date grouping logic with DateDelimiter component for visual separation
  • Implemented chronological sorting to handle out-of-order stored messages
  • Added internationalization support for "Today" and "Yesterday" labels

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
packages/web/src/components/PageComponents/Messages/ChannelChat.tsx Added date grouping functions, DateDelimiter component, and chronological sorting logic
packages/web/public/i18n/locales/en/common.json Added "today" and "yesterday" translation keys to the day unit object

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread packages/web/src/components/PageComponents/Messages/ChannelChat.tsx
Comment thread packages/web/src/components/PageComponents/Messages/ChannelChat.tsx
Comment thread packages/web/src/components/PageComponents/Messages/ChannelChat.tsx Outdated
@danditomaso

Copy link
Copy Markdown
Collaborator

@philon- looks awesome! You'll need to test what happens in the UI when the messages scroll off the top of the screen. Please provide a screenshot in this PR.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@philon-

philon- commented Sep 1, 2025

Copy link
Copy Markdown
Contributor Author

@philon- looks awesome! You'll need to test what happens in the UI when the messages scroll off the top of the screen. Please provide a screenshot in this PR.

Screenshot From 2025-09-01 19-39-24

@vercel

vercel Bot commented Sep 2, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
web-test Ready Ready Preview Comment Sep 2, 2025 2:32am

@danditomaso danditomaso merged commit ce16bf5 into meshtastic:main Sep 2, 2025
4 checks passed
@philon- philon- mentioned this pull request Sep 2, 2025
4 tasks
@philon- philon- deleted the message-dates branch September 3, 2025 19:25
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.

[Feature Request]: Add date to message timestamp

3 participants