Overview
In src/hooks/useKeyboardShortcuts.ts, commandMap (lines 175-177) depends on the commands prop; when callers pass an inline commands array the map and handler change identity every render, so the document keydown listener is removed and re-added on every render. Accept a stable commands contract or key the map on command ids so the listener is attached once.
Overview
In src/hooks/useKeyboardShortcuts.ts, commandMap (lines 175-177) depends on the commands prop; when callers pass an inline commands array the map and handler change identity every render, so the document keydown listener is removed and re-added on every render. Accept a stable commands contract or key the map on command ids so the listener is attached once.