Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c2099b83bd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if let truncatedText = text.truncatedText, !truncatedText.isEmpty { | ||
| inlineImages.removeAll(keepingCapacity: true) | ||
| addPlainTextContent(truncatedText) | ||
| invalidateIntrinsicContentSize() | ||
| return |
There was a problem hiding this comment.
Skip hard truncation when full rich text is requested
This branch truncates every UiRichText longer than 500 characters before lineLimit is considered, so callers that intentionally request full content (for example, detail/expanded paths in StatusUIKitView.buildContentColumnList that use lineLimit = nil) can no longer render the full post. Because it routes to addPlainTextContent, long posts also lose rich runs (links, styling, inline images) even after the user expands.
Useful? React with 👍 / 👎.
| } | ||
| } | ||
| public val isLongText: Boolean = innerText.codePointCount() > 500 | ||
| public val truncatedText: String? = if (isLongText) innerText.take(500) + "…" else null |
There was a problem hiding this comment.
Truncate by code points, not UTF-16 units
isLongText is computed with codePointCount(), but truncatedText uses innerText.take(500), which cuts by UTF-16 code units. For strings containing supplementary characters (e.g. emoji), this can truncate much earlier than 500 code points and may split a surrogate pair at the boundary, producing malformed output; the truncation path should use a code-point-safe substring to match the threshold.
Useful? React with 👍 / 👎.
No description provided.