Skip to content

fix: preserve IME composing in channel search and RSS import - #8

Merged
sljeff merged 3 commits into
mainfrom
fix/channel-search-ime
Sep 2, 2026
Merged

sljeff merged 3 commits into
mainfrom
fix/channel-search-ime

Conversation

@sljeff

@sljeff sljeff commented Sep 1, 2026

Copy link
Copy Markdown
Owner

What changed

  • Stop rewriting TextEditingController.text on every keystroke in the channel episode search field. That assignment clears IME composing and jumps the caret to the end, which broke WeChat 双拼 (typing ys became yys, confirming 永辉 left the pinyin behind).
  • Only rebuild the Clear button when emptiness changes, and dispose the controller.
  • Convert the Import/Export RSS URL field from a StatelessWidget that constructed a new controller in build into a StatefulWidget with a long-lived, disposed controller. Same controller.text = value write-back is removed.
  • Add widget tests for composing survival, caret position after delete, and controller identity across parent rebuilds.

Why

Third-party iOS IMEs (WeChat keyboard / 双拼) need the composing range to stay intact. Forcing controller.text on onChanged commits composing and resets selection. Creating a controller in build also drops text on any parent rebuild.

Impact

Channel search and settings RSS import only. Discover search and login fields were already fine. No schema, API, signing, or store changes.

Validation

  • Widget tests in test/search_field_ime_test.dart cover composing, caret, and controller lifecycle. Run with flutter test test/search_field_ime_test.dart.
  • Real WeChat 双拼 still needs a physical iPhone. Type yshv on a channel page and confirm 永辉; delete should not jump the caret to the end.

@sljeff
sljeff merged commit 0d49120 into main Sep 2, 2026
6 checks passed
@sljeff
sljeff deleted the fix/channel-search-ime branch September 2, 2026 06:18
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