fix(web-hud): support hyphenated widget IDs with regression tests
Some checks failed
ci/woodpecker/push/orchestrator Pipeline was successful
ci/woodpecker/push/web Pipeline failed

This commit is contained in:
Jason Woltje
2026-02-17 15:49:09 -06:00
parent 4d089cd020
commit f4ad7eba37
4 changed files with 46 additions and 3 deletions

View File

@@ -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;