feat(spx-gui): monitor target/property select#2859
feat(spx-gui): monitor target/property select#2859cn0809 wants to merge 20 commits intogoplus:devfrom
Conversation
Summary of ChangesHello @cn0809, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly upgrades the functionality of monitor widgets by allowing users to select specific targets (stage or sprites) and their associated properties for display. This change involves a complete overhaul of the monitor's configuration UI, transitioning from a simple text input to interactive dropdowns for target and property selection. Under the hood, it integrates with the Language Server Protocol to dynamically retrieve available properties and ensures that the monitor's data model and rendering adapt seamlessly to these new capabilities. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a feature to select a target (stage or sprite) and a property for monitor widgets. The changes are well-implemented across the data model, UI components, and LSP client. A custom LSP notification for property renaming is also included. The related UISelect component has been enhanced to support asynchronously loaded options, which is a great improvement. I have one suggestion to improve code robustness.
There was a problem hiding this comment.
Pull request overview
This PR implements monitor target and property selection functionality for the SPX GUI, addressing issue #2820. The changes enable monitors to watch properties on specific sprites or the stage, with UI support for selecting targets and properties dynamically loaded from the language server.
Changes:
- Added
targetfield to Monitor model to distinguish between stage (empty string) and sprite properties - Implemented UI components for selecting monitor target (stage/sprite) and property with LSP-based property lookup
- Added automatic synchronization when sprites or properties are renamed to maintain referential integrity
- Enhanced monitor rendering to handle empty labels and display target prefix in property values
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/spxls/go.mod | Updated xgolsw dependency to version with property support |
| tools/spxls/go.sum | Updated checksums for xgolsw dependency |
| spx-gui/src/models/spx/widget/monitor.ts | Added target field to Monitor model with getter/setter and updated export/import logic |
| spx-gui/src/components/ui/select/UISelect.vue | Added MutationObserver to handle async-loaded options in select component |
| spx-gui/src/components/editor/stage/widget/detail/MonitorDetail.vue | Implemented target and property selection UI with LSP-based property loading |
| spx-gui/src/components/editor/preview/stage-viewer/widgets/MonitorNode.vue | Updated monitor rendering to handle empty labels and show target prefix in values |
| spx-gui/src/components/editor/preview/EditorPreview.vue | Added validation for monitor configuration before running project |
| spx-gui/src/components/editor/common/viewer/quick-config/utils.ts | Exposed target getter in WidgetLocalConfig for rendering |
| spx-gui/src/components/editor/code-editor/lsp/spxls/notifications.ts | Defined propertyRenamed notification type from LSP |
| spx-gui/src/components/editor/code-editor/lsp/spxls/commands.ts | Added getProperties command type for LSP |
| spx-gui/src/components/editor/code-editor/lsp/index.ts | Implemented property renamed notification handler and getProperties method |
| spx-gui/src/components/editor/code-editor/common.ts | Added Property and PropertiesTarget types with lspStageTarget constant |
| spx-gui/src/components/editor/code-editor/code-editor.ts | Exposed getProperties method in CodeEditor API |
| spx-gui/src/components/asset/index.ts | Added monitor target update when sprite is renamed |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
spx-gui/src/components/editor/stage/widget/detail/MonitorDetail.vue
Outdated
Show resolved
Hide resolved
tools/spxls/go.mod
Outdated
| require ( | ||
| github.com/goplus/builder/tools/ai v0.0.0 | ||
| github.com/goplus/xgolsw v0.16.1 | ||
| github.com/goplus/xgolsw v0.16.2-0.20260226010849-bc7e940eb027 |
There was a problem hiding this comment.
Mark: 等 xgolsw 发布正式版本后这里更新到正式版本再合入
spx-gui/src/components/editor/stage/widget/detail/MonitorDetail.vue
Outdated
Show resolved
Hide resolved
|
/review |
|
Good overall implementation. The target/property select redesign is clean, the legacy |
close: #2820