Skip to content

armgit / Aleph

Public Imported from GitHub
0

Give satellite imagery, terrain data, buildings, streetview photos to your LLM

Better planning warning

Belluxxa16965677179
diff --git a/src/web/app.js b/src/web/app.js
index 753b0b6..4ea8db6 100644
--- a/src/web/app.js
+++ b/src/web/app.js
@@ -655,15 +655,20 @@ async function previewPlan(event) {
function confirmPlan(planning, options) {
const total = Object.values(planning).reduce((sum, seconds) => sum + seconds, 0);
if (total < SLOW_PLAN) return Promise.resolve(true);
- const slow = Object.entries(planning).filter(([, seconds]) => seconds >= SLOW_PLAN).sort((a, b) => b[1] - a[1]);
// Levels above 20 also list every level-20 node, which multiplies the lookups.
- const level = slow.some(([mode]) => mode === "mesh") && options.mesh_level > 20;
+ const level = planning.mesh >= SLOW_PLAN && options.mesh_level > 20;
const dialog = $("#slow-plan");
const pace = speed(total);
$("h2", dialog).innerHTML = `${icon(pace.icon)}Planning will take ${pace.name}`;
$("h2", dialog).classList.toggle("alert", !!pace.alert);
- $("p", dialog).textContent = `${slow.map(([mode, seconds]) => `${NAMES[mode]} needs ${speed(seconds).name}`).join(" and ")
- } of lookups before the preview appears. Draw a smaller area${level ? " or set 3D mesh detail to 20 or lower" : ""}.`;
+ $("ul", dialog).innerHTML = Object.entries(planning).map(([mode, seconds]) => {
+ const {icon: name, alert} = speed(seconds);
+ return `<li>${icon(mode)}<span>${NAMES[mode]}</span>
+ <span class="estimate ${alert ? "alert" : ""}">${icon(name)}${speed(seconds).name}</span></li>`;
+ }).join("");
+ const lookups = [planning.streetview != null && "panoramas", planning.mesh != null && "mesh nodes"].filter(Boolean).join(" and ");
+ $("p", dialog).textContent = `Every one of the area's ${lookups} is looked up before the preview appears. ${
+ level ? "Try 3D mesh detail 20 or lower, or a smaller area." : "Try a smaller area."}`;
dialog.returnValue = "";
dialog.showModal();
return new Promise(resolve => dialog.addEventListener("close", () => resolve(dialog.returnValue === "plan"), {once: true}));
diff --git a/src/web/index.html b/src/web/index.html
index 4724f72..19601d5 100644
--- a/src/web/index.html
+++ b/src/web/index.html
@@ -213,6 +213,7 @@
<dialog id="slow-plan">
<form method="dialog">
<h2></h2>
+ <ul class="stages compact"></ul>
<p class="detail"></p>
<div class="buttons">
<button value="plan" class="subtle">Preview anyway</button>
diff --git a/src/web/style.css b/src/web/style.css
index aa94a1c..6f5bc5b 100644
--- a/src/web/style.css
+++ b/src/web/style.css
@@ -456,6 +456,7 @@ dialog {
dialog::backdrop { background: color-mix(in srgb, var(--ink) 30%, transparent); }
dialog h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font: 600 15px var(--sans); }
dialog h2 .icon { width: 20px; height: 20px; }
+dialog .stages { margin-bottom: 12px; padding: 4px 0; border-block: 1px solid var(--line); }
dialog .buttons { display: flex; justify-content: space-between; gap: 8px; margin-top: 18px; }
.viewer {