Add self-healing path relocation for multi-disk portability, macOS native folder picker, and double-clickable launch.command

This commit is contained in:
drjones
2026-07-20 21:18:12 -07:00
parent 82e93972c1
commit 2d3ef6a06c
3 changed files with 68 additions and 7 deletions

View File

@@ -341,6 +341,7 @@ mark{background:rgba(34,211,238,.28);color:#fff;border-radius:2px;padding:0 1px}
<div class="controls">
<div class="folderRow">
<input id="folder" spellcheck="false" placeholder="/path/to/your/photos">
<button id="btnBrowseFolder" title="Open native macOS folder chooser">📁 Browse</button>
<button id="btnScan">◈ Scan Directory</button>
</div>
<button id="btnStart" class="btn-primary" disabled>▶ Start Pipeline</button>
@@ -991,6 +992,20 @@ async function api(path, body){
return j;
}
if($("btnBrowseFolder")){
$("btnBrowseFolder").onclick = async ()=>{
$("btnBrowseFolder").disabled = true;
const j = await api("/api/choose_folder");
$("btnBrowseFolder").disabled = false;
if(j.ok && j.folder){
$("folder").value = j.folder;
showToast("Selected folder: " + j.folder, "ok");
const scanRes = await api("/api/scan",{folder: j.folder});
if(scanRes.images!=null){ scanned=true; setBadge("idle"); }
}
};
}
$("btnScan").onclick = async ()=>{
const j = await api("/api/scan",{folder:$("folder").value});
if(j.images!=null){ scanned=true; setBadge("idle"); }