Commit 5d70109
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
0 commit comments