Plan: Pipeline Details — Events Descending Order#
Summary#
Sort the events list on the Pipeline Details page by timestamp descending (newest first), with tie-breaking on event id descending. The Events page (/events) uses a separate component and data source, so it is out of scope and tracked separately.
Files#
| File | Action | Description |
|---|---|---|
app/pipeline/[taskId]/page.tsx | modify | Sort task.events array by createdAt desc, then id desc before rendering |
Steps#
- S1 — Sort events descending in Pipeline Details page: In
app/pipeline/[taskId]/page.tsx, sort thetask.eventsarray bycreatedAtdescending before the.map()call (line ~355). Usenew Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()as primary sort, fall back tob.id - a.idfor identical timestamps. Use[...task.events].sort()to avoid mutating the original array.
Verification#
- Events on the Pipeline Details page render newest-first by default.
- Empty events list and single-event lists render without errors.
npm run lintandnpm run buildpass.
Risks#
- The
/eventspage uses a separateDataTablecomponent andgetEvents()API endpoint — it does not share the same component or data source. A follow-up issue should be created if its sort order also needs changing.