Repository navigation
feat(tui): support multiline feedback input - #5042
Conversation
🦋 Changeset detectedLatest commit: 74b1689 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
commit: |
53c7547 to
2033fa0
Compare
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2033fa0ead
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| constructor(tui: TUI, onDone: (result: FeedbackInputDialogResult) => void) { | ||
| super(); | ||
| this.onDone = onDone; | ||
| this.input = new FeedbackMultilineInput(tui, createEditorTheme(), { paddingX: 2 }); |
There was a problem hiding this comment.
Preserve trailing backslashes on Enter
When a feedback message ends in a backslash (for example C:\tmp\), delegating Enter to the stock Editor does not submit it: Editor.handleInput applies its backslash+Enter fallback, deletes that character, and inserts a newline, so a second Enter submits the trimmed message without the backslash. The previous Input submitted this value intact, and the dialog advertises plain Enter as submit, so this silently corrupts a valid feedback value; bypass that fallback for this modal.
Useful? React with 👍 / 👎.
| constructor(tui: TUI, onDone: (result: FeedbackInputDialogResult) => void) { | ||
| super(); | ||
| this.onDone = onDone; | ||
| this.input = new FeedbackMultilineInput(tui, createEditorTheme(), { paddingX: 2 }); |
There was a problem hiding this comment.
Honor the paste-burst preference in the feedback editor
When disable_paste_burst = true is set, this new Editor is still constructed with only paddingX, so its paste-burst detector stays enabled even though the main editor receives state.appState.disablePasteBurst. On terminals or input methods that trigger the fallback, a rapid run of at least eight characters followed by Enter therefore inserts a newline instead of submitting /feedback, which is exactly the behavior this user preference opts out of; thread the configured value into this editor as well.
Useful? React with 👍 / 👎.
| } | ||
|
|
||
| override render(width: number): string[] { | ||
| const lines = super.render(width).slice(1, -1); |
There was a problem hiding this comment.
Retain scroll indicators for overflowing feedback
When feedback grows beyond the Editor viewport (for example more than 12 visual lines on a 40-row terminal), Editor.render puts ↑/↓ N more indicators in its first and last rows, but this unconditional slice removes both along with the normal borders. The dialog then shows only the cursor's window with no indication that earlier or later feedback is hidden; strip only the empty borders or preserve the nonempty overflow rows.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 58adb07983
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
||
| handleInput(data: string): void { | ||
| if (this.done) return; | ||
| if (this.done || isKeyRelease(data)) return; |
There was a problem hiding this comment.
Normalize Caps-Lock Ctrl-J before dispatch
When the Kitty keyboard protocol is active and Caps Lock is enabled, Ctrl-J can arrive with an uppercase J plus the Ctrl/Caps modifiers; this handler forwards it unchanged, so the base Editor cannot match its lowercase ctrl+j newline binding and the newly advertised shortcut does nothing (Shift-Enter still works). CustomEditor.handleInput already handles this terminal case with normalizeCapsLockedCtrl; apply that normalization before the release/cancel checks and before forwarding the key.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
…end drift-allow - bun scripts/upstream-ledger.mjs --refresh: 148 new pending rows covering the 2.7.0 tail and upstream/main. - Mark MoonshotAI#5043/MoonshotAI#5037/MoonshotAI#5049 ported (26f22db, 0d20273, d61aacc) and MoonshotAI#5042 equivalent (multiline feedback editor already shipped, localized). - Refresh MoonshotAI#4820 evidence: the machine-architecture blocker retired with the 2.7.0 merge. - drift-allow: add the missing translated/renamed upstream files (media.ts, node-local hostServices/rgLocator/runRg, executor validate.ts, remaining vitest configs) so upstream-drift stops flagging deliberate removals. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Requirement or Bug
没有关联 issue。使用
/feedback的 TUI 用户需要分段写问题、复现和期望,原来的输入框只能编辑一行。这个 PR 让反馈输入变成多行,并用和 settings / permissions 一样的外框把输入区单独框出来。Bug Reproduction Steps
N/A
Root Cause
N/A
Code Changes
核心思路是两层职责分开:弹窗外框用 settings / permissions 的上下主色平线,输入区自己用主色圆角框。不再把多行
Editor塞进原来那张圆角卡片,也不再套第二层同样的圆角框。Enter仍提交,Shift-Enter/Ctrl-J换行。后续附件选择和上传不变。Editor提交时先清空缓冲区,再调用onSubmit。弹窗用回调里的完整文本,避免提交空内容。Kitty 键盘协议的释放事件在入口过滤,避免一次按键处理两次。内容超出可视区时,输入框的上下边显示Editor自己的滚动提示。阅读指南
apps/kimi-code/src/tui/components/dialogs/feedback-input-dialog.ts:外框、输入框和提交。apps/kimi-code/src/tui/commands/prompts.ts:传入弹窗需要的 TUI 上下文。apps/kimi-code/test/tui/components/dialogs/feedback-input-dialog.test.ts:外框、三行输入框、多行编辑和提交。Screenshots / Recordings
以下是组件在宽度 60 下的真实渲染。光标落在输入框第一行,零宽的光标标记已略去。改动前是
origin/main的单行卡片。Behavior Changes and Affected Users
/feedback文本编辑Shift-Enter/Ctrl-J换行,粘贴保留换行/feedback提交反馈的 TUI 用户/feedback提交Enter提交Enter提交;长粘贴按完整内容提交Feedback submitted, thank you!Thanks for taking the time to write this. It'll help us make Kimi better>提示,脚注在框底>Esc/Ctrl-C/Ctrl-D取消受影响模块及覆盖:
feedback-input-dialog.ts:覆盖 settings 外框、输入框缩进与三行高度、两行渲染与提交、Shift-Enter、跨行光标编辑、普通及长粘贴、撤销与按词删除、空内容、取消及重复提交。prompts.ts:只传递 TUI 上下文;结果类型和后续流程未改。constant/feedback.ts:成功文案改为感谢用户花时间,并说明这会帮助改进 Kimi。.changeset/feedback-multiline-input.md:minor 发版说明,覆盖多行输入和成功感谢。验证结果
feedback-input-dialog测试:18 个通过。oxlint --type-aware与提交时的check-comments:通过。Checklist
/approve). 无关联 issue,需求见上。gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update. 此 PR 不包含文档变更。