From 049934478cc07e2d658467ffd151b112e85a319e Mon Sep 17 00:00:00 2001 From: Adam Moussa <166072409+amoussa1229@users.noreply.github.com> Date: Thu, 16 Apr 2026 18:33:37 -0400 Subject: [PATCH] Sort all activity tabs oldest-first with newest at bottom - CommentTimeline and AuditTimeline both sort by date ascending - Auto-scroll to bottom on all tabs for consistency --- .../workorders/view/WorkOrderViewPage.js | 23 +++++++++++++++---- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/pages/workorders/view/WorkOrderViewPage.js b/src/pages/workorders/view/WorkOrderViewPage.js index 4d83973e..46672da8 100644 --- a/src/pages/workorders/view/WorkOrderViewPage.js +++ b/src/pages/workorders/view/WorkOrderViewPage.js @@ -16,19 +16,22 @@ function formatDateTime(value) { function CommentTimeline({ comments }) { const bottomRef = useRef(null); + const sorted = [...(comments || [])].sort((a, b) => + new Date(a.createdDate) - new Date(b.createdDate) + ); useEffect(() => { bottomRef.current?.scrollIntoView(); - }, [comments?.length]); + }, [sorted.length]); - if (!comments || comments.length === 0) { + if (!sorted.length) { return
No comments yet.
No changes recorded.