Skip to content

nodes: let hosts set the wall materials resolver - #1031

Open
atyrode wants to merge 1 commit into
pascalorg:mainfrom
atyrode:nodes-wall-materials-resolver
Open

atyrode wants to merge 1 commit into
pascalorg:mainfrom
atyrode:nodes-wall-materials-resolver

Conversation

@atyrode

@atyrode atyrode commented Oct 12, 2026 •

Copy link
Copy Markdown

WallCutout already accepts a materialResolver, but WallSystems hard-wires getCurtainAwareWallMaterials, so a host cannot restyle cut-away walls without forking the wall kind (plugins cannot re-register wall).

This adds setWallMaterialsResolver(resolver | null), read by WallSystems through useSyncExternalStore (null restores the default), and exports getCurtainAwareWallMaterials so a host can wrap the default and replace one variant — for example a low stub in place of the translucent film for cut walls.

No behaviour change by default.

  • bun run check-types --filter=@pascal-app/nodes: passes
  • Biome on the three files: clean

Note

Low Risk
Opt-in API with the same default resolver; only affects wall cutaway material styling when hosts override it.

Overview
Hosts can now customize how WallCutout picks wall materials (visible, cut-away, translucent, delete) without replacing the built-in wall kind.

A new module holds a module-level resolver defaulting to getCurtainAwareWallMaterials. setWallMaterialsResolver(resolver | null) swaps it and notifies subscribers; null restores the default. getCurtainAwareWallMaterials is exported from @pascal-app/nodes so hosts can wrap the default and tweak one variant (e.g. cut-away styling).

WallSystems reads the active resolver via useSyncExternalStore and passes it into WallCutout instead of hard-wiring the curtain-aware helper. Default behavior is unchanged until a host calls the setter.

Reviewed by Cursor Bugbot for commit 747292e. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 747292e. Configure here.

<WallTreatmentMiterSystem />
<WallSystem geometryAdapter={curtainWallGeometryAdapter} />
<WallCutout materialResolver={getCurtainAwareWallMaterials} />
<WallCutout materialResolver={materialResolver} />

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolver updates skip batched walls

Medium Severity

setWallMaterialsResolver refreshes WallCutout through useSyncExternalStore, but WallBatchSystem still keys appearance only on shading, textures, theme, and scene materials. After a floor is sewn, a host swap that changes opaque visible materials leaves the merged meshes on the old set while the per-wall meshes stay hidden.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 747292e. Configure here.

This branch has not been deployed

No deployments
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