Skip to content

fix: CJK issues - #1252

Draft
asjqkkkk wants to merge 11 commits into
AppFlowy-IO:mainfrom
asjqkkkk:fix/cjk/issues
Draft

asjqkkkk wants to merge 11 commits into
AppFlowy-IO:mainfrom
asjqkkkk:fix/cjk/issues

Conversation

@asjqkkkk

@asjqkkkk asjqkkkk commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Keep the editor connected to the IME while the slash menu is open so users can search during Chinese composition and after confirming a candidate. #1039
  • Preserve the active composing range as Korean input advances across syllables and restore editor shortcuts after confirmation. #755
  • Underline the active composing range and clear the underline on confirmation without adding a formatting attribute to the document. #945
  • Register the Korean editor translations so the delegate can resolve ko and ko_KR. #1127
  • Count Han ideographs and Japanese kana individually and treat CJK punctuation as separators. #773

Additional changes

  • Insert composing text at the offset reported by the IME, including when the caret stays at the beginning of the composing range.
  • Preserve previously converted text when the macOS Japanese IME advances to another clause.
  • Send the caret rectangle to the IME without applying the vertical offset twice.
  • Avoid sending editing-state updates back to the Linux IME during active composition.

Local verification

  • macOS, AppFlowy integration runner — Replayed Chinese slash-menu input and confirmed command insertion. Replayed Japanese clause conversion and confirmed the converted text, composing underline, and caret geometry. Also verified the insertion offset with a replay of Fcitx5-style input events and checked Chinese and Japanese document word counts.
  • iOS simulator, AppFlowy integration runner — Replayed Korean input across syllable boundaries and verified that Backspace leaves composing text intact and resumes after confirmation.
  • Korean localization, macOS — Selected Korean (ko_KR) in AppFlowy and checked the editor's translated labels.

Verification limits

Local runs used macOS and an iOS simulator. The Fcitx5-style sequence was replayed through Flutter on macOS to check the insertion offset. Native Linux IME behavior, including suppression of setEditingState during composition, remains unverified locally.

asjqkkkk and others added 10 commits December 3, 2026 16:10
Keep the editor text input client active while the slash menu is open. Filter during composition and
after commit. Test incremental filtering and Chinese candidate commits through Flutter text input on
native and Web.

Refs AppFlowy-IO#1039
Use the offset reported by the IME during composition. On macOS, replay a Fcitx5-style input
sequence with the caret at the start of the composing range.

Refs AppFlowy-IO#613
Refs AppFlowy-IO#696

Co-authored-by: Ultra-Logos <171011956+Ultra-Logos@users.noreply.github.com>
Use the range reported by mobile IMEs at syllable boundaries and gate hardware shortcuts on the
current composing range. Test successive Korean composing ranges, an in-place commit, and hardware
Backspace before and after composition ends.

Refs AppFlowy-IO#755
Refs AppFlowy-IO/AppFlowy#4207

Co-authored-by: wldnjs990 <wl990@naver.com>
Send the caret geometry without a second vertical offset. Verify the marked-text rectangle sent over
the Flutter text input channel.

Refs AppFlowy-IO/AppFlowy#8997

Co-authored-by: songziming <s.ziming@hotmail.com>
Render the composing range as a temporary underline over the active rich text block. Remove it on
commit or input disconnect without persisting a text style.

Cover draw geometry, commit, and input disconnect with simulated Japanese text input.

Refs AppFlowy-IO#945
Use the composing range reported by macOS so a converted clause is not marked as composing again
when the IME advances to the next clause. Verify the Japanese conversion sequence through Flutter
text input and assert that the editor does not send a corrective editing state.

Refs AppFlowy-IO/AppFlowy#8180
Refs AppFlowy-IO/AppFlowy#6521
Use the Korean translation contributed by intelryzen. Register the language-level locale so both ko
and ko_KR load Korean messages. Verify both locale forms with the editor widget.

Refs AppFlowy-IO#1127

Co-authored-by: 우승식 <intelryzen@naver.com>
Chinese and Japanese are written without spaces between words, so the
whitespace separated counter swallowed a whole sentence as one word.
Count each ideograph as its own word and treat CJK punctuation as a
separator that is never counted.

Refs AppFlowy-IO#773
Like on Windows, the IME owns the editing state while a composing region
is active on Linux. Pushing `setEditingState` back to the engine
mid-composition cancels the composition and corrupts the text.

Native Linux IME verification is pending.

Refs AppFlowy-IO#696
Refs AppFlowy-IO/AppFlowy#4269
Refs AppFlowy-IO/AppFlowy#3540
Japanese mixes kana and kanji inside the same word, so both are counted
per character, the same way Chinese is counted. Korean is written with
spaces between the words, so it keeps using the whitespace separated
count.

Refs AppFlowy-IO#773
@asjqkkkk
asjqkkkk marked this pull request as draft December 3, 2026 09:30
Remove the redundant import and add the required trailing commas in
the integration tests. Apply Dart formatting to the affected tests.

Remove the testing-only annotation from KeyboardServiceWidgetState
because the rich-text renderer and slash menu use it at runtime.

Verified locally with Flutter 3.41.9. The full repository analysis
reported no issues, and all 639 tracked Dart files passed formatting.
@codecov

codecov Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.98630% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.05%. Comparing base (01eccc6) to head (2767adb).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...c/editor/selection_menu/selection_menu_widget.dart 95.00% 4 Missing ⚠️
...tor_component/service/keyboard_service_widget.dart 90.00% 3 Missing ⚠️
.../editor/selection_menu/selection_menu_service.dart 25.00% 3 Missing ⚠️
lib/src/l10n/intl/messages_ko.dart 99.46% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1252      +/-   ##
==========================================
+ Coverage   71.50%   73.05%   +1.55%     
==========================================
  Files         334      335       +1     
  Lines       16647    16940     +293     
==========================================
+ Hits        11903    12376     +473     
+ Misses       4744     4564     -180     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@asjqkkkk asjqkkkk changed the title fix: CJL issues fix: CJK issues Dec 3, 2026
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