when a user clicks on a source, don't swap focus

This commit is contained in:
perf3ct 2025-03-10 05:57:16 +00:00
parent bd97d971ed
commit 08626c7a2d
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232

View File

@ -313,7 +313,12 @@ export default class LlmChatPanel extends BasicWidget {
// Add click handler for better user experience
sourceElement.querySelector('.source-link')?.addEventListener('click', (e) => {
e.preventDefault();
appContext.tabManager.openTabWithNoteWithHoisting(source.noteId);
e.stopPropagation();
// Open the note in a new tab but don't switch to it
appContext.tabManager.openTabWithNoteWithHoisting(source.noteId, { activate: false });
return false; // Additional measure to prevent the event from bubbling up
});
this.sourcesList.appendChild(sourceElement);