Skip to content

chore: 清理过时与冗余的代码注释#347

Draft
longsizhuo wants to merge 2 commits into
mainfrom
claude/cleanup-outdated-comments-HXNQT
Draft

chore: 清理过时与冗余的代码注释#347
longsizhuo wants to merge 2 commits into
mainfrom
claude/cleanup-outdated-comments-HXNQT

Conversation

@longsizhuo
Copy link
Copy Markdown
Member

Summary

按项目注释规范全量审计源码,删除"重复说明 WHAT"的冗余注释、误导性残留标记和与 issue/PR 绑定的任务引用;保留所有解释 WHY 的踩坑记录、不变式与降级策略。

主要改动

  • app/components/assistant-ui/thread.tsx:删除 ThreadProps 内重复属性名的注释、各组件前"X 组件"式 header 注释、关于 Composer Viewport 重构的残留备注。
  • app/components/DocsAssistant.tsx:移除占位注释(// 其他需要的属性...)和复述变量名的 state 注释;保留并精炼 showSuggestionsLoader / pendingSuggestions 的真正 WHY(与流式回复抢渲染、loader 解耦)。
  • app/components/rank/HotDocsTab.tsx:删除纯 JSX 区段标签({/* 加载状态 */} 等),条件本身已自解释。
  • app/[locale]/feed/components/LinkCard.tsx:删除整卡可点击区域卡片内容区标题分类 badge 等 JSX 标签注释;保留 referrerPolicy 等踩坑说明。
  • app/components/ZoteroFeed.tsx:删除误导性 // Debug helpers (removed in production) 残留标记。
  • app/components/assistant-ui/assistant-modal.tsx:剥离 issue #285 任务引用,保留"受控 open 是为了让 X 按钮能主动关闭"的 WHY;精炼埋点条件注释。
  • scripts/generate-leaderboard.mjs:删除已不适用的"早期直连 Postgres 5432"历史段落。

Test plan

  • npx tsc --noEmit 仅剩仓库既有的 tsconfig baseUrl 弃用 warning,无新增报错
  • CI lint / typecheck 通过
  • 视觉检查:feed 卡片、热门文档、AI 助手模态、关闭按钮交互未受影响

Generated by Claude Code

- 删除 thread.tsx 中重复说明属性名/函数名的"是什么"注释(标识符已自解释)
- 移除 DocsAssistant.tsx 的占位注释("其他需要的属性...")和重复 state 说明,
  保留并精炼真正解释"为什么"需要 loader/pending 缓存的注释
- 删除 HotDocsTab.tsx、LinkCard.tsx 中纯标签 JSX 区段("加载状态/列表/标题"等)
- 删除 ZoteroFeed.tsx 中误导性的 "Debug helpers (removed in production)" 残留标记
- 删除 assistant-modal.tsx 中 issue #285 任务引用,保留受控 state 的 WHY 说明
- 删除 generate-leaderboard.mjs 中已不适用的"历史:早期直连 Postgres"段落

保留所有解释 WHY 的踩坑记录、不变式、降级策略等有价值注释。
@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
involutionhell-github-io Canceled Canceled May 12, 2026 8:23pm
website-preview Canceled Canceled May 12, 2026 8:23pm

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.

2 participants