[WEB-5515]: comments ordering (#8193)

* fix: comments ordering

* fix: comment timestamp:
This commit is contained in:
Aaryan Khandelwal 2025-11-27 20:51:06 +05:30 committed by GitHub
parent c31a225775
commit 9bcb1fa469
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 4 deletions

View file

@ -64,7 +64,7 @@ export const CommentBlock = observer(function CommentBlock(props: TCommentBlock)
position="bottom" position="bottom"
> >
<span className="text-custom-text-350"> <span className="text-custom-text-350">
{calculateTimeAgo(comment.updated_at)} {calculateTimeAgo(comment.created_at)}
{comment.edited_at && ` (${t("edited")})`} {comment.edited_at && ` (${t("edited")})`}
</span> </span>
</Tooltip> </Tooltip>

View file

@ -112,11 +112,10 @@ export class IssueActivityStore implements IIssueActivityStore {
comments.forEach((commentId) => { comments.forEach((commentId) => {
const comment = currentStore.comment.getCommentById(commentId); const comment = currentStore.comment.getCommentById(commentId);
if (!comment) return; if (!comment) return;
const commentTimestamp = comment.edited_at ?? comment.updated_at ?? comment.created_at;
activityComments.push({ activityComments.push({
id: comment.id, id: comment.id,
activity_type: EActivityFilterType.COMMENT, activity_type: EActivityFilterType.COMMENT,
created_at: commentTimestamp, created_at: comment.created_at,
}); });
}); });

View file

@ -1,4 +1,3 @@
import type { FC } from "react";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
// plane imports // plane imports
import type { E_SORT_ORDER, TActivityFilters } from "@plane/constants"; import type { E_SORT_ORDER, TActivityFilters } from "@plane/constants";
@ -78,16 +77,19 @@ export const IssueActivityCommentRoot = observer(function IssueActivityCommentRo
/> />
) : BASE_ACTIVITY_FILTER_TYPES.includes(activityComment.activity_type as EActivityFilterType) ? ( ) : BASE_ACTIVITY_FILTER_TYPES.includes(activityComment.activity_type as EActivityFilterType) ? (
<IssueActivityItem <IssueActivityItem
key={activityComment.id}
activityId={activityComment.id} activityId={activityComment.id}
ends={index === 0 ? "top" : index === filteredActivityAndComments.length - 1 ? "bottom" : undefined} ends={index === 0 ? "top" : index === filteredActivityAndComments.length - 1 ? "bottom" : undefined}
/> />
) : activityComment.activity_type === "ISSUE_ADDITIONAL_PROPERTIES_ACTIVITY" ? ( ) : activityComment.activity_type === "ISSUE_ADDITIONAL_PROPERTIES_ACTIVITY" ? (
<IssueAdditionalPropertiesActivity <IssueAdditionalPropertiesActivity
key={activityComment.id}
activityId={activityComment.id} activityId={activityComment.id}
ends={index === 0 ? "top" : index === filteredActivityAndComments.length - 1 ? "bottom" : undefined} ends={index === 0 ? "top" : index === filteredActivityAndComments.length - 1 ? "bottom" : undefined}
/> />
) : activityComment.activity_type === "WORKLOG" ? ( ) : activityComment.activity_type === "WORKLOG" ? (
<IssueActivityWorklog <IssueActivityWorklog
key={activityComment.id}
workspaceSlug={workspaceSlug} workspaceSlug={workspaceSlug}
projectId={projectId} projectId={projectId}
issueId={issueId} issueId={issueId}