feat(ui): drop from system available only on files section

* prevent dropzone if not on files section
 * show a notification to user to use files section
 * solve #357
This commit is contained in:
Edouard Vanbelle
2026-05-09 19:18:33 +02:00
parent a6eb81a13a
commit 6e4699ff9c
16 changed files with 53 additions and 17 deletions
+8 -2
View File
@@ -437,11 +437,11 @@ const ui = {
}, 500);
});
// Document-wide drag and drop
// Document-wide drag and drop — only active in the Files section
document.addEventListener('dragover', (e) => {
e.preventDefault();
if (!e.dataTransfer) return;
if (e.dataTransfer.types.includes('Files')) {
if (e.dataTransfer.types.includes('Files') && app.currentSection === 'files') {
dropzone?.classList.remove('hidden');
dropzone?.classList.add('active');
}
@@ -466,6 +466,12 @@ const ui = {
if (handledDropEvents.has(e)) return;
if (!e.dataTransfer) return;
if (app.currentSection !== 'files') {
if (e.dataTransfer.types.includes('Files')) {
this.showNotification(i18n.t('notifications.upload_files_section_title'), i18n.t('notifications.upload_files_section_body'));
}
return;
}
if (e.dataTransfer.files.length > 0) {
// First try directory-aware extraction (Finder folder drag & drop)
const droppedEntries = await collectDroppedEntries(e.dataTransfer);