Skip to content

Refactor/properties - #240

Merged
dubstar-04 merged 6 commits into
mainfrom
refactor/properties
May 2, 2026
Merged

Refactor/properties#240
dubstar-04 merged 6 commits into
mainfrom
refactor/properties

Conversation

@dubstar-04

Copy link
Copy Markdown
Owner

Update property panel to use new core property types and models

Copilot AI 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.

Pull request overview

Updates the web app’s property panel and canvas integration to align with new @design-core/core property and renderer modules.

Changes:

  • Refactors PropertiesPanel to use core.propertyManager definitions and Property.Type instead of hardcoded property lists/models.
  • Updates CanvasRenderer imports to a new subpath and adjusts tests accordingly.
  • Bumps @design-core/core to ^0.0.7 and adds Jest module mapping for the new core module entrypoints.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/tests/Canvas.test.js Updates CanvasRenderer mocking/import path to the new core subpath.
src/js/components/propertiesPanel.js Reworks property rendering to be definition-driven via Property.Type and propertyManager.
src/js/components/canvas.js Switches CanvasRenderer import to new core subpath.
package.json Bumps core dependency and adds Jest moduleNameMapper entries for new core subpaths.
Comments suppressed due to low confidence (1)

src/js/components/propertiesPanel.js:75

  • PropertiesPanel’s rendering logic is now driven by Property.Type and getItemPropertyDefinition(...), which is a significant behavior change (e.g., LIST option building, hiding COLOUR/ENTITIES, read-only fallback). There are currently no component tests covering PropertiesPanel; adding a small test suite for at least NUMBER/BOOLEAN/LIST/STRING rendering and the VARIES behavior would help prevent regressions during future core upgrades.
  renderInput(property, value, definition) {
    switch (definition?.type) {
    case Property.Type.NUMBER:
      return (
        <input
          className="dialogrow-input dialogrow-input--number"
          defaultValue={value}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 101 to 106
return (
<select
className="dialogrow-input dialogrow-input--select"
defaultValue={selectedIndex >= 0 ? value : ''}
defaultValue={value}
key={`${property}-${value}`}
onChange={(e) => {
Comment thread package.json
Comment on lines +29 to +34
"jest": {
"moduleNameMapper": {
"^@design-core/core/canvasRenderer\\.js$": "<rootDir>/node_modules/@design-core/core/core/lib/renderers/canvasRenderer.js",
"^@design-core/core/property\\.js$": "<rootDir>/node_modules/@design-core/core/core/properties/property.js"
}
},
@dubstar-04
dubstar-04 merged commit 252fd14 into main May 2, 2026
1 check passed
@dubstar-04
dubstar-04 deleted the refactor/properties branch May 2, 2026 09:55
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.

2 participants