From 7633f003992361a0f4ffc269f80a41aee0ebbcbe Mon Sep 17 00:00:00 2001 From: Edouard Vanbelle Date: Thu, 2 Apr 2026 22:40:16 +0200 Subject: [PATCH] feat(fileList): add action column to display context menu --- static/css/components/fileList.css | 39 +++++++++++++++++++++++++++++- static/index.html | 1 + static/js/app/ui.js | 17 ++++++++++++- 3 files changed, 55 insertions(+), 2 deletions(-) diff --git a/static/css/components/fileList.css b/static/css/components/fileList.css index 48cddcfb..fee4d12a 100644 --- a/static/css/components/fileList.css +++ b/static/css/components/fileList.css @@ -1,6 +1,6 @@ /* File list - Improved style */ .files-list-view { - --files-list-columns: 36px minmax(200px, 2fr) 100px 110px 160px; + --files-list-columns: 36px minmax(200px, 2fr) 100px 110px 130px 36px; display: flex; flex-direction: column; width: 100%; @@ -73,6 +73,10 @@ overflow: hidden; } +.file-item .action-cell { + align-items: center; +} + .file-item .name-cell span { white-space: nowrap; overflow: hidden; @@ -307,6 +311,11 @@ display: none; } +.list-header > div:nth-child(5), +.file-item .date-cell { + justify-self: center; + text-align: center; +} .file-item .date-cell { color: #718096; font-size: 14px; @@ -335,6 +344,25 @@ border: 2px dashed #ffc107; } +/* More actions button (three dots) */ +.file-more { + width: 30px; + height: 30px; + border-radius: 8px; + border: none; + background: transparent; + align-items: center; + justify-content: center; + transition: opacity 0.15s, background 0.15s; + cursor: pointer; + color: #64748b; + font-size: 16px; +} + +.file-more:hover { + background: #e0e5e8; + color: #334155; +} [data-theme="dark"] .files-list-view { background-color: #1e293b; @@ -385,3 +413,12 @@ background-color: rgba(255, 193, 7, 0.05); } +[data-theme="dark"] .file-more { + color: #94a3b8; +} + +[data-theme="dark"] .file-more:hover { + background: #334155; + color: #e2e8f0; +} + diff --git a/static/index.html b/static/index.html index b9734f55..a9fdb626 100644 --- a/static/index.html +++ b/static/index.html @@ -270,6 +270,7 @@
Type
Size
Modified
+
diff --git a/static/js/app/ui.js b/static/js/app/ui.js index b3f284bc..1ab842f0 100644 --- a/static/js/app/ui.js +++ b/static/js/app/ui.js @@ -890,6 +890,19 @@ const ui = { const card = e.target.closest('.file-item'); if (!card) return; + if (e.target.closest('.file-more')) { + e.stopPropagation(); + e.preventDefault(); + const info = itemInfo(card); + if (!info) return; + setContextTarget(card, info); + const menuId = info.type === 'folder' + ? 'folder-context-menu' : 'file-context-menu'; + showContextMenuAtElement( + e.target.closest('.file-more'), menuId); + return; + } + if (e.target.closest('.list-item-checkbox') || e.target.closest('.item-checkbox')) { toggleCardSelection(card, e); @@ -1115,7 +1128,7 @@ const ui = {
${escapeHtml(folder.name)}
-
Folder
+
${window.i18n ? window.i18n.t('files.file_types.folder') : 'Folder'}
`; if (window.app.currentPath !== "") { @@ -1153,6 +1166,7 @@ const ui = {
${window.i18n ? window.i18n.t('files.file_types.folder') : 'Folder'}
--
${formattedDate}
+
`; return el; }, @@ -1228,6 +1242,7 @@ const ui = {
${typeLabel}
${fileSize}
${formattedDate}
+
`; var thumb = el.querySelector('.file-thumb'); if (thumb) thumb.addEventListener('error', function() { this.style.display = 'none'; });