fix(viewer): rendu unifié type markdown pour fichiers texte/JSON/CSV + autofocus arborescence apres import (#89)
CI / lint (push) Successful in 1m18s
CI / security (push) Successful in 51s
CI / test (push) Successful in 2m44s
CI / build (push) Successful in 48s
CI / e2e (push) Successful in 10m32s

This commit is contained in:
2026-09-14 18:15:21 -04:00
parent 93fc562c44
commit 96bb1cbcae
4 changed files with 21 additions and 47 deletions
+10 -1
View File
@@ -11,7 +11,7 @@
import { api } from './auth.js';
import { t } from './i18n.js';
import { showToast } from './ui.js';
import { refreshSidebarTreePreservingState } from './sidebar.js';
import { refreshSidebarTreePreservingState, focusPathInSidebar } from './sidebar.js';
/**
* Recursively read all FileSystemEntry items (files and directories) from DataTransferItemList.
@@ -209,6 +209,15 @@ export async function handleVaultDropUpload(vault, targetDir, items) {
showToast(`${t('upload.error') || 'Upload failed'}: ${errDetail}`, 'error');
}
await refreshSidebarTreePreservingState();
if (chosenTargetDir) {
try {
await focusPathInSidebar(chosenVault, chosenTargetDir, { alignToTop: true, expandTarget: true });
} catch (_) { /* ignore */ }
} else if (res?.uploaded?.[0]) {
try {
await focusPathInSidebar(chosenVault, res.uploaded[0], { alignToTop: true, expandTarget: true });
} catch (_) { /* ignore */ }
}
} catch (err) {
console.error('Batch upload error:', err);
showToast(`${t('upload.error') || 'Upload failed'}: ${err.message || err}`, 'error');