From 0fba4ce7bca61f6f2e3695752901d3f2b0ead146 Mon Sep 17 00:00:00 2001 From: Edouard Vanbelle Date: Tue, 19 May 2026 11:16:27 +0200 Subject: [PATCH] fix(ui): clear empty state on folder creation --- static/js/app/ui.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/static/js/app/ui.js b/static/js/app/ui.js index 23feb81c..a878f867 100644 --- a/static/js/app/ui.js +++ b/static/js/app/ui.js @@ -1527,6 +1527,7 @@ const ui = { return; } + this._clearEmptyState(); this._items.set(folder.id, folder); this._upsertById(this._lastFolders, folder); this._renderFoldersToView([folder]); @@ -1545,9 +1546,23 @@ const ui = { return; } + this._clearEmptyState(); this._items.set(file.id, file); this._upsertById(this._lastFiles, file); this._renderFilesToView([file]); + }, + + /** + * If the empty-state placeholder is showing, switch back to the file list. + * Called before adding any new item so the card is not appended to a hidden list. + */ + _clearEmptyState() { + const filesList = document.getElementById('files-list'); + const filesContainerError = document.getElementById('files-container-error'); + if (filesList?.classList.contains('hidden')) { + filesList.classList.remove('hidden'); + filesContainerError?.classList.add('hidden'); + } } };