// The arrangements that ship with the widget. // // Each is stored the same way a saved preset is — as the QUERY STRING // buildWidgetQuery would produce — so a built-in and something you saved // yourself are the same kind of thing, and loading either is just "parse this // link". Built-ins are load-only: Save writes a new named preset rather than // editing one of these, so the starting points stay where you left them. // // builtInPresets.test.ts asserts every query here parses and re-serializes to // ITSELF. That is the guard against a preset drifting away from the registry: a // renamed param, a changed default or a section that stops existing would // otherwise leave a preset that quietly loads as something else. export type BuiltInPreset = { id: string; name: string; // One line: what this is for, shown beside the name. hint: string; // Without a leading "?". "" is the all-default widget. query: string; }; export const BUILT_IN_PRESETS: BuiltInPreset[] = [ { id: "glance", name: "Glance", hint: "One dense rail of totals and a row of worker dots. A 320×120 corner pin.", query: "jobs=0&titles=0&clean=1&wnames=0&backfill=1&lastsync=1&g=lsync.disk.cln.bf.wk*r", }, { id: "jobs", name: "Jobs", hint: "Workers and active jobs in one column — the default arrangement, and the way back to it.", // Deliberately empty: the default IS this preset, and an empty query is what // "start over" has to mean if a bare /widget link is to keep working. query: "", }, { id: "cockpit", name: "Cockpit", hint: "Controls across the top, a rail of totals, then the scheduler beside two scrolling worklists.", query: "jobs=0&workers=0&clean=1&controls=1&backfill=1&act=1&cleanlist=1&sync=1&lastsync=1&sched=1&g=ctl*2_lsync.disk.cln.bf*2r_sched*f-act.clnl", }, { id: "cleanup", name: "Cleanup", hint: "What you could reclaim, the controls to do it, and a full-height list of the channels holding it.", query: "jobs=0&workers=0&clean=1&controls=1&cleanlist=1&g=cln.disk*r_ctl_clnl*f", }, { id: "wall", name: "Wall", hint: "Three columns, titles on, no controls and no gear. For a spare monitor.", query: "clean=1&act=1&cleanlist=1&gear=0&lastsync=1&sched=1&g=lsync.sched.disk.cln*3r_wk.jobs*f-act-clnl", }, ]; export function builtInPresetById(id: string): BuiltInPreset | undefined { return BUILT_IN_PRESETS.find((p) => p.id === id); }