Skip to content

Fix macro text input cursor reset / マクロ入力のカーソルリセット修正 - #966

Merged
KazumaProject merged 2 commits into
devfrom
codex/fix-issue-956
Sep 3, 2026
Merged

Fix macro text input cursor reset / マクロ入力のカーソルリセット修正#966
KazumaProject merged 2 commits into
devfrom
codex/fix-issue-956

Conversation

@KazumaProject

@KazumaProject KazumaProject commented Sep 3, 2026

Copy link
Copy Markdown
Owner

概要(日本語)

Issue #956 を修正します。

原因

マクロ編集画面の「通常テキスト」は入力ごとに submitList で RecyclerView の行が再バインドされ、EditText.setText() が IME の未確定文字列とカーソル位置をリセットしていました。

対応

  • 同一ブロックの内容変更を DiffUtil の部分更新として処理
  • フォーカス中の入力欄を再設定しない
  • 外部同期時は setTextKeepState() を使用
  • 入力継続とカーソル保持の回帰テストを追加

確認

  • Full/Lite unit tests: passed
  • Full lint: passed
  • 実機(Pixel 6 / Android 17)で Full/Lite の独自日本語 IME を確認
  • あかさたな の入力、削除、再入力で順序とカーソル位置に問題なし

Summary (English)

Root cause

Each edit in the macro editor submitted a new RecyclerView list, causing the normal-text EditText to be rebound. Calling setText() during IME composition reset the composing text and cursor position.

Changes

  • Handle same-block content edits through a DiffUtil partial-update payload
  • Do not rewrite a focused input field
  • Use setTextKeepState() for external synchronization
  • Add regression tests for continued input and cursor preservation

Verification

  • Full/Lite unit tests: passed
  • Full lint: passed
  • Manual Full/Lite verification on Pixel 6 / Android 17 with the app Japanese IME
  • Input of あかさたな, deletion, and re-entry preserved the expected order and cursor position

@KazumaProject KazumaProject self-assigned this Sep 3, 2026
@KazumaProject
KazumaProject merged commit b93b9e2 into dev Sep 3, 2026
1 check passed
@KazumaProject
KazumaProject deleted the codex/fix-issue-956 branch September 3, 2026 05:45
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