FIX: Word limit shouldn't break IME composition

small-lovely-cat
Wed, 08 Apr 2026 03:16:46 +0000
Bug

There exists a bug in discourse boost composer.

For IME using language, like Chinese, the original logic will stop the IME composition when the word is near the limit, causing the bug shown in the figure.

This commit stops the cut when user is composing, while call the cut process after that.

Before:

https://github-production-user-asset-6210df.s3.amazonaws.com/77799160/575044933-75445120-e20c-4858-b316-5bd6bc541ac3.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20260408%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260408T031631Z&X-Amz-Expires=300&X-Amz-Signature=3e73098ccf1ff79c1b952df36cf9530546336ed0b6d1b88a99c2d194b65131ea&X-Amz-SignedHeaders=host

After:

https://github-production-user-asset-6210df.s3.amazonaws.com/77799160/575044714-49e8cf55-0573-47e8-8861-54e9ea8d4b05.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20260408%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20260408T031633Z&X-Amz-Expires=300&X-Amz-Signature=c10ff47d7d4faf43a74138c4a05b84f0a9c797ef530fb2e2fe6ef5f2e6b8ab24&X-Amz-SignedHeaders=host

A PR is raised here:

github.com/discourse/discourse-boosts

FIX: Word limit shouldn't break IME composition (#1)

main ← small-lovely-cat:main

opened 03:15AM - 08 Apr 26 UTC

small-lovely-cat

+19 -1

There exists a bug in discourse boost composer. For IME using language, like …Chinese, the original logic will stop the IME composition when the word is near the limit, causing the bug shown in the figure. This commit stops the cut when user is composing, while call the cut process after that. Before: https://github.com/user-attachments/assets/75445120-e20c-4858-b316-5bd6bc541ac3 After: https://github.com/user-attachments/assets/49e8cf55-0573-47e8-8861-54e9ea8d4b05

1 сообщение - 1 участник