Commit 99084a3
fix(messages): default the topic message list to newest-first ordering
The default topic message view (non-continuous pagination, "Newest" /
last-50) rendered rows in the backend's stream order. The listMessages
stream isn't globally timestamp-sorted across partitions, so messages
were not shown newest-first as users expect.
`ListMessagesRequest` has no sort-order field, so ordering has to be
imposed client-side. Rather than a bespoke sort of the row list, set a
sensible default for the existing `sort` URL param so the table's own
sorted row model does the work:
- DEFAULT_SORTING is now [timestamp desc, offset desc] (offset isn't
global across partitions, so timestamp is the primary key and offset
is a stable tiebreak).
- getSorting() treats an empty/unset sort as "use the default", so it
also applies for returning users whose persisted settings still hold
the old empty sort.
- The Timestamp/Offset column headers now show the sort direction, and
the sort is shareable/persisted via the URL.
Continuous-pagination mode disables header sorting, so the explicit
newest-first sort is kept for its "Newest" fetch (now with the same
offset tiebreak for determinism).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 7ee42a0 commit 99084a3
2 files changed
Lines changed: 24 additions & 7 deletions
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
475 | | - | |
| 475 | + | |
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
| |||
572 | 572 | | |
573 | 573 | | |
574 | 574 | | |
575 | | - | |
576 | | - | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
577 | 582 | | |
578 | 583 | | |
579 | | - | |
| 584 | + | |
580 | 585 | | |
581 | 586 | | |
582 | 587 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
115 | 123 | | |
116 | 124 | | |
117 | 125 | | |
| |||
214 | 222 | | |
215 | 223 | | |
216 | 224 | | |
217 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
218 | 230 | | |
219 | 231 | | |
220 | 232 | | |
| |||
0 commit comments