Skip to content

feat(tweets): 推文发布框与正文支持表情选择与内联渲染 - #249

Merged
DefectingCat merged 3 commits into
release/2.0from
feat/tweet-emoji
Aug 20, 2026
Merged

feat(tweets): 推文发布框与正文支持表情选择与内联渲染#249
DefectingCat merged 3 commits into
release/2.0from
feat/tweet-emoji

Conversation

@DefectingCat

Copy link
Copy Markdown
Collaborator

变更内容

  • 后端 TweetDTOQuotedTweetDTO 增加 Emote 表情富化支持,批量提取正文 [name] 占位符并通过 EmojiLookup 查表填充
  • 前端 TweetComposer 增加表情选择器入口,支持在光标位置插入表情占位符
  • 前端 TweetContentTweetCard 接入 emote 映射,支持正文内联表情图片与话题标签共存渲染
  • 完善推文详情页布局结构,并补齐相关单元测试

- TweetDTO 与 QuotedTweetDTO 增加 Emote 映射字段
- toDTOs 批量提取正文 [name] 占位符并通过 EmojiLookup 查表填充
- 补齐推文与引用推文 emote 富化的单测覆盖
- TweetComposer 增加 EmojiPicker 工具栏按钮,支持光标处插入表情占位符
- TweetContent 与 TweetCard 接入 emote 映射,支持内联表情图片与话题标签共存渲染
- 补齐 TweetComposer 与 TweetContent 表情渲染的单测覆盖

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Code Review · MiniMax-M3

评审结论

PR 整体实现质量良好,仅发现 2 处无效注释(类型名/字段名复读),按仓库注释纪律需清理;功能逻辑、错误处理与并发方面无明显缺陷。

created_at: string;
}

/** TweetEmoteRef - 推文表情映射值别名 */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[轻微] 导出类型别名 TweetEmoteRef 上方的 JSDoc "TweetEmoteRef - 推文表情映射值别名" 仅是类型名语义复述,未补充代码自表达之外的信息(如 key 格式、与 TweetCommentEmoteRef 的关系、来源字段等)。

💡 修复计划 (Coding Plan)
删除该 JSDoc;如需保留说明,建议补充代码无法自表达的信息,例如它对应 TweetDTO.emote / QuotedTweetDTO.emote 的 value 类型,key 为 [name] 形式的占位符。

const HASHTAG_REGEX = /#([^#\r\n]{1,50})#/g;

export interface TweetContentProps {
/** 推文正文 */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[轻微] TweetContentProps 中 content: string 字段上的 /** 推文正文 */ 仅是字段名语义复述(父组件名 TweetContent 已暗示这是正文内容),不携带任何额外约束或来源说明。

💡 修复计划 (Coding Plan)
删除该 JSDoc;若仍有保留必要,写出代码无法自表达的内容(如"长度上限 500 rune,原样透传 TweetDTO.content")而非字段名直译。

@DefectingCat
DefectingCat merged commit dbb4e26 into release/2.0 Aug 20, 2026
5 checks passed
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