fix(filters): improve base model filtering UX

This commit is contained in:
Will Miao
2026-04-17 20:27:48 +08:00
parent 89fd2b43d6
commit 0bcd8e09a9
22 changed files with 479 additions and 48 deletions

View File

@@ -25,6 +25,7 @@ export function initializeEventManagement() {
setupPageUnloadCleanup();
// Register global event handlers that need coordination
registerGlobalEventHandlers();
registerContextMenuEvents();
registerGlobalClickHandlers();
@@ -148,6 +149,10 @@ function registerGlobalClickHandlers() {
* Register common application-wide event handlers
*/
export function registerGlobalEventHandlers() {
eventManager.removeHandler('keydown', 'global-escape');
eventManager.removeHandler('focusin', 'global-focus');
eventManager.removeHandler('click', 'global-analytics');
// Escape key handler for closing modals/panels
eventManager.addHandler('keydown', 'global-escape', (e) => {
if (e.key === 'Escape') {
@@ -156,6 +161,14 @@ export function registerGlobalEventHandlers() {
modalManager.closeCurrentModal();
return true; // Stop propagation
}
if (
window.filterManager?.filterPanel
&& !window.filterManager.filterPanel.classList.contains('hidden')
) {
window.filterManager.closeFilterPanel();
return true; // Stop propagation
}
// Check if node selector is active and close it
if (eventManager.getState('nodeSelectorActive')) {