fix(#288): Enter custom command選択後のセレクター再表示バグ修正#295
Merged
Conversation
…ring custom command input - Add isFreeInputMode useState to MessageInput component - Set flag true in handleFreeInput(), reset in submitMessage/handleCommandCancel/empty message - Skip selector display logic in handleMessageChange when isFreeInputMode is true - Guard mobile command button to reset isFreeInputMode before showing selector (Stage 2 SF-001) - Add 7 test cases (TC-1 through TC-7) covering all free input mode transitions - Coverage: MessageInput.tsx 89% statements, 84% branches Resolves #288 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…coverage Apply DRY principle to MessageInput test code by extracting shared mock data, default props, and user-interaction helpers into a new shared module (tests/helpers/message-input-test-utils.ts). Add coverage-improving tests for IME composition edge cases (timeout clearing, justFinishedComposing reset), error handling, and default cliToolId fallback. Improvements: - Extract shared test utilities (mockCommandGroups, createDefaultProps, DOM query helpers, user interaction helpers) to eliminate duplication between unit tests and acceptance tests - Add @tests path alias to tsconfig.json and vitest.config.ts - Add tests for IME composition timeout clearing (lines 100-101, 114-115) - Add test for justFinishedComposing timeout expiry (line 118) - Add tests for error handling and whitespace-only message guard - Add test for default cliToolId fallback when prop is omitted - Fix onMessageSent mock typing for strict TypeScript compliance Quality Metrics: - MessageInput.tsx Statement Coverage: 93.61% -> 100% - MessageInput.tsx Branch Coverage: 86.20% -> 96.55% - MessageInput.tsx Function Coverage: 92.85% -> 100% - MessageInput.tsx Line Coverage: 93.61% -> 100% - Test count: 28 -> 33 (+5 new tests) - ESLint errors: 0 - TypeScript errors: 0 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add design policy document for isFreeInputMode fix - Add issue review reports (hypothesis verification, multi-stage review) - Add design review reports (consistency, impact, security) - Add work plan, TDD results, acceptance test results, and progress report - Update CLAUDE.md with MessageInput.tsx and test helper entries Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
MessageInput.tsxにisFreeInputModeフラグ(useState<boolean>)を追加し、フリー入力モード中のセレクター再表示を防止message-input-test-utils.tsを抽出し、テストコードの DRY 原則を改善Changes
Implementation (
MessageInput.tsx)isFreeInputModeステート追加handleFreeInput(): フラグをtrueに設定handleMessageChange(): 空文字時フラグリセット、フリー入力モード中の早期リターンsubmitMessage(): フラグリセットhandleCommandCancel(): フラグリセットTests
MessageInput.test.tsx: 7 → 22 テストケース(+15)issue-288-acceptance.test.tsx: 受入テスト 10 シナリオ(新規)message-input-test-utils.ts: 共有テストヘルパー(新規)Documentation
CLAUDE.mdにモジュールエントリ追加Test plan
🤖 Generated with Claude Code