Skip to content

fix(#288): Enter custom command選択後のセレクター再表示バグ修正#295

Merged
Kewton merged 3 commits intodevelopfrom
feature/288-worktree
Feb 16, 2026
Merged

fix(#288): Enter custom command選択後のセレクター再表示バグ修正#295
Kewton merged 3 commits intodevelopfrom
feature/288-worktree

Conversation

@Kewton
Copy link
Owner

@Kewton Kewton commented Feb 16, 2026

Summary

Changes

Implementation (MessageInput.tsx)

  • isFreeInputMode ステート追加
  • handleFreeInput(): フラグを true に設定
  • handleMessageChange(): 空文字時フラグリセット、フリー入力モード中の早期リターン
  • submitMessage(): フラグリセット
  • handleCommandCancel(): フラグリセット
  • モバイルコマンドボタン: フラグリセット後にセレクター表示(Stage 2 SF-001 対応)

Tests

  • MessageInput.test.tsx: 7 → 22 テストケース(+15)
  • issue-288-acceptance.test.tsx: 受入テスト 10 シナリオ(新規)
  • message-input-test-utils.ts: 共有テストヘルパー(新規)

Documentation

  • 設計方針書、Issueレビュー・設計レビュー・作業計画・進捗報告
  • CLAUDE.md にモジュールエントリ追加

Test plan

  • 全ユニットテスト Pass(33/33)
  • 全受入テスト Pass(10/10)
  • TypeScript 型チェック Pass
  • ESLint Pass
  • カバレッジ 100% (Statement/Function/Line), 96.55% (Branch)
  • 手動テスト: Desktop でフリー入力後に Enter 送信可能か確認
  • 手動テスト: Mobile でコマンドボタン → フリー入力 → コマンドボタンの遷移確認

🤖 Generated with Claude Code

Kewton and others added 3 commits February 17, 2026 07:45
…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>
@Kewton Kewton merged commit 1c71840 into develop Feb 16, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant