Replies: 1 comment
|
已定位根因:composer 草稿中删除 markdown 图片引用( |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Title: Composer input box disappears when deleting a markdown image reference in the draft
Summary
When the composer draft contains a markdown image reference whose URL starts with the relative path
/describe-image/raw/...(the attachment route of the describe-image plugin), deleting that reference — either character by character or by selecting all and pressing Backspace — removes the entire composer input box from the page. The chat area itself stays, but the textarea/input bar is gone.A second symptom of the same rendering path: any text that follows the image reference in the same paragraph is not rendered in the sent message (the text is still delivered to the model, only the UI drops it).
Environment
http://127.0.0.1:3080@linxin666/dsh-tool-describe-image(its attach route serves/describe-image/raw/<id>), but the crash is in the host composer's draft preview entrySteps to reproduce
 asdasdasdasdCtrl+AthenBackspace(or delete the reference character by character).document.querySelector('textarea')returnsnull.Automated reproduction with Playwright:
Console error
Analysis / likely cause
The composer renders a preview entry for markdown image references found in the draft (slot
conversation.composer.bar). When the reference text is deleted, React attemptsremoveChildon a node that was already removed by another update pass (double-removal race), the error escapes the slot entry, the slots system tears down the crashed entry, and the whole composer bar disappears.The same preview entry also appears to swallow trailing text after the image in the rendered message.
Workaround used (for reference)
We worked around it by inserting a plain-text
[image attachment {...}]note instead of a markdown image reference for pasted images; the note does not trigger the draft preview entry, so deletion is safe. A host-side fix would let plugins restore the nicer inline-image reference form.Related
http(s)URLs (falls back toimageAlttext for other schemes), which may be worth revisiting together with this bug:/describe-image/raw/...relative paths render as alt text instead of the image in some surfaces.All reactions