Skip to content

feat(spx-gui): support spx-property-name input type in InputHelper#2975

Open
cn0809 wants to merge 6 commits intogoplus:devfrom
cn0809:issue-2971
Open

feat(spx-gui): support spx-property-name input type in InputHelper#2975
cn0809 wants to merge 6 commits intogoplus:devfrom
cn0809:issue-2971

Conversation

@cn0809
Copy link
Copy Markdown
Collaborator

@cn0809 cn0809 commented Mar 19, 2026

close: #2971

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, 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 enhances the SPX GUI's code editor by adding support for a new input type specifically designed for selecting property names. This feature provides a more intuitive and guided experience for users when interacting with stage and sprite properties, leveraging a dedicated UI component for selection. The changes also include routine updates to Go module dependencies.

Highlights

  • New Input Type for SPX Properties: Introduced a new SpxInputType.SpxPropertyName to represent property name values for SPX stage/sprite, enhancing type safety and clarity within the editor's input system.
  • Dedicated Property Name Input Component: Developed a new Vue component, SpxPropertyNameInput.vue, which provides a user-friendly dropdown for selecting available properties of the active stage or sprite, improving the editing experience.
  • Input Helper Integration: Integrated the new SpxPropertyNameInput component into the SpxInputHelperProvider, allowing the code editor to dynamically offer property name selection based on context.
  • Go Module Dependency Updates: Updated several Go module dependencies in tools/spxls/go.mod and go.sum, ensuring the project uses the latest versions of its Go language server components.

🧠 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.

Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for the spx-property-name input type, which is a great addition. The implementation is solid, touching upon the necessary parts of the codebase from type definitions to UI components. I've identified a potential race condition in the newly added SpxPropertyNameInput.vue component and have provided suggestions to make it more robust by handling asynchronous operation cancellations. Overall, this is a well-executed feature enhancement.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds editor-side support for the new accept.type = spx-property-name input slots so the in-place “Modify” action can render a property selector instead of falling back to “Value not supported”. This integrates with the SPX code editor’s existing InputHelper flow and updates the SPX language server tool dependencies accordingly.

Changes:

  • Add spx-property-name as a new SpxInputType and wire a corresponding InputTypeHandler in SpxInputHelperProvider.
  • Introduce SpxPropertyNameInput (dropdown) that queries the language server for available stage/sprite properties based on the active document.
  • Bump tools/spxls Go module dependencies (notably xgolsw) to versions that include the new slot accept type support.

Reviewed changes

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

Show a summary per file
File Description
tools/spxls/go.mod Updates xgolsw and indirect deps to newer versions needed for new slot accept types.
tools/spxls/go.sum Refreshes module checksums after dependency bumps.
spx-gui/src/components/editor/code-editor/xgo-code-editor/index.ts Re-exports useCodeEditorUICtx alongside CodeEditorUI for consumption by SPX-specific UI.
spx-gui/src/components/editor/code-editor/spx-code-editor/ui/input-helper/SpxPropertyNameInput.vue New selector-based in-place input UI that loads candidate properties from the code editor/LSP.
spx-gui/src/components/editor/code-editor/spx-code-editor/input-helper.ts Registers the new SpxPropertyName handler and expression serialization behavior.
spx-gui/src/components/editor/code-editor/spx-code-editor/common.ts Extends SpxInputType/typed value union with spx-property-name.

💡 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.

@xgopilot
Copy link
Copy Markdown
Contributor

xgopilot bot commented Mar 19, 2026

Good structure overall — the new component follows the established Vue SFC pattern and the dedup logic for merging stage+sprite properties is correct. One issue needs attention before merge: the exprForInput handler wraps the property name in JSON.stringify, producing a quoted string literal ("x") where every other input type returns a bare identifier (x). Please verify whether the spx API actually expects a string argument here; if not, remove the JSON.stringify. Also worth addressing: the two serial LSP calls for sprite documents could be parallelized, and a signal.aborted guard after the awaits would match codebase conventions.

Copy link
Copy Markdown
Collaborator

@nighca nighca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

发现要像其他 API(如 setCostume "xxx")一样顺畅地用 showVar/hideVar 还差几个事情:

  1. 使用错误输入的时候,应当通过 diagnsotics 进行提示
  2. document-base 添加对应的信息,且插入的 snippet 支持类似 $BUILDER_FIRST_PROPERTY_NAME 这样的变量(这个会稍麻烦些)

@cn0809
Copy link
Copy Markdown
Collaborator Author

cn0809 commented Mar 20, 2026

发现要像其他 API(如 setCostume "xxx")一样顺畅地用 showVar/hideVar 还差几个事情:

  1. 使用错误输入的时候,应当通过 diagnsotics 进行提示
  2. document-base 添加对应的信息,且插入的 snippet 支持类似 $BUILDER_FIRST_PROPERTY_NAME 这样的变量(这个会稍麻烦些)

补充一个:
3. 输入变量名时,自动补全应该提示可用的 properties 选项

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.

Support spx-property-name input type in InputHelper (in-place modify via property selector)

3 participants