Skip to content

Conversation

@aaryan610
Copy link
Member

@aaryan610 aaryan610 commented Nov 27, 2025

Description

This PR fixes the ordering comments in work item activity based on created_at instead of the previous edited_at.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Summary by CodeRabbit

  • Bug Fixes

    • Consistent comment timestamps: comment activity entries and comment time indicators now use the original creation time so comment ordering and displayed times are accurate.
  • Refactor

    • Improved activity rendering stability and prop handling to ensure reliable display of activity items and related entries.

✏️ Tip: You can customize this high-level summary in your review settings.

@aaryan610 aaryan610 added the 🐛bug Something isn't working label Nov 27, 2025
Copilot AI review requested due to automatic review settings November 27, 2025 13:46
@makeplane
Copy link

makeplane bot commented Nov 27, 2025

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 27, 2025

Walkthrough

This PR standardizes comment timestamps to use creation time, updates comment time display in the UI, and adds React keys and an extra prop when rendering activity comment subcomponents.

Changes

Cohort / File(s) Change Summary
Activity Store Timestamp Normalization
apps/web/ce/store/issue/issue-details/activity.store.ts
buildActivityAndCommentItems now always uses comment.created_at for COMMENT activity created_at, removing fallback resolution from edited_at or updated_at.
Activity Comment Component Props & Keys
apps/web/core/components/issues/issue-detail/issue-activity/activity-comment-root.tsx
Removed FC import from React; added key={activityComment.id} to IssueActivityItem, IssueAdditionalPropertiesActivity, and IssueActivityWorklog; passed activityComment={activityComment} to IssueActivityWorklog.
Comment Time Display
apps/web/ce/components/comments/comment-block.tsx
Tooltip/time-ago display changed to use comment.created_at instead of comment.updated_at; edited indicator behavior unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Inspect ordering/aggregation in buildActivityAndCommentItems to ensure downstream features relying on previous fallback behavior are not affected.
  • Verify UI rendering for activity lists after adding key props and passing activityComment to IssueActivityWorklog.
  • Confirm tooltip/time-ago displays and edited indicators in comment-block.tsx reflect intended timestamps.

Poem

🐰 Hopping through code with a twitch of my nose,
Timestamps aligned where the soft carrot grows,
Keys tucked in rows so the list stays polite,
Worklogs get context and comments shine bright,
A tiny rabbit cheers — everything's right! 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: fixing comment ordering to use created_at instead of edited_at timestamps.
Description check ✅ Passed The description covers the main objective and type of change, but is missing several template sections like Screenshots/Media, Test Scenarios, and References.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/comments

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 218e98c and 92ae110.

📒 Files selected for processing (1)
  • apps/web/ce/components/comments/comment-block.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,mts,cts}

📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)

**/*.{ts,tsx,mts,cts}: Use const type parameters for more precise literal inference in TypeScript 5.0+
Use the satisfies operator to validate types without widening them
Leverage inferred type predicates to reduce the need for explicit is return types in filter/check functions
Use NoInfer<T> utility to block inference for specific type arguments when they should be determined by other arguments
Utilize narrowing in switch(true) blocks for control flow analysis (TypeScript 5.3+)
Rely on narrowing from direct boolean comparisons for type guards
Trust preserved narrowing in closures when variables aren't modified after the check (TypeScript 5.4+)
Use constant indices to narrow object/array properties (TypeScript 5.5+)
Use standard ECMAScript decorators (Stage 3) instead of legacy experimentalDecorators
Use using declarations for explicit resource management with Disposable pattern instead of manual cleanup (TypeScript 5.2+)
Use with { type: "json" } for import attributes; avoid deprecated assert syntax (TypeScript 5.3/5.8+)
Use import type explicitly when importing types to ensure they are erased during compilation, respecting verbatimModuleSyntax flag
Use .ts, .mts, .cts extensions in import type statements (TypeScript 5.2+)
Use import type { Type } from "mod" with { "resolution-mode": "import" } for specific module resolution contexts (TypeScript 5.3+)
Use new iterator methods (map, filter, etc.) if targeting modern environments (TypeScript 5.6+)
Utilize new Set methods like union, intersection, etc., when available (TypeScript 5.5+)
Use Object.groupBy / Map.groupBy standard methods for grouping instead of external libraries (TypeScript 5.4+)
Use Promise.withResolvers() for creating promises with exposed resolve/reject functions (TypeScript 5.7+)
Use copying array methods (toSorted, toSpliced, with) for immutable array operations (TypeScript 5.2+)
Avoid accessing instance fields via super in classes (TypeScript 5....

Files:

  • apps/web/ce/components/comments/comment-block.tsx
🧬 Code graph analysis (1)
apps/web/ce/components/comments/comment-block.tsx (1)
packages/utils/src/datetime.ts (1)
  • calculateTimeAgo (165-174)
🔇 Additional comments (1)
apps/web/ce/components/comments/comment-block.tsx (1)

61-69: Timestamp display correctly aligned to created_at.

Using calculateTimeAgo(comment.created_at) brings the relative timestamp in line with the tooltip and the new ordering logic based on created_at, without introducing new edge cases given calculateTimeAgo’s null‑safe behavior. Looks good.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@aaryan610 aaryan610 changed the title [WEB-5515: comments ordering [WEB-5515]: comments ordering Nov 27, 2025
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 a bug in the ordering of comments and activities in work item activity feeds by using created_at instead of edited_at for sorting. This ensures that items are displayed in the chronological order they were originally created, rather than being reordered when edited.

Key changes:

  • Changed comment timestamp logic from edited_at ?? updated_at ?? created_at to created_at in the activity store
  • Removed unused FC type import from the activity-comment-root component
  • Added missing key props to activity components in the rendering logic

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
apps/web/ce/store/issue/issue-details/activity.store.ts Updated comment timestamp to use created_at instead of the fallback chain for proper chronological ordering
apps/web/core/components/issues/issue-detail/issue-activity/activity-comment-root.tsx Removed unused FC import and added missing React key props to rendered components

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

@sriramveeraghanta sriramveeraghanta merged commit 9bcb1fa into preview Nov 27, 2025
6 checks passed
@sriramveeraghanta sriramveeraghanta deleted the fix/comments branch November 27, 2025 15:21
ClarenceChen0627 pushed a commit to ClarenceChen0627/plane that referenced this pull request Dec 5, 2025
* fix: comments ordering

* fix: comment timestamp:
ClarenceChen0627 pushed a commit to ClarenceChen0627/plane that referenced this pull request Dec 5, 2025
* fix: comments ordering

* fix: comment timestamp:
ClarenceChen0627 pushed a commit to ClarenceChen0627/plane that referenced this pull request Dec 5, 2025
* fix: comments ordering

* fix: comment timestamp:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants