From 678ede4e766928ab4b61de6cdd57e7e345aaa425 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Sun, 10 May 2026 23:45:09 -0400 Subject: [PATCH] refactor: replace inline onclick with data-action event delegation The command palette button used an inline onclick handler while every other interactive element in base.html uses data-action + event delegation. Now consistent: data-action="open-cmdpalette" handled in the global footer click listener. Co-Authored-By: Claude Sonnet 4.6 --- templates/base.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/templates/base.html b/templates/base.html index 6da95d0..53b527b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -144,9 +144,9 @@ + aria-label="Open command palette">⌕ K @@ -346,8 +346,9 @@ const btn = e.target.closest('[data-action]'); if (!btn) return; const action = btn.getAttribute('data-action'); - if (action === 'show-keyboard-help' && window.lt) lt.modal.open('lt-keys-help'); - if (action === 'open-settings' && window.lt) lt.modal.open('lt-settings-modal'); + if (action === 'open-cmdpalette' && window.lt && lt.cmdPalette) lt.cmdPalette.open(); + if (action === 'show-keyboard-help' && window.lt) lt.modal.open('lt-keys-help'); + if (action === 'open-settings' && window.lt) lt.modal.open('lt-settings-modal'); }); lt.keys.on('r', function() { lt.autoRefresh.now(); });