feat(web): add iconify tag icons for object classes

Replace the text class tag in the tree and inspector with one or more
MDI icons (hover shows the class name). Bundle only the used icons via
a generator script instead of the full set.
This commit is contained in:
2026-08-08 12:32:11 +08:00
parent 3b66e82b67
commit 4f37dabbe7
8 changed files with 235 additions and 4 deletions
@@ -0,0 +1,16 @@
import { describe, expect, it } from 'vitest';
import { iconsForObject } from './objectIcons';
describe('iconsForObject', () => {
it('maps known classes to icons', () => {
expect(iconsForObject('Card')).toEqual(['mdi:cards-outline']);
expect(iconsForObject('Custom_Model_Bag')).toEqual([
'mdi:bag-personal-outline',
'mdi:cube-outline',
]);
});
it('falls back to the help icon for unknown classes', () => {
expect(iconsForObject('Unknown_Thing')).toEqual(['mdi:help-circle-outline']);
});
});