Skip to content

feat(code-editor): support sprite instance input helpers#3123

Merged
nighca merged 1 commit into
goplus:devfrom
aofei:input-helper-sprite-instances
May 12, 2026
Merged

feat(code-editor): support sprite instance input helpers#3123
nighca merged 1 commit into
goplus:devfrom
aofei:input-helper-sprite-instances

Conversation

@aofei
Copy link
Copy Markdown
Member

@aofei aofei commented May 8, 2026

Handle spx-sprite-instance with the existing resource input helper so sprite instance slots can use the sprite resource selector.

Write selected sprite instances as bare identifiers while keeping resource name slots as string literals.

Fixes #3110
Updates goplus/xgolsw#317

Copy link
Copy Markdown
Contributor

@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 the SpriteInstance input type to the code editor, enabling sprite instance resource references. Changes include updating the BuiltInInputType enum, modifying the input helper to handle the new type by returning raw resource names, and adding a dependency replacement for xgolsw in go.mod. Review feedback suggests updating the InputSlotAcceptForType type definition for better type safety and recommends avoiding the use of a fork in the main branch's dependency list.

Comment thread spx-gui/src/components/xgo-code-editor/common.ts Outdated
Comment thread tools/spxls/go.mod Outdated
Copy link
Copy Markdown
Contributor

@fennoai fennoai 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: PR #3123 — Sprite Instance Input Helpers

This PR cleanly extends the InputHelperProvider hierarchy to support sprite instance resource references. The class extension pattern is respected, isResourceInputType abstraction is a good design move, and the default case delegation in provideInputValuePreview correctly delegates to the base class. A few issues are worth addressing before merge.

Comment thread spx-gui/src/components/editor/spx-code-editor/input-helper.ts
Comment thread spx-gui/src/components/editor/spx-code-editor/input-helper.ts Outdated
Comment thread spx-gui/src/components/xgo-code-editor/common.ts
Comment thread spx-gui/src/components/xgo-code-editor/ui/markdown/InputValuePreview.vue Outdated
Comment thread spx-gui/src/components/xgo-code-editor/ui/input-helper/InputHelper.vue Outdated
Comment thread spx-gui/src/components/xgo-code-editor/ui/input-helper/InputHelper.vue Outdated
@aofei aofei force-pushed the input-helper-sprite-instances branch from ea043e2 to e31f40a Compare May 12, 2026 03:23
Handle `spx-sprite-instance` with the existing resource input helper so
sprite instance slots can use the sprite resource selector.

Write selected sprite instances as bare identifiers while keeping
resource name slots as string literals.

Fixes goplus#3110
Updates goplus/xgolsw#317

Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
@nighca nighca merged commit 5b3056c into goplus:dev May 12, 2026
4 checks passed
@aofei aofei deleted the input-helper-sprite-instances branch May 12, 2026 03:38
nighca added a commit that referenced this pull request May 15, 2026
* chore(deps): bump spx to 2.0.0 (#3127)

Agent-Logs-Url: https://github.com/goplus/builder/sessions/147d2d8e-4bf8-4ae7-b66e-b8a41c970f3a

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>

* Widget `<unstable-xgo-code-editor>` (#3089)

* Add widget `<unstable-xgo-code-editor>`

* Address widget review feedback

* Stabilize layer order workarounds

* Provide SPX knowledge from frontend (#3097)

* UI update for tutorial pages (#3122)

* update tutorial pages styles

* compress tutorials banner

* refine tutorials banner layout

* show updated time for course series

* details

* Handle invalid image stalls in editor (#3136)

* feat: add title attribute to sprite name in list items (#3140)

* feat: add title attribute to sprite name in list items

Add HTML title attribute to the sprite name span in UIEditorSpriteItem
so users can hover to see the full name when it is truncated.

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>

* refactor: move title tooltip to UIBlockItemTitle component

Add optional `title` prop to UIBlockItemTitle and forward it to the
inner truncation span, then use it in UIEditorSpriteItem to avoid the
extra wrapper span.

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>

* feat: add title attribute to name in all block item components

Add :title="name" to UIBlockItemTitle in UIEditorBackdropItem,
UIEditorSoundItem, UIEditorWidgetItem, and UISpriteItem so truncated
names show a hover tooltip consistently across all item panels.

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>

* feat: add title attribute to sprite name in list items

Add :title="name" to UIBlockItemTitle in UISoundItem and UIBackdropItem.

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>

* refactor: make title prop required in UIBlockItemTitle

Change title from optional to required prop to ensure all callers
provide a tooltip value for truncated text.

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>

* feat: add title attribute to sprite name in list items

Add missing :title prop to all UIBlockItemTitle callers to satisfy
the newly-required title prop: AnimationGenItem, BackdropGenItem,
ParamSelector, CostumeGenItem, SpriteGenItem, SpxEffectKindItem,
and the ui-design docs page.

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>

* fix: use $t() instead of t() in ParamSelector template

Replace t(item.label) with $t(item.label) in the :title binding
to be consistent with the template-level i18n helper usage.

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>

* style: fix formatting in CostumeGenItem.vue

Run Prettier to fix line-length formatting issue flagged by CI.

Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>

---------

Co-authored-by: xgopilot <noreply@goplus.org>
Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>

* feat(code-editor): support sprite instance input helpers (#3123)

Handle `spx-sprite-instance` with the existing resource input helper so
sprite instance slots can use the sprite resource selector.

Write selected sprite instances as bare identifiers while keeping
resource name slots as string literals.

Fixes #3110
Updates goplus/xgolsw#317

Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>

* Update UI empty/error default images (#3134)

* update ui empty/error default images

* compress svg size

* rename image

* adjust svg size

* chore(deps): bump github.com/goplus/xgolsw to 0.20.0 in /tools/spxls (#3163)

Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>

* feat(spx-gui): optimize video cut preview during animation generation (#3150)

* optimize video cut preview during animation generation

* use css variables for track padding

* fix details

* remove page for test

* optimize code

* queue video seeks to keep animation preview responsive during dragging

---------

Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: nighca <1492263+nighca@users.noreply.github.com>
Co-authored-by: chennan <chennan@qiniu.com>
Co-authored-by: fennoai[bot] <231223108+fennoai[bot]@users.noreply.github.com>
Co-authored-by: xgopilot <noreply@goplus.org>
Co-authored-by: Aofei Sheng <aofei@aofeisheng.com>
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.

Fix sprite instance input helper falling back to unknown slot after PR #2439

2 participants