From 449b9dc2ff8e7f06524396bba9e2599696aa8008 Mon Sep 17 00:00:00 2001 From: isaacclad Date: Mon, 8 Jun 2026 22:06:23 +0000 Subject: [PATCH] Use standard folder input instead of showDirectoryPicker for uploads. Avoids the broader browser file-access permission dialog; the custom Ladill confirm modal still runs after folder selection. Co-authored-by: Cursor --- resources/js/app.js | 43 ------------------------------------------- 1 file changed, 43 deletions(-) diff --git a/resources/js/app.js b/resources/js/app.js index 85a3559..87de3e5 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -660,52 +660,9 @@ Alpine.data('filesManager', (config = {}) => ({ triggerFolderUpload() { this.createMenuOpen = false; - if (typeof window.showDirectoryPicker === 'function') { - this.pickFolderWithApi(); - return; - } - this.$refs.folderUploadInput?.click(); }, - async pickFolderWithApi() { - try { - const handle = await window.showDirectoryPicker(); - const files = await this.collectDirectoryFiles(handle); - if (files.length === 0) { - this.showToast('That folder is empty.'); - return; - } - - this.openUploadConfirm(files, handle.name, true); - } catch (error) { - if (error?.name !== 'AbortError') { - this.showToast('Could not read that folder.'); - } - } - }, - - async collectDirectoryFiles(dirHandle, path = '') { - const files = []; - - for await (const entry of dirHandle.values()) { - const entryPath = path ? `${path}/${entry.name}` : entry.name; - - if (entry.kind === 'file') { - const file = await entry.getFile(); - Object.defineProperty(file, 'webkitRelativePath', { - value: entryPath, - configurable: true, - }); - files.push(file); - } else if (entry.kind === 'directory') { - files.push(...await this.collectDirectoryFiles(entry, entryPath)); - } - } - - return files; - }, - openFolderModal() { this.createMenuOpen = false; this.folderModalOpen = true;