fix(sender): correct emoji character counting#313
fix(sender): correct emoji character counting#313SonyLeo wants to merge 1 commit intoopentiny:developfrom
Conversation
WalkthroughThe PR upgrades TipTap dependencies from v3.11.0 to v3.17.1, adds bubble menu and floating menu extensions, introduces grapheme cluster counting via a new utility with Intl.Segmenter support, and updates TypeScript configuration accordingly. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📦 Package Previewpnpm add https://pkg.pr.new/@opentiny/tiny-robot@130d2e8 pnpm add https://pkg.pr.new/@opentiny/tiny-robot-kit@130d2e8 pnpm add https://pkg.pr.new/@opentiny/tiny-robot-svgs@130d2e8 commit: 130d2e8 |
bdfe53c to
130d2e8
Compare

背景
修复字符计数在 emoji、复合字符场景下不准确的问题。
问题说明
Emoji / 复合字符计数不准确
Sender 的字数统计此前基于普通字符串长度计算。对于 emoji、国旗、肤色修饰符、ZWJ 组合字符等场景,一个用户可见字符可能会被统计成多个 code units,导致:
变更内容
Sender 字符计数改为 grapheme 级统计
Intl.SegmenterIntl.Segmenter的环境使用unicode-segmenter兜底影响范围
验证方式
已重点验证以下场景:
Summary by CodeRabbit
New Features
Improvements
Chores