Add green-bean inventory and cupping features

Ports inventory management and SCA-style cupping scoring from
hope_roaster: lot tracking with audit-logged consumption, cupping
sessions with server-authoritative scoring and a live radar chart,
and links from the planner (draw-from-lot, open-cupping-session).

Also fixes the Blend/Single-origin toggle layout, replaces tooltips
with an in-context "why" teaching layer, and stages the planner UI
into pre-roast vs. post-roast phases.
This commit is contained in:
2026-07-30 14:47:15 -04:00
parent 9f0a3dbc74
commit 59645e59b5
43 changed files with 7582 additions and 566 deletions
+25
View File
@@ -0,0 +1,25 @@
// Shared teaching-layer collapse memory for every page that uses `.why-panel` (`<details>`
// with a `data-why` id): the planner and the cupping session view. One localStorage key across
// both so a user's dismissals carry over between pages.
const WHY_COLLAPSED_KEY = "roastPlannerWhyCollapsed.v1";
export function wireWhyPanels() {
let collapsed;
try {
collapsed = new Set(JSON.parse(localStorage.getItem(WHY_COLLAPSED_KEY)) || []);
} catch {
collapsed = new Set();
}
for (const panel of document.querySelectorAll(".why-panel")) {
if (collapsed.has(panel.dataset.why)) panel.open = false;
panel.addEventListener("toggle", () => {
if (panel.open) collapsed.delete(panel.dataset.why);
else collapsed.add(panel.dataset.why);
try {
localStorage.setItem(WHY_COLLAPSED_KEY, JSON.stringify([...collapsed]));
} catch {
/* unavailable storage */
}
});
}
}