Add periodic timestamp updates to timeline events#7286
Merged
Conversation
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
…ection Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Can times in the timeline update periodically?
Add periodic timestamp updates to timeline events
Jul 14, 2025
alexr00
requested changes
Jul 14, 2025
Contributor
Author
There was a problem hiding this comment.
Reverted yarn.lock changes. Fixed in commit 8e37b7b.
.eslintcache.browser
Outdated
Contributor
Author
There was a problem hiding this comment.
Removed .eslintcache.browser file. Fixed in commit 8e37b7b.
webviews/components/timestamp.tsx
Outdated
Comment on lines
+24
to
+36
| // For very recent timestamps (< 1 hour), update every minute | ||
| if (ageInMinutes < 60) { | ||
| return 60000; // 1 minute | ||
| } | ||
| // For timestamps < 1 day old, update every 5 minutes | ||
| else if (ageInMinutes < 60 * 24) { | ||
| return 5 * 60000; // 5 minutes | ||
| } | ||
| // For older timestamps, update less frequently or not at all | ||
| // since they likely show absolute dates | ||
| else { | ||
| return 15 * 60000; // 15 minutes | ||
| } |
Member
There was a problem hiding this comment.
Please update times less than 1 minute ago every 20 seconds. Times less than an hour, every 2 minutes. If it's older than a day, don't update.
Contributor
Author
There was a problem hiding this comment.
Updated timing intervals as requested:
- Times < 1 minute: update every 20 seconds
- Times < 1 hour: update every 2 minutes
- Times > 1 day: don't update at all
Fixed in commit 8e37b7b.
…, no updates for >1day Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
alexr00
approved these changes
Jul 14, 2025
bpasero
approved these changes
Jul 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Timeline timestamps now update periodically to match GitHub.com behavior. Previously, relative timestamps like "3 weeks ago" or "6 minutes ago" were static and never changed, even as time passed.
Problem
As shown in the issue screenshots, timestamps in the VS Code extension remained static:
On GitHub.com, these timestamps update automatically over time to reflect the current relative time.
Solution
Modified the
Timestampcomponent to use React hooks with smart update intervals:Key Features
setIntervalResult
Timeline events now show dynamic timestamps that update automatically:
This provides a more accurate and GitHub.com-like experience for users viewing pull request timelines.
Fixes #7006.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.