From e011c9e7d8c94cb6e61a5662214c11effaba0095 Mon Sep 17 00:00:00 2001 From: c0dev0id Date: Tue, 30 Jun 2026 12:19:14 +0200 Subject: [PATCH] barGroupKey: strip final same-class char run, no ID parsing --- static/components/PaneSubObjects.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/static/components/PaneSubObjects.js b/static/components/PaneSubObjects.js index 3d43377..8c15b84 100644 --- a/static/components/PaneSubObjects.js +++ b/static/components/PaneSubObjects.js @@ -2,12 +2,11 @@ import { h } from 'vue'; import { ObjectShort } from './ObjectShort.js'; import { getKindGroups } from '../subobject-kinds.js'; -// Extract the P?L? fragment as a visual grouping key. -// Falls back to stripping trailing digits if the pattern is absent, -// which yields singleton groups — not a crash, just no visual grouping. +// Strip the final maximal run of same-class characters (all-digits or all-non-digits) +// from the ID tail. Everything before that run is the group key. function barGroupKey(id) { - const m = id.match(/P\d+L\d+/); - return m ? m[0] : id.replace(/\d+$/, ''); + const m = id.match(/(\d+|\D+)$/); + return m ? id.slice(0, m.index) : id; } export const PaneSubObjects = {