Skip to content

Conversation

@sushmi21
Copy link
Collaborator

@sushmi21 sushmi21 commented Nov 25, 2025

Success criteria

Please describe what should be possible after this change. List all individual items on a separate line.

  • Fix timestamps in previous conversations list to display 'Today', 'Yesterday', 'last month', etc. correctly

How to test

Please describe the individual steps on how a peer can test your change.

  1. Test if Today and Yesterday are displayed based on calendar dates and not based on 24 or 48 hours logic
  2. Test if other custom labels for weeks, months and years are displayed correctly, especially for edge cases

Security

  • Possible injection vector
  • Authentication/Access controls touched
  • Sensitive Data could be exposed
  • XSS
  • Logging/Monitoring touched
  • Exchanges data with external systems
  • No security implications

Additional considerations

  • This PR might have performance implications

Documentation Considerations

These are hints for the documentation team to help write the docs.

Copilot AI review requested due to automatic review settings November 25, 2025 18:02
@graymalkin77
Copy link

graymalkin77 commented Nov 25, 2025

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link
Contributor

Copilot AI left a comment

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 fixes the timestamp display logic in the previous conversations list to show calendar-based relative times ("Today", "Yesterday", etc.) instead of time-based calculations (24/48 hours). The implementation replaces moment.js's fromNow() method with custom calendar-based calculations.

Key Changes:

  • Replaced moment.js locale customization with explicit calendar-based date comparison logic
  • Implemented direct date difference calculations for days, weeks, months, and years
  • Added documentation explaining the calendar-based approach

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings November 26, 2025 10:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kwinto
Copy link
Collaborator

kwinto commented Nov 27, 2025

@sushmi21 This might be more suited for this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat

I would suggest to omit setting the english locale so that a browser can use the user's preferred one. Afaik we use this approach for the message timestamps already.

Generally, we could start gradually getting rid of moment-js.
Let's check if a vibecoded solution would work.

@copilot implement the same logic using Intl/RelativeTimeFormat. Omit providing a distinct locale if possible. Create PR for this branch.

Copy link
Contributor

Copilot AI commented Nov 27, 2025

@kwinto I've opened a new pull request, #218, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 14 commits November 27, 2025 11:16
Co-authored-by: kwinto <90881+kwinto@users.noreply.github.com>
Co-authored-by: kwinto <90881+kwinto@users.noreply.github.com>
Co-authored-by: kwinto <90881+kwinto@users.noreply.github.com>
Co-authored-by: kwinto <90881+kwinto@users.noreply.github.com>
Co-authored-by: kwinto <90881+kwinto@users.noreply.github.com>
Co-authored-by: kwinto <90881+kwinto@users.noreply.github.com>
Co-authored-by: kwinto <90881+kwinto@users.noreply.github.com>
Co-authored-by: kwinto <90881+kwinto@users.noreply.github.com>
Co-authored-by: kwinto <90881+kwinto@users.noreply.github.com>
Co-authored-by: kwinto <90881+kwinto@users.noreply.github.com>
Co-authored-by: kwinto <90881+kwinto@users.noreply.github.com>
Co-authored-by: kwinto <90881+kwinto@users.noreply.github.com>
Replace moment.js with Intl.RelativeTimeFormat and add Cypress tests
Copilot AI review requested due to automatic review settings November 28, 2025 08:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings December 1, 2025 17:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings December 1, 2025 17:40
…s/helpers.ts

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

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings December 2, 2025 08:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

4 participants