Refactor/properties - #240
Merged
Merged
Conversation
There was a problem hiding this comment.
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
PropertiesPanelto usecore.propertyManagerdefinitions andProperty.Typeinstead of hardcoded property lists/models. - Updates
CanvasRendererimports to a new subpath and adjusts tests accordingly. - Bumps
@design-core/coreto^0.0.7and 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.TypeandgetItemPropertyDefinition(...), 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 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" | ||
| } | ||
| }, |
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.
Update property panel to use new core property types and models