opentiny / opentiny/tiny-engine

fix:消息渲染无法显示图片

Open Beginner friendly
#1,816 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vue
Stars
2.8k
Forks
476
Avg merge
17h 35m
Merged PRs (30d)
1

Description

Image

消息渲染无法显示图片:

  1. RobotChat.vue 会把上传图片放进 userMessage.renderContent,形如 { type: 'img', content: item.url }。
  2. contentRendererMatches 会把 type: 'img' 交给 ImgRenderer。
  3. 但 @opentiny/tiny-robot 调用自定义 renderer 时只传 message 和 contentIndex,不会把 resolver 返回项里的 content 展开成 props.content。
  4. 当前 ImgRenderer.vue 只读 props.content,所以拿不到 URL,v-if="props.content" 为 false,图片不显示。

消息渲染无法显示图片对用户体验会造成比较大的影响,建议作为遗留项,后续进行修复。

Originally posted by @chilingling in https://github.com/opentiny/tiny-engine/pull/1815#discussion_r3491594780

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading RobotChat.vue, contentRendererMatches, and ImgRenderer.vue to trace how the uploaded image URL moves from renderContent into the custom renderer. Check the @opentiny/tiny-robot renderer call described in the issue, and consider the work done when uploaded user images render with their URL instead of being hidden.

Written by the indexing model from the issue text.

Assessment

Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.