From bd15a4509055800ea0ce0763b08d41ed65b76c8b Mon Sep 17 00:00:00 2001 From: Stefan Kratochwil Date: Wed, 14 Jan 2026 00:16:35 +0100 Subject: [PATCH] feat: filesystem browser button in nav bar Previously, the playlist_filebrowser always contained a 'cancel' and 'add tracks' button, because it was used in context of the playlist editor only. The playlist_filebrowser now differentiates between the intents it is being used with. In context of the new filesystem browser button, the 'cancel' and 'add tracks' buttons are actively hidden. --- software/frontend/index.html | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/software/frontend/index.html b/software/frontend/index.html index 43de408..a36fa06 100644 --- a/software/frontend/index.html +++ b/software/frontend/index.html @@ -147,6 +147,7 @@ + @@ -243,7 +244,7 @@
-

Playlist Editor

+

Playlist Editor

@@ -787,6 +788,8 @@ PLAYLIST EDITOR LOGIC - ADD FILES SCREEN ------------------------------------------- */ Screens.playlist_filebrowser = (() => { + let isFilesystemMode = false; + function init() { document.getElementById('playlist-filebrowser-cancel').addEventListener("click", (e) => { showScreen("playlist_edit", {}); @@ -805,13 +808,32 @@ }); tree.init(); } - + async function onShow(intent) { + console.log(intent) document.getElementById('playlist-filebrowser-addtrack').disabled = true; + + const title = document.getElementById('playlist-filebrowser-title'); + const cancelButton = document.getElementById('playlist-filebrowser-cancel'); + const addTracksButton = document.getElementById('playlist-filebrowser-addtrack'); + if (intent !== 'refresh') { + isFilesystemMode = (intent === 'filesystem'); + document.getElementById('playlist-filebrowser-upload-progress').value = 0; document.getElementById("playlist-filebrowser-upload-files").value = ""; } + + if (isFilesystemMode) { + title.innerText = "Filesystem"; + cancelButton.style.display = 'none'; + addTracksButton.style.display = 'none'; + } else { + title.innerText = "Playlist Editor"; + cancelButton.style.display = '' + addTracksButton.style.display = '' + } + tree = document.getElementById("playlist-filebrowser-tree"); tree.innerHTML = "Loading..."; fetch('/api/v1/audiofiles')