Conversation
Separate node layout (relative pin offsets) from geometry (absolute positions), replacing the single geometry calculator with a layout → geometry two-step. Switch node SVG wrapper from <g> to <svg> so child elements can use percentage dimensions. Update Display node to compute its size from config resolution and add a config settings button stub. Disable the ViewModeSwitcher play button when any input pin is unconnected. Remove redundant node/connection event listeners from the simulation trigger. Key changes covered: - Layout / LayoutSource types split out from Geometry, with nodePinOffsetById replacing absolute positions - <g> → <svg> in Node/index.tsx so Default can use width="100%" - Display/geometry.ts now scales with config.resolution and exports layout constants - New ConfigSettingButton component for Display nodes - isEachInputPinConnected utility in component.ts gating the play button - executeSimulation decoupled from raw store events in the core slice
Deploying create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee with
|
| Latest commit: |
6f7b936
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://86813bcf.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev |
| Branch Preview URL: | https://20260606.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev |
- Make the display ConfigSettingButton functional: open a Popover form
to edit resolution (x/y) and persist via store.nodes.update
- Compute display node size from config inside the layout calculator
- Cache getNodePinBitWidthStatus results, invalidating on node/pin/
connection register/unregister/update events
- Switch input value bit-width init to getNodePinBitWidthStatus and
deprecate getComponentPinBitWidthStatus
- Convert InputValueKey from a tuple to a { componentPinId, timeStep }
object with a serializeInputValueKey helper
- Add a reactive useCanSimulate selector and use it to drive the
ViewModeSwitcher disabled state
- Add CONST intrinsic component with fixed-bit-width output driven by configured data, plus a dedicated renderer and layout calculator - Pass node config to intrinsic evaluate functions - Fix Display renderer pixel indexing to use row-major order directly - Remove FlipFlop debug log; log pin bit widths on fixed-width mismatch
The bit width of a pin was resolved by getComponentPinBitWidthStatus, which only knows the component pin definition. A `fixed` policy was therefore evaluated against `definition.initialConfig`, so changing the resolution of a display never changed the bit width of its Pixels pin. For the same reason aggregate and decompose could not be evaluated there at all and were special cased into a `manual` fix mode, with their widths recomputed by hand in CCNodePinStore. Split the two concerns: getComponentPinBitWidthStatus now only reports how a width is determined (`automatic` or `nodeDependent`), and getNodePinBitWidthStatus resolves it from the config of the node and the manual bit widths of its pins. The `fixed` policy is renamed to `calculated` to match, and the duplicated per-node calculations for aggregate and decompose are gone. Bit widths are cached, so CCNodeStore now emits `didUpdateConfig`, kept separate from `didUpdate` so that frequent position updates do not drop the cache. Because a width can now change after a connection was made, connections whose ends no longer agree are dropped when the config changes. Also derive whether a pin is configurable and splittable from its bit width policy instead of duplicating it on the pin attributes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The Const intrinsic was merged in with the `fixed` bit width policy, which is now named `calculated`. Its output width comes from the config of the node, so it is resolved per node like the display resolution. Co-Authored-By: Claude Opus 5 (1M context) <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.
Rework the node renderer around a layout → geometry two-step, generalize bit width handling around per-pin policies, and build on both to add a Const intrinsic component, display config editing, and play-mode guards.
Renderer: layout → geometry split
nodePinOffsetById), andccComponentEditorRendererLayoutToGeometryturns it into absolute positions<g>to<svg>so child renderers draw in local coordinates and can use percentage dimensions (Default useswidth="100%")config.resolutionand shares its constants with the renderer; pixel fill indexesinputValuein row-major order (fixes the previously reversed pixel order)ConfigSettingButton) for editing the resolution, and now compose the Default renderer for their frameNew Const intrinsic component
CONSTtype withconfig: { data: SimulationValue }; the output bit width is calculated fromconfig.data.lengthandevaluatewrites the configured data to the output pinconfig.data)evaluatefunctions now receive the node config as a fourth argumentBit width policy refactor
fixedpolicy is renamed tocalculated, andisBitWidthConfigurable/isSplittableare folded into theconfigurablepolicyCCComponentPinBitWidthStatusfixModemanualis replaced bynodeDependent: such widths come from a node's config and/or manually specified pin widths, so they can only be resolved per nodegetNodePinBitWidthStatusis rewritten to be policy-driven — the hard-coded special cases for aggregate / decompose / broadcast pins are gone; manual bit widths are collected per pin key and fed tocalculateBitWidthCCNodePinStore, invalidated on node pin / connection changes and on node config updates (newdidUpdateConfigevent on the node store)hasCompatibleBitWidthshelper used byisConnectable; connections that a config change makes inconsistent (e.g. changing a display resolution) are dropped, and existing connections are re-validated when a new one is registerednodePin.test.tscovering bit width resolution (input / display / aggregate / decompose / broadcast) and connection consistency across config changesPlay mode & simulation
isEachInputPinConnectedutility anduseCanSimulatehook disable the ViewModeSwitcher play button while any input pin is unconnectedexecuteSimulationdecoupled from raw node / connection store events in the core slice{ componentPinId, timeStep }objects with explicit serialization instead ofJSON.stringifyof a tuple; initial values derive their bit width from the pin's implementation node pin