Skip to content

Commit 5d70109

Browse files
authored
Use spec.creationTime consistently for reply timestamps (#207)
Replies used `metadata.creationTimestamp` while comments used `spec.creationTime`. Since `metadata.creationTimestamp` doesn't necessarily represent the actual creation time, both should use `spec.creationTime`. **Changes:** - Updated `reply-item.ts` line 122 to use `reply?.spec.creationTime` instead of `reply?.metadata.creationTimestamp` ```typescript // Before .creationTime="${this.reply?.metadata.creationTimestamp ?? undefined}" // After .creationTime="${this.reply?.spec.creationTime}" ``` This aligns replies with comments, which already use `spec.creationTime`. > [!WARNING] > > <details> > <summary>Firewall rules blocked me from connecting to one or more addresses (expand for details)</summary> > > #### I tried to connect to the following addresses, but was blocked by firewall rules: > > - `pkg.pr.new` > - Triggering command: `/usr/local/bin/node node /usr/local/bin/pnpm install` (dns block) > > If you need me to access, download, or install something from one of these locations, you can either: > > - Configure [Actions setup steps](https://gh.io/copilot/actions-setup-steps) to set up my environment, which run before the firewall is enabled > - Add the appropriate URLs or hosts to the custom allowlist in this repository's [Copilot coding agent settings](https://github.com/halo-dev/plugin-comment-widget/settings/copilot/coding_agent) (admins only) > > </details> <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > > ---- > > *This section details on the original issue you should resolve* > > <issue_title>回复的时间不正确</issue_title> > <issue_description>目前项目中回复采用的时间是 `metadata. creationTimestamp` > > https://github.com/halo-dev/plugin-comment-widget/blob/bf6435b978dd33da9ccbff220ea1f9907e4cf41b/packages/comment-widget/src/reply-item.ts#L122 > > 但评论采用的时间又是 `spec. creationTime` > > https://github.com/halo-dev/plugin-comment-widget/blob/bf6435b978dd33da9ccbff220ea1f9907e4cf41b/packages/comment-widget/src/comment-item.ts#L120 > > 应当使其保持一致,建议统一使用 `spec. creationTime`, `metadata. creationTimestamp` 并不一定代表真实的创建时间。</issue_description> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > </comments> > </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes #206 <!-- START COPILOT CODING AGENT TIPS --> --- 💡 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](https://gh.io/copilot-coding-agent-tips) in the docs.
1 parent bf6435b commit 5d70109

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/comment-widget/src/reply-item.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export class ReplyItem extends LitElement {
119119
.userAvatar="${handleReplyAvatar(this.reply)}"
120120
.userDisplayName="${this.reply?.owner.displayName}"
121121
.content="${this.reply?.spec.content || ''}"
122-
.creationTime="${this.reply?.metadata.creationTimestamp ?? undefined}"
122+
.creationTime="${this.reply?.spec.creationTime}"
123123
.approved=${this.reply?.spec.approved}
124124
.breath=${this.isQuoteReplyHovered}
125125
.userWebsite=${this.reply?.spec.owner.annotations?.website}

0 commit comments

Comments
 (0)