Add brewing section, plan chat, roaster learning, API tokens, Swagger docs, and full backup
Test and deploy / test-and-deploy (push) Successful in 1m6s
Test and deploy / test-and-deploy (push) Successful in 1m6s
Brewing: - roasted_beans + brews tables; /beans (bean management with LLM URL prefill) and /brews (silhouette brewer picker across immersion/ percolation/espresso, recipe fields, auto ratio, 0-10 rating, tasting notes); bean remaining weight derived from logged brew doses - Green inventory lot form also prefills from a product URL Navigation/UX: - Side nav is now generated from one definition in nav.js, grouped Roasting / Brewing / account, consistent on every page LLM: - 'Ask the LLM' chat drawer on the planner (stateless /api/plan-chat) grounded in the plan, computed ledger, learned pace, and a new roaster-behavior profile aggregated from uploaded .alogs (/api/roaster-profile: TP lag, phase RoR, median milestone temps) - The profile also feeds roast reviews and the planner curve's fallback milestone temps API platform: - User-generated bearer tokens (rpt_…) with account-page management; token requests skip CSRF; hand-authored OpenAPI 3 spec at /api/openapi.json rendered by self-hosted Swagger UI at /api-docs - Full-database backup export/import (admin) + per-user data export Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5
parent
5efaeb63c9
commit
38c7d01e03
@@ -1,6 +1,73 @@
|
||||
// Shared side-nav behavior (collapse/expand, mobile drawer) for every authenticated page
|
||||
// (planner, account, admin) so each page's own script doesn't reimplement it.
|
||||
|
||||
// Single source of truth for the page links, grouped by workflow — every page renders this
|
||||
// into its <div id="nav-links"> instead of hand-maintaining a diverging copy of the nav.
|
||||
// Page-specific tool buttons (the planner's drawers) stay in that page's own markup below it.
|
||||
const NAV_GROUPS = [
|
||||
{
|
||||
title: "Roasting",
|
||||
items: [
|
||||
{ href: "/app", icon: "◐", label: "Planner" },
|
||||
{ href: "/roasts", icon: "∿", label: "Roasts" },
|
||||
{ href: "/inventory", icon: "▥", label: "Green lots" },
|
||||
{ href: "/cupping", icon: "◒", label: "Cupping" },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: "Brewing",
|
||||
items: [
|
||||
{ href: "/brews", icon: "◉", label: "Brews" },
|
||||
{ href: "/beans", icon: "◍", label: "Beans" },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: null,
|
||||
items: [
|
||||
{ href: "/account", icon: "◔", label: "Account" },
|
||||
{ href: "/api-docs", icon: "⌗", label: "API docs" },
|
||||
{ href: "/admin", icon: "⚙", label: "Admin", id: "nav-admin", hidden: true },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
export function renderNavLinks() {
|
||||
const mount = document.getElementById("nav-links");
|
||||
if (!mount) return;
|
||||
mount.replaceChildren(
|
||||
...NAV_GROUPS.map((group) => {
|
||||
const wrap = document.createElement("div");
|
||||
wrap.className = "nav-group";
|
||||
if (group.title) {
|
||||
const title = document.createElement("div");
|
||||
title.className = "nav-group-title";
|
||||
title.textContent = group.title;
|
||||
wrap.append(title);
|
||||
}
|
||||
for (const item of group.items) {
|
||||
const a = document.createElement("a");
|
||||
a.className = "nav-item";
|
||||
if (item.hidden) a.classList.add("hidden");
|
||||
if (item.id) a.id = item.id;
|
||||
a.href = item.href;
|
||||
if (item.href === location.pathname) a.setAttribute("aria-current", "page");
|
||||
const icon = document.createElement("span");
|
||||
icon.className = "nav-icon";
|
||||
icon.setAttribute("aria-hidden", "true");
|
||||
icon.textContent = item.icon;
|
||||
const label = document.createElement("span");
|
||||
label.className = "nav-label";
|
||||
label.textContent = item.label;
|
||||
a.append(icon, label);
|
||||
wrap.append(a);
|
||||
}
|
||||
return wrap;
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export function initSideNav() {
|
||||
renderNavLinks();
|
||||
const nav = document.getElementById("side-nav");
|
||||
const hamburger = document.getElementById("nav-hamburger");
|
||||
const collapseBtn = document.getElementById("nav-collapse");
|
||||
|
||||
Reference in New Issue
Block a user