Skip to content

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

Merged
aofei merged 8 commits into
devfrom
xgopilot/issue-3137-1778550363
May 12, 2026
Merged

feat: add title attribute to sprite name in list items#3140
aofei merged 8 commits into
devfrom
xgopilot/issue-3137-1778550363

Conversation

@fennoai
Copy link
Copy Markdown
Contributor

@fennoai fennoai Bot commented May 12, 2026

Requested by @nighca

Update #3137

Summary

  • Added a required title prop to UIBlockItemTitle and bound it to the inner truncation <span>, so hovering over a truncated name shows the full text as a native browser tooltip
  • Passed :title="name" (or the equivalent translated string) to UIBlockItemTitle in all block-item components that display a name

Changes

Core

  • UIBlockItemTitle.vue: Added required title: string prop; forwarded to the inner <span :title="title"> that applies text-ellipsis

Block-item components (editor panel)

  • UIEditorSpriteItem.vue
  • UIEditorBackdropItem.vue
  • UIEditorSoundItem.vue
  • UIEditorWidgetItem.vue

Block-item components (non-editor)

  • UISpriteItem.vue
  • UIBackdropItem.vue
  • UISoundItem.vue

Asset generation components

  • AnimationGenItem.vue
  • BackdropGenItem.vue
  • SpriteGenItem.vue
  • CostumeGenItem.vue
  • ParamSelector.vue — uses $t(item.label) as the title

Other

  • SpxEffectKindItem.vue — uses $t(item.text) as the title
  • docs/ui-design/index.vue — passes literal title strings matching slot content

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>
Copy link
Copy Markdown
Contributor Author

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

The change is minimal and correct — it adds a native tooltip for truncated sprite names by wrapping the text in <span :title="name">. No security or performance issues were found.

Two consistency observations worth considering:

1. Inconsistency with sibling item componentsUIEditorBackdropItem.vue, UIEditorSoundItem.vue, UIEditorWidgetItem.vue, and UISpriteItem.vue all display a name inside UIBlockItemTitle with the same text-ellipsis CSS, but do not have the tooltip treatment. Users of those panels will still see truncated names without a hover hint.

A cleaner long-term fix would be to add a title prop to UIBlockItemTitle itself, so every caller benefits automatically and no extra <span> wrapper is needed per call site.

2. Double <span> nesting (addressed in the inline comment below) — the extra wrapper is harmless but slightly redundant given UIBlockItemTitle already wraps slot content in its own <span>.

Comment thread spx-gui/src/components/ui/block-items/UIEditorSpriteItem.vue Outdated
xgopilot and others added 2 commits May 12, 2026 01:54
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>
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>
Comment thread spx-gui/src/components/ui/block-items/UISpriteItem.vue
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>
Comment thread spx-gui/src/components/ui/block-items/UIBlockItemTitle.vue Outdated
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>
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>
Comment thread spx-gui/src/components/asset/gen/common/param-settings/ParamSelector.vue Outdated
Comment thread spx-gui/src/components/asset/gen/costume/CostumeGenItem.vue Outdated
xgopilot and others added 2 commits May 12, 2026 02:59
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>
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>
@nighca

This comment was marked as resolved.

@fennoai

This comment was marked as resolved.

@aofei aofei merged commit 455781e into dev May 12, 2026
7 checks passed
@fennoai fennoai Bot deleted the xgopilot/issue-3137-1778550363 branch May 12, 2026 03:27
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.

3 participants