From bdb268d510f25ef00ffe06bb45ae652a9ad127e2 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Thu, 29 Jan 2026 12:08:21 -0800 Subject: [PATCH] Fix Art-Net TX/RX mapping and add natural sort to tables Co-Authored-By: Claude Opus 4.5 --- .claude/settings.local.json | 3 ++- sacn_discovery.go | 9 ++++++--- static/index.html | 7 ++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index f90fec0..f27c4b9 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -60,7 +60,8 @@ "Bash(git clone:*)", "Bash(go work use:*)", "Bash(go mod init:*)", - "Bash(git push:*)" + "Bash(git push:*)", + "Bash(go doc:*)" ] } } diff --git a/sacn_discovery.go b/sacn_discovery.go index 5e191ef..3f74ae4 100644 --- a/sacn_discovery.go +++ b/sacn_discovery.go @@ -22,11 +22,12 @@ func (t *Tendrils) startSACNDiscoveryListener(ctx context.Context, iface net.Int return } - if t.DebugSACN { - log.Printf("[sacn] listening for discovery on %s", iface.Name) - } + // TODO: remove debug logging + log.Printf("[sacn] listening for discovery on %s", iface.Name) receiver.SetHandler(func(src *net.UDPAddr, pkt interface{}) { + // TODO: remove debug logging + log.Printf("[sacn] received packet from %s", src) if disc, ok := pkt.(*sacn.DiscoveryPacket); ok { t.handleSACNDiscoveryPacket(src.IP, disc) } @@ -34,6 +35,8 @@ func (t *Tendrils) startSACNDiscoveryListener(ctx context.Context, iface net.Int receiver.Start() <-ctx.Done() + // TODO: remove debug logging + log.Printf("[sacn] discovery listener exiting on %s", iface.Name) } func (t *Tendrils) handleSACNDiscoveryPacket(srcIP net.IP, pkt *sacn.DiscoveryPacket) { diff --git a/static/index.html b/static/index.html index 6bb6dc9..83c265c 100644 --- a/static/index.html +++ b/static/index.html @@ -2434,7 +2434,8 @@ } va = String(va).toLowerCase(); vb = String(vb).toLowerCase(); - return asc ? va.localeCompare(vb) : vb.localeCompare(va); + const cmp = va.localeCompare(vb, undefined, { numeric: true, sensitivity: 'base' }); + return asc ? cmp : -cmp; }); } @@ -2626,11 +2627,11 @@ nodes.forEach(node => { const name = getLabel(node); - (node.artnet_outputs || []).forEach(u => { + (node.artnet_inputs || []).forEach(u => { if (!txByUniverse.has(u)) txByUniverse.set(u, []); txByUniverse.get(u).push(name); }); - (node.artnet_inputs || []).forEach(u => { + (node.artnet_outputs || []).forEach(u => { if (!rxByUniverse.has(u)) rxByUniverse.set(u, []); rxByUniverse.get(u).push(name); });