- Throughput: new "Throughput Overview" header with Gauge icon and brand-green badge icons on each card (Today, This week, 4-week average, Horse Mix, Grain Mix) - Throughput: inline rolling-range selector (7d / 4w / 6w / 12w, default 4 weeks) driving the customer-mix cards; stats window widened to 12 weeks so switching range is a pure client-side re-filter - Throughput: cards collapse to a single even 5-across row on laptop and up, with container-query value text that scales to each card's width - Throughput: date logic pinned to Australian Eastern time (fixes the day-early date); This week subtitle shows the Mon-Sun date range - Throughput: subtler tinted add-form; removed the inline-entry kicker and the "Open full form" link - Topbar: fix cramped laptop header - action toggles no longer wrap above the user button; search drops to its own row earlier Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
30 lines
733 B
TypeScript
30 lines
733 B
TypeScript
import { redirect } from '@sveltejs/kit';
|
|
import { api } from '$lib/api';
|
|
import { getStoredClientSession, hasStoredClientSession } from '$lib/session';
|
|
import { canOpenEditor, getWorkspaceHomeHref } from '$lib/workspace-access';
|
|
|
|
export async function load({ fetch }) {
|
|
if (!hasStoredClientSession()) {
|
|
return { rows: [] };
|
|
}
|
|
|
|
const session = getStoredClientSession();
|
|
if (!canOpenEditor(session)) {
|
|
throw redirect(307, getWorkspaceHomeHref(session));
|
|
}
|
|
|
|
try {
|
|
const [rows, rawMaterials] = await Promise.all([
|
|
api.editorMixes({ limit: 1000 }, fetch),
|
|
api.rawMaterials(fetch)
|
|
]);
|
|
|
|
return {
|
|
rows,
|
|
rawMaterials
|
|
};
|
|
} catch {
|
|
return { rows: [], rawMaterials: [] };
|
|
}
|
|
}
|