refactor: import engine constants instead of duplicating them#1891
Merged
willeastcott merged 1 commit intomainfrom Mar 5, 2026
Merged
refactor: import engine constants instead of duplicating them#1891willeastcott merged 1 commit intomainfrom
willeastcott merged 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Remove duplicated constant definitions from the editor and import them from the playcanvas engine package instead. Also remove dead code (CURVE_CATMULL, CURVE_CARDINAL) that was unused. Made-with: Cursor
bc0592f to
cbba52d
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the editor codebase to rely on PlayCanvas engine exports for several UI-related constants, removing duplicated definitions from the editor’s core constants module.
Changes:
- Removed duplicated PlayCanvas UI constants (orientation, fitting, button transition modes, scroll view modes/visibility) from
src/core/constants.ts. - Updated affected editor/inspector consumers to import these constants directly from
playcanvas. - Removed unused editor-specific curve constants (
CURVE_CATMULL,CURVE_CARDINAL).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/editor/viewport/viewport-entities-elements.ts | Switches orientation constants import to playcanvas. |
| src/editor/inspector/components/scrollview.ts | Switches scroll mode/visibility constants import to playcanvas. |
| src/editor/inspector/components/scrollbar.ts | Switches orientation constants import to playcanvas. |
| src/editor/inspector/components/layoutgroup.ts | Switches orientation/fitting constants import to playcanvas. |
| src/editor/inspector/components/button.ts | Switches button transition mode constants import to playcanvas. |
| src/editor/entities/entities-menu.ts | Switches orientation constants import to playcanvas while keeping editor-specific constants from core. |
| src/editor/components/scrollbar/components-scrollbar-defaults.ts | Switches orientation constants import to playcanvas. |
| src/core/constants.ts | Removes duplicated engine constants and deletes unused curve constants. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
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.
Summary
src/core/constants.tsthat are already exported by the PlayCanvas engine (ORIENTATION_*,FITTING_*,BUTTON_TRANSITION_MODE_*,SCROLL_MODE_*,SCROLLBAR_VISIBILITY_*)playcanvasinstead of@/core/constantsCURVE_CATMULLandCURVE_CARDINAL(unused anywhere in the editor)Test plan