chennaji9 opened a new pull request, #5213: URL: https://github.com/apache/rocketmq-dashboard/pull/5213
### Which Issue(s) This PR Fixes None — small self-contained fix found by inspection (no issue tracked). ### Brief Description `deriveTitle` and `capTitle` cut conversation titles at 40 and 512 UTF-16 units. When the cut lands inside a supplementary character (emoji in the first user message, or a long manual rename), the stored title keeps a lone high surrogate: it renders as a replacement character and also disagrees with how MySQL counts a `VARCHAR` column (characters = code points). Both cuts now go through the existing `TextBounds.truncate`, the same utility the code-point bounding work introduced for other user-facing text, so a supplementary character is kept whole or dropped whole. Base is `rocketmq-studio` per CONTRIBUTING.md (the PR template's base comment is outdated). ### How Did You Test This Change? `cd server && mvn -B -ntp -Dtest=AiConversationServiceTest test` — 21/21 pass (`Tests run: 21, Failures: 0, Errors: 0, Skipped: 0`, BUILD SUCCESS), including the new `deriveTitleShouldCutOnCodePointBoundariesTest` (39 ASCII + one emoji kept whole at the budget; 40 ASCII + emoji drops the emoji whole; boundary case with trailing text) and `capTitleShouldCutOnCodePointBoundariesTest` (512-code-point emoji-bearing payload kept intact where the old unit cut split the last emoji; 511 ASCII + emoji at budget; null/short regressions). ASCII behaviour is unchanged (existing `x`/`y` repeat tests still pass). ### Checklist - [x] One coherent change; unrelated modifications are not bundled in - [x] Commit subject follows Conventional Commits (`fix:`) - [x] Tests added or updated for non-trivial changes (two new test methods) - [x] New UI text has both Chinese and English entries under `web/src/i18n/` (n/a — no UI change) - [x] Architecture constraints stay green (no layering change; `mvn test` for the touched class passes) - [x] New source files carry the ASF license header (n/a — no new source file) - [x] Documentation touched where behaviour changed (javadoc on the constants and both methods updated) 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
