barGroupKey: strip final same-class char run, no ID parsing
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user