mirror of
https://github.com/logseq/logseq.git
synced 2026-05-22 19:54:05 +00:00
Extract key handler and conflict resolution logic from the ~390-line customize-shortcut-dialog-inner into testable top-level defn- functions: - customize-key-handler: key event state machine (~70 lines) - compute-override-plan: pure conflict resolution for reassign - compute-reset-plan: pure conflict resolution for reset-to-default - matches-default-binding?: canonical default-binding comparison Add persist-user-shortcuts-batch! to core.cljs to atomically persist multiple binding changes in a single config read-modify-write cycle, fixing a race condition where sequential persist-user-shortcut! calls clobbered each other (config-handler/set-config! updates state async via save-file! promise chain, so the second call reads stale data). Fix reset-fn! to strip conflicting bindings before restoring defaults, preventing error notifications from goog.ui.KeyboardShortcutHandler duplicate key registration. Auto-close the customize popup 300ms after reset so it doesn't float over a now-empty filtered list. Clear user overrides (persist nil) when conflict stripping leaves a binding that matches the action's default, so actions correctly disappear from the "Custom" filter tab. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>