show item path on Recent + Favorites, add go to parent folder, fix Folder browsing in Favorites

This commit is contained in:
Edouard Vanbelle
2026-05-06 17:43:30 +02:00
parent 405721c679
commit 8e1e9fe201
28 changed files with 217 additions and 23 deletions
+18
View File
@@ -5,6 +5,7 @@
import { resolveHomeFolder } from '../../app/authSession.js';
import { loadFiles } from '../../app/filesView.js';
import { switchToFilesSection } from '../../app/navigation.js';
import { app } from '../../app/state.js';
import { showConfirmDialog, ui } from '../../app/ui.js';
import { getCsrfHeaders } from '../../core/csrf.js';
@@ -64,6 +65,13 @@ const contextMenus = {
}
},
syncOpenParentFolderOption() {
const option = document.getElementById('open-parent-folder-option');
if (!option) return;
const folderId = app?.contextMenuTargetFile?.folder_id;
option.classList.toggle('hidden', !folderId);
},
syncAddToPlaylistOption() {
const option = document.getElementById('add-to-playlist-option');
if (!option) return;
@@ -198,6 +206,16 @@ const contextMenus = {
ui.closeFileContextMenu();
});
document.getElementById('open-parent-folder-option').addEventListener('click', () => {
const folderId = app.contextMenuTargetFile?.folder_id;
ui.closeFileContextMenu();
if (folderId) {
switchToFilesSection();
app.currentPath = folderId;
loadFiles();
}
});
document.getElementById('favorite-file-option').addEventListener('click', async () => {
if (app.contextMenuTargetFile) {
const file = app.contextMenuTargetFile;