fix(prompts): use multiline textarea for prompt variable input - #804
Merged
Conversation
Single-line input stripped line breaks when pasting multi-line Markdown into a prompt variable, collapsing the content onto one line. Switch the variable text field to a multiline textarea so line breaks and formatting are preserved. Closes #801
…llbar Make the variable textarea start at single-line height and grow to fit content up to a max height, so short variables keep a compact look while multi-line Markdown still preserves line breaks. Remove the resize handle and apply a thin custom scrollbar.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
修复 #801:提示词变量粘贴多行 Markdown 内容时,换行被压成一行的问题。
问题根因
变量输入弹窗
VariableInputDialog.tsx的普通文本变量使用单行<input type="text">,HTML 单行输入框会剥离粘贴内容中的所有换行符,导致多行 Markdown 被压成一行。replaceVariables()只做字符串替换,不影响换行,问题纯粹出在输入控件类型。改动内容
<input type="text">替换为多行<textarea>,保留换行与格式firstInputRef类型由HTMLInputElement改为HTMLTextAreaElement测试
pnpm typecheck通过关联 Issue
Closes #801