fix(web-hud): support hyphenated widget IDs with regression tests
This commit is contained in:
@@ -73,7 +73,7 @@ export function HUD({ className = "" }: HUDProps): React.JSX.Element {
|
||||
|
||||
const handleAddWidget = (widgetType: WidgetRegistryKey): void => {
|
||||
const widgetConfig = WIDGET_REGISTRY[widgetType];
|
||||
const widgetId = `${widgetType.toLowerCase()}-${String(Date.now())}`;
|
||||
const widgetId = `${widgetConfig.name}-${String(Date.now())}`;
|
||||
|
||||
// Find the next available position
|
||||
const maxY = currentLayout?.layout.reduce((max, w): number => Math.max(max, w.y + w.h), 0) ?? 0;
|
||||
|
||||
Reference in New Issue
Block a user