Repository navigation
AIチャットの入力をエンターキーで即送信するよう変更 - #6504
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q5dx7BhYZqs6TfQADwtEiR
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesDestination Agent入力送信
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Poem Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/screens/DestinationAgent/AgentInputBar.test.tsx`:
- Around line 55-101: Update the AgentInputBar tests to assert
input.returnKeyType is "send" alongside submitBehavior, and add send-button
assertions that disabled is true for whitespace-only value, sending, and
rateLimited states. Use the existing renderBar or rendered button query and
preserve the enabled-button submission test to verify both paths share the same
canSend conditions.
- Around line 10-13: Apply Biome ES5-style trailing commas to the multiline
object literals in the jest.mock setup and the additional object around the
referenced lines, including their final properties, while preserving the
existing mock behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6fb36194-c157-4091-b99f-1633e3bad541
📒 Files selected for processing (2)
src/screens/DestinationAgent/AgentInputBar.test.tsxsrc/screens/DestinationAgent/AgentInputBar.tsx
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q5dx7BhYZqs6TfQADwtEiR
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.
概要
AIチャット(目的地エージェント)の入力欄で、Enter キーを押した時点で即座にメッセージを送信するようにしました。日本語入力の変換確定に使う Enter では送信されません。
変更の種類
変更内容
AgentInputBarのTextInputにsubmitBehavior="submit"を指定し、multilineを維持したまま Enter を改行ではなく送信イベントへ振り替え。blurAndSubmitではなくsubmitにすることで送信後もキーボードが開いたままになり、続けて質問できるreturnKeyType="send"を指定し、Enter が改行ではなく送信であることをキーラベルでも示すonSubmitEditingは送信ボタンと同じcanSend判定(空文字・送信中・429 到達)を通してからonSendを呼ぶ。入力バー単体で空送信と二重送信を弾くAgentInputBar.test.tsxを新規追加(Enter 送信 /submitBehaviorの振り替え / 空白のみ・送信中・429 時の送信抑止 / 送信ボタン経路)日本語入力(IME)の確定について
変換確定の Enter は IME 側が消費するため、未確定文字列のまま送信されることはありません。React Native 0.83 の実装を読んで確認しています。
RCTBackedTextInputDelegateAdapter.mmのtextView:shouldChangeTextInRange:replacementText:でtext == "\n"のときだけ発火する。未確定文字列(marked text)がある状態の Return は UIKit の入力メソッドが先に確定処理として消費するため、"\n"としては届かないReactTextInputManager.ktのOnEditorActionListener経由。変換中の Enter は IME が確定として処理し、エディタアクションを発行しないonKeyPressによる JS 側のコンポジション判定は意図的に足していません。Android ではonKeyPressを渡すとReactEditText.onCreateInputConnectionがReactEditTextInputConnectionWrapperを挿し込み、変換中の 1 打鍵ごとに JS へイベントが飛ぶため、ネイティブ側で既に解決している問題に対してホットパスのコストだけが増えます。回帰リスクと緩和策
submitBehavior="submit"は Enter を送信へ振り替えるため、改行の入力手段が失われます。Enter 即送信という要件上は意図した挙動ですが、長文で改行を入れたいケースには影響しますreact-native-webでは従来どおり改行のまま:react-native-webはsubmitBehaviorを解釈せずblurOnSubmitを見るため、web では Enter は改行のままです。app.config.tsに web 設定が無くsrc/にも web 分岐が無いため、対象外と判断しましたcanSend判定を共有します。双方の挙動をユニットテストで固定しましたテスト
ローカルで以下を実行し、すべて成功しています。
npm run lint: 604 files checked / no fixes appliednpm test: 201 suites / 2166 tests passednpm run typecheck: エラーなし実機・シミュレータでの日本語 IME 実動作の確認は未実施です。
npm run lintが通ることnpm testが通ることnpm run typecheckが通ること関連Issue
スクリーンショット(任意)
Generated by Claude Code
Summary by CodeRabbit
新機能
バグ修正