diff --git a/public/index.html b/public/index.html
index c954721e..ea1a5655 100644
--- a/public/index.html
+++ b/public/index.html
@@ -84,7 +84,7 @@
-
+
diff --git a/public/packets.js b/public/packets.js
index dba51322..315e600c 100644
--- a/public/packets.js
+++ b/public/packets.js
@@ -702,7 +702,8 @@
const sortMode = groupSortModes[p.hash] || SORT_OBSERVER;
const obsLabel = sortMode === SORT_OBSERVER ? 'Observer' : 'Observer';
const pathLabel = sortMode === SORT_PATH_LENGTH ? 'Path length' : 'Path length';
- html += `
| Sort: ${obsLabel} · ${pathLabel} |
`;
+ const chronoLabel = sortMode === SORT_CHRONO ? 'Chronological' : 'Chronological';
+ html += `| Sort: ${obsLabel} · ${pathLabel} · ${chronoLabel} |
`;
for (const c of p._children) {
const typeName = payloadTypeName(c.payload_type);
const typeClass = payloadTypeColor(c.payload_type);
@@ -1251,6 +1252,7 @@
// Observation sort modes
const SORT_OBSERVER = 'observer';
const SORT_PATH_LENGTH = 'path';
+ const SORT_CHRONO = 'chrono';
const groupSortModes = {}; // hash → sort mode
function getPathHopCount(c) {
@@ -1261,7 +1263,12 @@
if (!group || !group._children) return;
const mode = groupSortModes[group.hash] || SORT_OBSERVER;
- if (mode === SORT_PATH_LENGTH) {
+ if (mode === SORT_CHRONO) {
+ group._children.sort((a, b) => {
+ const tA = a.timestamp || '', tB = b.timestamp || '';
+ return tA < tB ? -1 : tA > tB ? 1 : 0;
+ });
+ } else if (mode === SORT_PATH_LENGTH) {
group._children.sort((a, b) => {
const lenA = getPathHopCount(a), lenB = getPathHopCount(b);
if (lenA !== lenB) return lenA - lenB;