Skip to content

fix: sort timeline ascending so newest message appears at bottom#253

Merged
lindaeskilsson merged 1 commit into
mainfrom
fix/messages-sort-ascending
Apr 23, 2026
Merged

fix: sort timeline ascending so newest message appears at bottom#253
lindaeskilsson merged 1 commit into
mainfrom
fix/messages-sort-ascending

Conversation

@lindaeskilsson

@lindaeskilsson lindaeskilsson commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Closes #246

Vad är gjort

  • Ändrat sorteringsordning i CaseDetail.jsx från fallande till stigande på tre ställen (rad 55, 74, 112)
  • Meddelanden visas nu med nyaste längst ner, i enlighet med chattkonvention

Ändring

new Date(b.createdAt) - new Date(a.createdAt)new Date(a.createdAt) - new Date(b.createdAt)

Ingen backend-ändring krävs

Summary by CodeRabbit

  • Updates
    • Timeline ordering in the case detail view has been adjusted. Comments and activity entries are now displayed in chronological order, showing the oldest entries first rather than the most recent entries at the top of the timeline.

@lindaeskilsson lindaeskilsson self-assigned this Apr 23, 2026
@coderabbitai

coderabbitai Bot commented Apr 23, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e470f39e-654b-4a07-9e62-5994fa52aa39

📥 Commits

Reviewing files that changed from the base of the PR and between 4d12e0a and 078f13f.

📒 Files selected for processing (1)
  • frontend/src/pages/CaseDetail.jsx

📝 Walkthrough

Walkthrough

The pull request modifies the timeline ordering logic in the CaseDetail page component by reversing the sort comparator from descending to ascending by createdAt timestamp. This change applies to three locations: initial data load, activity refetch, and post-comment updates, affecting both comment and activity entries.

Changes

Cohort / File(s) Summary
Timeline Sort Order
frontend/src/pages/CaseDetail.jsx
Reversed Array.sort comparator from descending to ascending by createdAt in three places (initial load, activity refetch, post-comment update), ensuring newer entries appear at the bottom.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

bug, frontend

Poem

🐰 The messages now stack just right,
Newest one gleaming at bottom's height,
Chat conventions finally tight,
A sorting fix—simply delightful!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately describes the main change: fixing the sort order to display newest messages at the bottom.
Linked Issues check ✅ Passed The code changes directly address issue #246 by reversing the sort order in all three locations to follow chat convention with newest messages at the bottom.
Out of Scope Changes check ✅ Passed All changes are directly related to issue #246; only the sort comparator logic was modified in CaseDetail.jsx with no unrelated alterations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/messages-sort-ascending

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.

@lindaeskilsson
lindaeskilsson merged commit 2a6965b into main Apr 23, 2026
2 checks 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.

Meddelanden: nyaste meddelandet ska visas längst ner

1 participant