From b800d77570dcbf11e8708d7e79bc176bf8a9c0ea Mon Sep 17 00:00:00 2001 From: you Date: Sat, 21 Mar 2026 23:46:30 +0000 Subject: [PATCH] fix: apply observation sort on all code paths that set _children Sort was only applied in pktToggleGroup and dropdown change handler. Missing from: loadPackets restore (re-fetches children for expanded groups) and WS update path (unshifts new observations). Now all three paths call sortGroupChildren after modifying _children. --- public/index.html | 2 +- public/packets.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/public/index.html b/public/index.html index e741d93..1073797 100644 --- a/public/index.html +++ b/public/index.html @@ -84,7 +84,7 @@ - + diff --git a/public/packets.js b/public/packets.js index 78ce248..4b9fedd 100644 --- a/public/packets.js +++ b/public/packets.js @@ -280,6 +280,7 @@ // Update expanded children if this group is expanded if (expandedHashes.has(h) && existing._children) { existing._children.unshift(p); + sortGroupChildren(existing); } } else { // New group @@ -366,6 +367,7 @@ try { const childData = await api(`/packets?hash=${hash}&limit=20`); group._children = childData.packets || []; + sortGroupChildren(group); } catch {} } else { // Group no longer in results — remove from expanded