Dashboard tasks follow the switches like voice (both off: refused; Greeter: in place only); From / To back in the Command dialog; battery percent and charging from the base

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 14:37:53 +09:00
co-authored by Claude Opus 5.5
parent 7319f143d9
commit 08e748e5ed
16 changed files with 301 additions and 33 deletions
+14 -1
View File
@@ -979,6 +979,19 @@ function whereOf(seg, sel, pick) {
return p && {x: +p.x.toFixed(3), y: +p.y.toFixed(3), theta: +p.theta.toFixed(3)};
}
let cmdSeq = 0, cmdTimer = null, parsed = null, heldNow = false, cmdLLM = false; // cmdLLM: Enter pressed // heldNow: Lumi holds the object, From unused
function setWhere(seg, sel, w) { // a place the text named, shown in its picker
const m = w === "here" ? "here" : w && w.marker ? "marker" : null;
if (!m) return;
$(seg).querySelectorAll("button").forEach(x => x.classList.toggle("on", x.dataset.v === m));
if (m === "marker") $(sel).value = w.marker;
}
function fillPickers(r) { // a typed fetch shows its places in From / To
const t = r.task, from = r.from_text || [];
if (from.includes("source")) setWhere("tSrcSeg", "tSrcMarker", t.source);
if (from.includes("dest")) setWhere("tDstSeg", "tDstMarker", t.dest);
paintWhere("tSrcSeg", "tSrcMarkerRow", "tSrcPickBox", srcPick, "tSrcPt");
paintWhere("tDstSeg", "tDstMarkerRow", "tDstPickBox", dstPick, "tDstPt");
}
function cmdChanged() { // repaint the pickers, then read the text again (after typing stops)
paintWhere("tSrcSeg", "tSrcMarkerRow", "tSrcPickBox", srcPick, "tSrcPt");
paintWhere("tDstSeg", "tDstMarkerRow", "tDstPickBox", dstPick, "tDstPt");
@@ -992,7 +1005,6 @@ function parseCmd() {
$("tProblems").innerHTML = probs.map(p => `<div>${esc(p)}</div>`).join("");
$("tStart").disabled = probs.length > 0 || !parsed || !parsed.action;
$("tStart").textContent = {give: "Give", place: "Place", carry: "Go"}[parsed && parsed.action] || "Start";
$("tWhere").style.display = parsed && ["fetch", "carry"].includes(parsed.action) ? "" : "none";
paintSteps();
};
parsed = null;
@@ -1001,6 +1013,7 @@ function parseCmd() {
$("tSentence").textContent = "…";
api("/tasks/parse", {text, source: source || null, dest: dest || null, llm: cmdLLM}).then(r => {
if (n !== cmdSeq) return;
if (r.action === "fetch" && r.task) fillPickers(r);
parsed = r; show(r.sentence, r.problems);
}).catch(e => show("–", [e.message]));
}