-
Notifications
You must be signed in to change notification settings - Fork 7
Bug/104670 timestamp previous conversations #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this 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.
src/webchat-ui/components/presentational/previous-conversations/helpers.ts
Outdated
Show resolved
Hide resolved
src/webchat-ui/components/presentational/previous-conversations/helpers.ts
Outdated
Show resolved
Hide resolved
src/webchat-ui/components/presentational/previous-conversations/helpers.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
src/webchat-ui/components/presentational/previous-conversations/helpers.ts
Outdated
Show resolved
Hide resolved
|
@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. @copilot implement the same logic using Intl/RelativeTimeFormat. Omit providing a distinct locale if possible. Create PR for this branch. |
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
There was a problem hiding this 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.
src/webchat-ui/components/presentational/previous-conversations/helpers.ts
Show resolved
Hide resolved
src/webchat-ui/components/presentational/previous-conversations/helpers.ts
Show resolved
Hide resolved
src/webchat-ui/components/presentational/previous-conversations/helpers.ts
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this 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.
src/webchat-ui/components/presentational/previous-conversations/helpers.ts
Show resolved
Hide resolved
src/webchat-ui/components/presentational/previous-conversations/helpers.ts
Show resolved
Hide resolved
src/webchat-ui/components/presentational/previous-conversations/helpers.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…s/helpers.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this 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.
src/webchat-ui/components/presentational/previous-conversations/helpers.ts
Show resolved
Hide resolved
There was a problem hiding this 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.
Success criteria
Please describe what should be possible after this change. List all individual items on a separate line.
How to test
Please describe the individual steps on how a peer can test your change.
Security
Additional considerations
Documentation Considerations
These are hints for the documentation team to help write the docs.