Academy v4: 3 research-backed lessons (30 slides + audio); new bean logo; custom plan/lot names
Test and deploy / test-and-deploy (push) Successful in 59s
Test and deploy / test-and-deploy (push) Successful in 59s
Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5
parent
ec078116b4
commit
8b80c3fa6f
@@ -46,7 +46,7 @@ export function initLotPicker({
|
||||
.map((l) =>
|
||||
Object.assign(document.createElement("option"), {
|
||||
value: l.id,
|
||||
textContent: `${l.origin}${l.variety ? ` — ${l.variety}` : ""} (${Math.round(l.remainingWeightG)} g remaining)`,
|
||||
textContent: `${l.name || l.origin}${l.variety ? ` — ${l.variety}` : ""} (${Math.round(l.remainingWeightG)} g remaining)`,
|
||||
}),
|
||||
),
|
||||
);
|
||||
@@ -92,7 +92,7 @@ export function initLotPicker({
|
||||
consumeBtn.classList.remove("hidden");
|
||||
const weightG = Number(state.plan.fields["0.4"]);
|
||||
const lot = findLot(lotId);
|
||||
const lotLabel = lot ? lot.origin : state.plan.inventory.lotLabel || "this lot";
|
||||
const lotLabel = lot ? (lot.name || lot.origin) : state.plan.inventory.lotLabel || "this lot";
|
||||
if (Number.isFinite(weightG) && weightG > 0) {
|
||||
consumeLabel.textContent = `Charging will draw ${weightG} g from ${lotLabel}.`;
|
||||
consumeBtn.disabled = false;
|
||||
@@ -148,15 +148,16 @@ export function initLotPicker({
|
||||
const lotId = select.value;
|
||||
state.plan.inventory.lotId = lotId;
|
||||
const lot = findLot(lotId);
|
||||
const displayName = lot ? lot.name || lot.origin : "";
|
||||
state.plan.inventory.lotLabel = lot
|
||||
? `${lot.origin}${lot.variety ? ` — ${lot.variety}` : ""}`
|
||||
? `${displayName}${lot.variety ? ` — ${lot.variety}` : ""}`
|
||||
: "";
|
||||
if (lot) {
|
||||
note.textContent = `${Math.round(lot.remainingWeightG)} g remaining in this lot.`;
|
||||
const nameInput = document.querySelector('[name="0.1"]');
|
||||
if (nameInput && !nameInput.value) {
|
||||
nameInput.value = lot.origin;
|
||||
state.plan.fields["0.1"] = lot.origin;
|
||||
nameInput.value = displayName;
|
||||
state.plan.fields["0.1"] = displayName;
|
||||
}
|
||||
} else {
|
||||
note.textContent =
|
||||
|
||||
Reference in New Issue
Block a user