Skip to content

🐛 fix: sort by newest order focoordinator comments (#738)#765

Merged
need4deed merged 2 commits into
need4deed-org:developfrom
yi171:yixuan/fix/comments-wrong-order
Jul 13, 2026
Merged

🐛 fix: sort by newest order focoordinator comments (#738)#765
need4deed merged 2 commits into
need4deed-org:developfrom
yi171:yixuan/fix/comments-wrong-order

Conversation

@yi171

@yi171 yi171 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Description

Fixed bug where new comments were stacked between older comments (specifically for users with Coordinator roles), by replacing .reverse() with a sort by timestamp. This should ensure newest comments always appear at the top regardless of the order sent by the backend.

Related Issues

Closes #738

Changes

  • replace reverse() with sort comments by descending timestamp in 'EntityComments.tsx'.

Screenshots

image

Checklist

  • WITHIN THE SCOPE OF AN ISSUE; No unnecessary files included
  • Tests added/updated
  • Documentation updated
  • CI passes

@ivannissimrch ivannissimrch self-requested a review July 9, 2026 00:35

@ivannissimrch ivannissimrch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the logic and verified the sort with several cases already-sorted, random,
oldest-first, same-day, equal timestamps, it always returns newest-first regardless of the order the backend sends.

@nadavosa nadavosa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, minimal fix — replacing `.reverse()` with a sort by `timestamp` (a valid typed field on `TimedText`) is correct and well-scoped to the bug described.

One note: no CI check has run on this PR yet (`gh pr checks` returns nothing). Worth confirming `yarn lint`/`yarn typecheck` locally before merging since there's no automated signal yet.

@need4deed need4deed merged commit 7d1af50 into need4deed-org:develop Jul 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

comments not in right order in opportunity profile

4 participants