Instruction file imported from d8ahazard/glimmr (
.cursor/rules/web-ui.mdc). Copyright stays with the author.
Glimmr.Web Conventions
- This is Preact (with
@preact/signals), not React. Usepreact/hooks,class=(notclassName), and signals for global state (lib/store.ts). - Backend contract: SignalR hub at
/socketpushes camelCase JSON (olo= full store); actions invoke hub methods with REST fallback toPOST /api/Glimmr/{method}. Types insrc/types.tsmust mirror the C# models (camelCase). - Build output goes to
../Glimmr/wwwroot/app(base/app/);dotnet publishrunsnpm ci && npm run buildautomatically (skip with-p:SkipGlimmrWeb=true). - Form inputs that write to SystemData must commit on blur/Enter or debounce
(see
CountCell/TextFieldincomponents/ui.tsx) - never per keystroke, every commit is a hub round-trip.
Mapping conventions
- LED master grid: 0-based, starts bottom-right corner, walks counter-clockwise
(right side up, top right-to-left, left down, bottom left-to-right). Geometry in
lib/maps.tsmirrorsFrameSplitter.DrawGrid- keep them in sync. - Sectors: 1-based, start bottom-right, counter-clockwise (
DrawSectors). - Device brightness sliders are 0-100. Hue V1 per-light override brightness is 0-255
(
mappedLights), Hue V2 usesgroups[].services.