refactor(engine): collapse 13 dispatch-shaped setters into a table#41
Merged
refactor(engine): collapse 13 dispatch-shaped setters into a table#41
Conversation
Declarative descriptor table for the 13 boring "write field + fire callback + requestRender" setters in the public handle. Bespoke setters with side-effects stay inline. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace 13 inline setters with `...buildSettersFromTable(...)` spread. Bespoke setters (setBiasMode, setTier, setLodMode, setSourceVisible, setSpaceMouseSensitivity) stay inline. engine.ts -124 lines. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
skymap | 89a7d16 | Commit Preview URL Branch Preview URL |
May 07 2026, 11:22 PM |
…site Honour the safety net the settingsTable docstring already advertises. The widened `(value: unknown) => void` return type is contravariant- assignable to EngineHandle's narrower per-method signatures, but the key-set match wasn't being checked at the spread site — `satisfies` adds that check now, so a future drift (renamed key, accidentally omitted entry) trips tsc here instead of at distant callers. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
settingsTable.tsdeclares the 13 "field write + callback + render-request" setters as a typed descriptor table with optional clamps.engine.tspublic handle spreadsbuildSettersFromTable(...); bespoke setters (setBiasMode,setTier,setLodMode,setSourceVisible,setSpaceMouseSensitivity) stay inline.Test plan
settingsTable.test.tspasses (4/4 unit tests for the builder + clamps + missing-callback tolerance)npx tsc --noEmitcleanNotes vs. plan
clampfield to the descriptor (the plan omitted clamps, butsetExposureandsetFilamentIntensityneed them and the spec author flagged "trust the code over the plan").EngineCallbacksshape (noonFilamentsEnabledChange/onFilamentIntensityChange— those are App-owned with no echo).Spec: `docs/superpowers/specs/2026-05-08-engine-internal-restructure-design.md`
🤖 Generated with Claude Code