Relates to #208, #214
Summary
In public/analytics.js (renderMultiByteAdopters, the [data-sort] click handler), colIdx is { name: 0, status: 1, hashSize: 2, packets: 3, lastSeen: 4 }. The table, however, has six columns: Node, Role, Status, Hash Size, Adverts and Last Seen. The Role column and this map were added together in 45623672. As a result:
- Role does nothing.
- Status reads the Role cell, so every row gets weight 2 and the order does not change.
- Hash Size reads the Status text.
- Adverts reads the Hash Size cell.
- Last Seen reads the Adverts cell, as a string.
Even with the right index, Last Seen would compare timeAgo text ("5m ago") as strings. The sort is ascending only, keeps no state or indicator, and is discarded by the next filter click.
Evidence
From the #214 review: on the E2E fixture, clicking Adverts leaves the Adverts column as 2, 1, 1, ….
Proposed fix
Acceptance criteria
Relates to #208, #214
Summary
In
public/analytics.js(renderMultiByteAdopters, the[data-sort]click handler),colIdxis{ name: 0, status: 1, hashSize: 2, packets: 3, lastSeen: 4 }. The table, however, has six columns: Node, Role, Status, Hash Size, Adverts and Last Seen. The Role column and this map were added together in45623672. As a result:Even with the right index, Last Seen would compare
timeAgotext ("5m ago") as strings. The sort is ascending only, keeps no state or indicator, and is discarded by the next filter click.Evidence
From the #214 review: on the E2E fixture, clicking Adverts leaves the Adverts column as
2, 1, 1, ….Proposed fix
cellIndex, or sort on per-celldata-sort-valueattributes:aria-sort.mbsort=) only once that state exists, following the feat(analytics): deep-link Scopes sub-tabs and window (#205) #206/fix: P3 follow-ups from the #203/#204/#206 reviews (#208) #214 pattern: no selector read from the URL, and unknown values give the default.Acceptance criteria
mbf=behaviour are unchanged.