Stabilize playback state and cursor feedback

This commit is contained in:
2026-05-18 20:57:20 +02:00
parent 6e908037fb
commit 751ac5f62b
13 changed files with 580 additions and 82 deletions
+34 -1
View File
@@ -55,6 +55,7 @@ class UIControllerModule extends BaseModule {
'hideUI',
'clearDisplay',
'sendCommand',
'isInteractiveClickTarget',
'updateButtonStates'
]);
}
@@ -263,7 +264,7 @@ class UIControllerModule extends BaseModule {
});
this.addEventListener(document, 'click', (event) => {
if (event.target && event.target.closest && event.target.closest('#options-modal, #controls, #player_input, #command_input, #story_scrollbar')) {
if (this.isInteractiveClickTarget(event.target)) {
return;
}
@@ -635,6 +636,38 @@ class UIControllerModule extends BaseModule {
console.log('UIController: SentenceQueue pipeline configured');
}
isInteractiveClickTarget(target) {
if (!target || typeof target.closest !== 'function') {
return false;
}
return Boolean(target.closest([
'a',
'button',
'input',
'textarea',
'select',
'label',
'[role="button"]',
'[role="link"]',
'[data-control]',
'#controls',
'#player_input',
'#command_input',
'#story_scrollbar',
'#story_choices',
'#options-modal',
'.modal',
'.modal-content',
'.credits-modal',
'.credits-dialog',
'.story-popup-modal',
'.story-popup-dialog',
'.choice-button',
'.volume-toggle'
].join(',')));
}
handleCommand(command) {
// Route commands to appropriate handlers