-
Notifications
You must be signed in to change notification settings - Fork 47
feat(tools): add functionality to add and search sprites from asset library #1674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
…y in ProjectEditor.vue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds capabilities to import sprites from the asset library and search for sprites by keyword via Copilot-powered tools in the project editor.
- Integrate
getAsset/listAssetAPIs and convert assets to sprites - Implement
addSpriteFromAssetandsearchSpriteFromAssetfunctions - Register two new Copilot tool descriptions and Zod schemas
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| spx-gui/src/components/editor/ProjectEditor.vue | Added asset API imports, new functions for adding/searching sprites, and tool registration entries |
| spx-gui/src/components/copilot/mcp/definitions.ts | Added Zod argument schemas and tool descriptions for sprite asset operations |
Comments suppressed due to low confidence (3)
spx-gui/src/components/editor/ProjectEditor.vue:105
- [nitpick] These new functions (
addSpriteFromAssetandsearchSpriteFromAsset) lack unit tests. Adding coverage will help validate asset integration logic and error handling.
async function addSpriteFromAsset(args:AddSpriteFromAssetOptions) {
spx-gui/src/components/copilot/mcp/definitions.ts:223
- [nitpick] The tool description references "XBuilder" instead of "SPX" which may cause confusion. Align naming to the product terminology.
'Add a sprite (File) to the current XBuilder project workspace through asset',
spx-gui/src/components/editor/ProjectEditor.vue:110
- The function
selectAssetis neither imported nor defined in this file, leading to a runtime error. Consider importing it or invoking the correct selection helper from the editor context.
selectAsset(project.value, sprite)
| async function searchSpriteFromAsset(args:SearchSpriteFromAssetOptions) { | ||
| const assets = await listAsset({ | ||
| pageSize: 3, | ||
| pageIndex: 1, |
Copilot
AI
May 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Hard-coded pagination values (pageSize: 3, pageIndex: 1) reduce flexibility. Consider making these parameters configurable or documenting why these defaults were chosen.
| async function searchSpriteFromAsset(args:SearchSpriteFromAssetOptions) { | |
| const assets = await listAsset({ | |
| pageSize: 3, | |
| pageIndex: 1, | |
| async function searchSpriteFromAsset(args: SearchSpriteFromAssetOptions, pageSize = 3, pageIndex = 1) { | |
| const assets = await listAsset({ | |
| pageSize: pageSize, | |
| pageIndex: pageIndex, |
…ites from asset library
|
This PR has been deployed to the preview environment. You can explore it using the preview URL. Warning Please note that deployments in the preview environment are temporary and will be automatically cleaned up after a certain period. Make sure to explore it before it is removed. For any questions, contact the Go+ Builder team. |
No description provided.