feat: fixtures & color patching - #262
Open
MD4 wants to merge 14 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixtures & color patching: patch lights instead of raw DMX channels, and program color directly.
Shows now hold fixtures (built-in profiles: Dimmer, RGB, RGBW, RGB+Dimmer, RGBW+Dimmer) placed at a start address, and the patch wires program outputs to fixture capabilities (color / dimmer / channel). A new COLOR program node composes a color in RGB or HSV (wireable inputs, live swatch preview) so one wire drives a whole RGB(W) fixture. The patch page becomes a fixture rack with add/edit dialogs, next-free-address suggestion, overlap warnings and color-aware connection validation — and the whole 512-channel universe is now addressable from the UI (previously capped at 64).
Runtime approach is compile-to-channels: fixtures + capabilities resolve to physical channel addresses once at show load (
compileShowPatch), so the per-tick runner and DMX path are untouched (runner.service.ts: zero changes). Profiles are shaped like Open Fixture Library "modes" so an OFL importer can come later without a schema change.Type of Change
Breaking for stored files only: show files are migrated automatically (see below); files written by 0.4.0 won't load on ≤0.3.0.
Changes Made
lib-models: fixture profiles + capability resolution,showFixture, capability-basedshowPatch(typed entries make color→dimmer wires unrepresentable),output-colornode, showsuperRefine(duplicate ids, unknown profile, universe overflow)lib-domains:output-colorevaluation into a newProgramOutput.colorsnamespace (HSV→RGB via newlib-utilshelper),compileShowPatch/applyMapping/getMappingChannelsrewrite, newfixturedomain (channels, overlaps)lib-shared: 0.4.0 migration — each used channel becomes a 1-channel "Channel N" dimmer fixture, byte-identical DMX output (compile-equivalence tested); plus two migration-system fixes: files stamped with the999.999.999sentinel re-run the chain on load (treated as unknown), and writes stamp the resource's newest migration version whenAPP_VERSIONis unknown — so dev-written files are never exempted from future migrationsservice-main: swap tocompileShowPatchat show load + color-awareresetProgram(2 call sites; runner untouched)ui-admin: fixture rack patch page (modal with profile preview chips, overlap warning, next-free suggestion), COLOR node with live color-strip preview, color-typed handles + connection validation, dashboard renders the rig, stable node heights, new Jest harness (first ui-admin tests)docs/superpowers/specs/, AGENTS.md migration notes updatedTesting
~200 new tests across lib-utils / lib-models / lib-domains / lib-shared / ui-admin (incl. migration fixtures, compile-equivalence, an hsv hue-sweep integration test, and adapter/validation round-trips). Manually tested against real
~/.ptahdata: legacy shows (incl. one poisoned with the sentinel stamp) heal on load with backups written; fixture rack + color node verified in the running app.Checklist
Related Issues
—
Screenshots (if applicable)
—
Additional Notes
@ptah-app/app0.4.0. The show migration is keyed to0.4.0; if the release number changes, updateshow.migrations.ts, its fixture test and the repository-test pin together.~/.ptah/.backups/shows/). Legacy patch entries on channels outside 1..512 (which never reached the wire) are dropped.feat/node-input-audiobranch:node.model.ts,lib-modelsindex,program.domain.tseval switch, ui node registry — distinct hunks, should auto-merge; re-run lib-domains tests after merging.