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:
@@ -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']);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user