Skip to content

Refactor node layout to use relative offsets and add play-mode guards#60

Draft
chelproc wants to merge 2 commits into
mainfrom
20260606
Draft

Refactor node layout to use relative offsets and add play-mode guards#60
chelproc wants to merge 2 commits into
mainfrom
20260606

Conversation

@chelproc

@chelproc chelproc commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

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 to
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
  • → 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

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
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 6, 2026

Copy link
Copy Markdown

Deploying create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1c94d8a
Status: ✅  Deploy successful!
Preview URL: https://0a41459c.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev
Branch Preview URL: https://20260606.create-cpu-c8345196-9409-4cce-afc4-389f413ad8ee.pages.dev

View logs

  - 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant