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
+8 -2
View File
@@ -10,6 +10,7 @@ import { ui } from '../../app/ui.js';
import { getCsrfHeaders } from '../../core/csrf.js';
import { i18n } from '../../core/i18n.js';
import { multiSelect } from '../files/multiSelect.js';
import * as pathTooltip from '../pathTooltip.js';
const favorites = {
/** @type {Map<string, object>} key = "file:<id>" | "folder:<id>" */
@@ -190,7 +191,8 @@ const favorites = {
id: item.item_id,
name: item.item_name || item.item_id,
parent_id: item.parent_id || '',
modified_at: item.modified_at || item.created_at
modified_at: item.modified_at || item.created_at,
path: item.item_path || ''
});
} else {
files.push({
@@ -203,12 +205,16 @@ const favorites = {
category: item.category,
size: item.item_size || 0,
size_formatted: item.size_formatted,
modified_at: item.modified_at || item.created_at
modified_at: item.modified_at || item.created_at,
path: item.item_path || ''
});
}
}
if (folders.length) ui.renderFolders(folders);
if (files.length) ui.renderFiles(files);
const filesList = document.getElementById('files-list');
if (filesList) pathTooltip.init(filesList);
} catch (error) {
console.error('Error displaying favorites:', error);
if (ui?.showNotification) {
+6 -2
View File
@@ -10,6 +10,7 @@ import { ui } from '../../app/ui.js';
import { getCsrfHeaders } from '../../core/csrf.js';
import { i18n } from '../../core/i18n.js';
import { multiSelect } from '../files/multiSelect.js';
import * as pathTooltip from '../pathTooltip.js';
const recent = {
/** Maximum items to request from the server */
@@ -128,7 +129,8 @@ const recent = {
id: item.item_id,
name: item.item_name || item.item_id,
parent_id: item.parent_id || '',
modified_at: item.accessed_at
modified_at: item.accessed_at,
path: item.item_path || ''
});
} else {
files.push({
@@ -141,12 +143,14 @@ const recent = {
category: item.category,
size: item.item_size || 0,
size_formatted: item.size_formatted,
modified_at: item.accessed_at
modified_at: item.accessed_at,
path: item.item_path || ''
});
}
}
if (folders.length) ui.renderFolders(folders);
if (files.length) ui.renderFiles(files);
if (filesList) pathTooltip.init(filesList);
} catch (error) {
console.error('Error displaying recent files:', error);
if (ui?.showNotification) {